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

Backport: pkg/helm/controller/reconcile.go: fix conditions logic (#1321) #1370

Merged
merged 1 commit into from
May 2, 2019
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
### Bug Fixes

- Pin dependency versions in Ansible build and test framework Dockerfiles to fix broken build and test framework images. ([#1348](https://github.com/operator-framework/operator-sdk/pull/1348))
- In Helm-based operators, when a custom resource with a failing release is reverted back to a working state, the `ReleaseFailed` condition is now correctly removed. ([#1321](https://github.com/operator-framework/operator-sdk/pull/1321))

## v0.7.0

Expand Down
8 changes: 8 additions & 0 deletions pkg/helm/controller/reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,14 @@ func (r HelmOperatorReconciler) Reconcile(request reconcile.Request) (reconcile.
return reconcile.Result{RequeueAfter: r.ReconcilePeriod}, err
}

// If a change is made to the CR spec that causes a release failure, a
// ConditionReleaseFailed is added to the status conditions. If that change
// is then reverted to its previous state, the operator will stop
// attempting the release and will resume reconciling. In this case, we
// need to remove the ConditionReleaseFailed because the failing release is
// no longer being attempted.
status.RemoveCondition(types.ConditionReleaseFailed)

expectedRelease, err := manager.ReconcileRelease(context.TODO())
if err != nil {
log.Error(err, "Failed to reconcile release")
Expand Down