Commit cbeac1c0 authored by qmhu's avatar qmhu
Browse files

revert to status update to support 1.14

parent 8e9b55e9
Showing with 2 additions and 4 deletions
+2 -4
......@@ -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)
......
......@@ -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
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment