Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Crane
Commits
cbeac1c0
Commit
cbeac1c0
authored
3 years ago
by
qmhu
Browse files
Options
Download
Email Patches
Plain Diff
revert to status update to support 1.14
parent
8e9b55e9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pkg/controller/ehpa/effective_hpa_controller.go
+1
-3
pkg/controller/ehpa/effective_hpa_controller.go
pkg/controller/ehpa/hpa.go
+1
-1
pkg/controller/ehpa/hpa.go
with
2 additions
and
4 deletions
+2
-4
pkg/controller/ehpa/effective_hpa_controller.go
+
1
-
3
View file @
cbeac1c0
...
...
@@ -130,10 +130,8 @@ func (c *EffectiveHPAController) UpdateStatus(ctx context.Context, ehpa *autosca
if
!
equality
.
Semantic
.
DeepEqual
(
&
ehpa
.
Status
,
newStatus
)
{
klog
.
V
(
4
)
.
Infof
(
"EffectiveHorizontalPodAutoscaler status should be updated, currentStatus %v newStatus %v"
,
&
ehpa
.
Status
,
newStatus
)
// use patch to avoid conflict errors
patch
:=
client
.
MergeFrom
(
ehpa
)
ehpa
.
Status
=
*
newStatus
err
:=
c
.
Patch
(
ctx
,
ehpa
,
patch
)
err
:=
c
.
Status
()
.
Update
(
ctx
,
ehpa
)
if
err
!=
nil
{
c
.
Recorder
.
Event
(
ehpa
,
v1
.
EventTypeNormal
,
"FailedUpdateStatus"
,
err
.
Error
())
klog
.
Errorf
(
"Failed to update status, ehpa %s error %v"
,
klog
.
KObj
(
ehpa
),
err
)
...
...
This diff is collapsed.
Click to expand it.
pkg/controller/ehpa/hpa.go
+
1
-
1
View file @
cbeac1c0
...
...
@@ -68,7 +68,7 @@ func (c *EffectiveHPAController) CreateHPA(ctx context.Context, ehpa *autoscalin
err
=
c
.
Client
.
Create
(
ctx
,
hpa
)
if
err
!=
nil
{
c
.
Recorder
.
Event
(
ehpa
,
v1
.
EventTypeNormal
,
"FailedCreateHPA"
,
err
.
Error
())
klog
.
Errorf
(
"Failed to create HorizontalPodAutoscaler, error %v"
,
hpa
,
err
)
klog
.
Errorf
(
"Failed to create HorizontalPodAutoscaler
%s
, error %v"
,
klog
.
KObj
(
hpa
)
,
err
)
return
nil
,
err
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help