Skip to content

Commit

Permalink
improvement hpa substitute and tsp
Browse files Browse the repository at this point in the history
  • Loading branch information
ying.ding committed Jan 13, 2023
2 parents 472e99a + 495b1ae commit c81f868
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 19 deletions.
19 changes: 0 additions & 19 deletions pkg/controller/ehpa/effective_hpa_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,9 @@ func (c *EffectiveHPAController) Reconcile(ctx context.Context, req ctrl.Request
}

func (c *EffectiveHPAController) UpdateStatus(ctx context.Context, ehpa *autoscalingapi.EffectiveHorizontalPodAutoscaler, newStatus *autoscalingapi.EffectiveHorizontalPodAutoscalerStatus) {
<<<<<<< HEAD
if !equality.Semantic.DeepEqual(&ehpa.Status, newStatus) {
ehpaCopy := ehpa.DeepCopy()
err := retry.RetryOnConflict(retry.DefaultRetry, func() error {
=======
ehpaCopy := ehpa.DeepCopy()
err := retry.RetryOnConflict(retry.DefaultRetry, func() error {
if !equality.Semantic.DeepEqual(&ehpaCopy.Status, newStatus) {
>>>>>>> 495b1ae2 (Merge branch 'gocrane:main' into main)
ehpaCopy.Status = *newStatus
err := c.Status().Update(ctx, ehpaCopy)
if err == nil {
Expand All @@ -176,18 +170,6 @@ func (c *EffectiveHPAController) UpdateStatus(ctx context.Context, ehpa *autosca
}

return err
<<<<<<< HEAD

})

if err != nil {
c.Recorder.Event(ehpa, v1.EventTypeWarning, "FailedUpdateStatus", err.Error())
klog.Errorf("Failed to update status, EffectiveHorizontalPodAutoscaler %s error %v", klog.KObj(ehpa), err)
return
}

klog.V(2).Infof("Update EffectiveHorizontalPodAutoscaler %s status successful ", klog.KObj(ehpa))
=======
}

return nil
Expand All @@ -197,7 +179,6 @@ func (c *EffectiveHPAController) UpdateStatus(ctx context.Context, ehpa *autosca
c.Recorder.Event(ehpa, v1.EventTypeWarning, "FailedUpdateStatus", err.Error())
klog.Errorf("Failed to update status, EffectiveHorizontalPodAutoscaler %s error %v", klog.KObj(ehpa), err)
return
>>>>>>> 495b1ae2 (Merge branch 'gocrane:main' into main)
}

klog.V(2).Infof("Update EffectiveHorizontalPodAutoscaler %s status successful ", klog.KObj(ehpa))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -414,12 +414,15 @@ func (c *RecommendationRuleController) executeMission(ctx context.Context, wg *s
}

func (c *RecommendationRuleController) UpdateStatus(ctx context.Context, recommendationRule *analysisv1alph1.RecommendationRule, newStatus *analysisv1alph1.RecommendationRuleStatus) {
<<<<<<< HEAD
<<<<<<< HEAD
if !equality.Semantic.DeepEqual(&recommendationRule.Status, newStatus) {
klog.V(2).Infof("Updating RecommendationRule %s status", klog.KObj(recommendationRule))
recommendationRuleCopy := recommendationRule.DeepCopy()
err := retry.RetryOnConflict(retry.DefaultRetry, func() error {
=======
=======
>>>>>>> temp
klog.V(2).Infof("Updating RecommendationRule %s status", klog.KObj(recommendationRule))
recommendationRuleCopy := recommendationRule.DeepCopy()
err := retry.RetryOnConflict(retry.DefaultRetry, func() error {
Expand Down Expand Up @@ -452,7 +455,10 @@ func (c *RecommendationRuleController) UpdateStatus(ctx context.Context, recomme
=======

klog.V(2).Infof("Update RecommendationRule status successful, RecommendationRule %s", klog.KObj(recommendationRule))
<<<<<<< HEAD
>>>>>>> 495b1ae2 (Merge branch 'gocrane:main' into main)
=======
>>>>>>> temp
}

type ObjectIdentity struct {
Expand Down

0 comments on commit c81f868

Please sign in to comment.