Skip to content

Commit

Permalink
fix(controller): Fix for rollouts getting stuck in loop (#2689)
Browse files Browse the repository at this point in the history
* possible fix for sutck rollouts

Signed-off-by: zachaller <[email protected]>

* add comments

Signed-off-by: zachaller <[email protected]>

* add comments

Signed-off-by: zachaller <[email protected]>

* update comments

Signed-off-by: zachaller <[email protected]>

---------

Signed-off-by: zachaller <[email protected]>
  • Loading branch information
zachaller committed May 5, 2023
1 parent a402042 commit ea685ce
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions rollout/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -413,13 +413,18 @@ func (c *Controller) syncHandler(ctx context.Context, key string) error {
}

err = roCtx.reconcile()
if roCtx.newRollout != nil {
c.writeBackToInformer(roCtx.newRollout)
}
if err != nil {
logCtx.Errorf("roCtx.reconcile err %v", err)
// return an err here so that we do not update the informer cache with a "bad" rollout object, for the case when
// we get an error during reconciliation but c.newRollout still gets updated this can happen in syncReplicaSetRevision
// https://github.com/argoproj/argo-rollouts/issues/2522#issuecomment-1492181154 I also believe there are other cases
// that newRollout can get updated while we get an error during reconciliation
return err
}
return err
if roCtx.newRollout != nil {
c.writeBackToInformer(roCtx.newRollout)
}
return nil
}

// writeBackToInformer writes a just recently updated Rollout back into the informer cache.
Expand Down

0 comments on commit ea685ce

Please sign in to comment.