Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(controller): Fix for rollouts getting stuck in loop #2689

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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