diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c9ed1e9af..4c082be522 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,7 +20,7 @@ ### Additions - Add "panic" level for --zap-stacktrace-level (allows "debug", "info", "error", "panic"). ([#3040](https://github.com/operator-framework/operator-sdk/pull/3040)) -- The `operator-sdk` binary has a new CLI workflow and project layout for scaffolding Go operators that is aligned with Kubebuilder's CLI and project layout. See the new [Quickstart Guide](https://sdk.operatorframework.io/docs/golang/quickstart/) and the new [CLI reference](https://v0-19-x.sdk.operatorframework.io/docs/new-cli/) for more details. ([#3190](https://github.com/operator-framework/operator-sdk/pull/3190)) +The `operator-sdk` binary has a new CLI workflow and project layout for scaffolding Go operators that is aligned with Kubebuilder's CLI and project layout. See the new [Quickstart Guide](https://sdk.operatorframework.io/docs/building-operators/golang/quickstart/) and the new [CLI reference](https://v0-19-x.sdk.operatorframework.io/docs/new-cli/) for more details. ([#3190](https://github.com/operator-framework/operator-sdk/pull/3190)) - `bundle validate` can now use a containerd image ("none") tool to unpack images, removing the need for an external image tool like docker/podman. ([#3222](https://github.com/operator-framework/operator-sdk/pull/3222)) - The SDK `scorecard` command adds a new test image, scorecard-test-kuttl, that allows end users to write and execute kuttl based tests. ([#3278](https://github.com/operator-framework/operator-sdk/pull/3278)) - Add "--olm-namespace" flag to olm subcommands (install, uninstall) to allow users to specify the namespace where olm is to be installed or uninstalled. ([#3300](https://github.com/operator-framework/operator-sdk/pull/3300)) diff --git a/changelog/fragments/rescue-reconciliation.yaml b/changelog/fragments/rescue-reconciliation.yaml new file mode 100644 index 0000000000..179ea25607 --- /dev/null +++ b/changelog/fragments/rescue-reconciliation.yaml @@ -0,0 +1,8 @@ +entries: + - description: > + Stop reconciling tasks when the event raised is a rescue in Ansible-based Operators. + More info: [Bugzilla 1856714](https://bugzilla.redhat.com/show_bug.cgi?id=1856714) + + kind: "bugfix" + + breaking: false diff --git a/cmd/operator-sdk/main.go b/cmd/operator-sdk/main.go index 76b4ee6a4e..7ddc379d1c 100644 --- a/cmd/operator-sdk/main.go +++ b/cmd/operator-sdk/main.go @@ -46,7 +46,7 @@ func main() { if operatorType == projutil.OperatorTypeGo { depMsg := "Operator SDK has a new CLI and project layout that is aligned with Kubebuilder.\n" + "See `operator-sdk init -h` and the following doc on how to scaffold a new project:\n" + - "https://sdk.operatorframework.io/docs/golang/quickstart/\n" + + "https://v0-19-x.sdk.operatorframework.io/docs/golang/quickstart/\n" + "To migrate existing projects to the new layout see:\n" + "https://sdk.operatorframework.io/docs/golang/migration/project_migration_guide/\n" projutil.PrintDeprecationWarning(depMsg) diff --git a/hack/tests/e2e-ansible-molecule.sh b/hack/tests/e2e-ansible-molecule.sh index d91ebf6576..1064ba5cca 100755 --- a/hack/tests/e2e-ansible-molecule.sh +++ b/hack/tests/e2e-ansible-molecule.sh @@ -13,7 +13,7 @@ trap_add 'rm -rf $TMPDIR' EXIT pip3 install --user pyasn1==0.4.7 pyasn1-modules==0.2.6 idna==2.8 ipaddress==1.0.22 pip3 install --user molecule==3.0.2 pip3 install --user ansible-lint yamllint -pip3 install --user docker openshift jmespath +pip3 install --user docker==4.2.2 openshift jmespath ansible-galaxy collection install community.kubernetes deploy_prereqs() { diff --git a/internal/util/projutil/project_util.go b/internal/util/projutil/project_util.go index 418320e3ae..bbaebad8f8 100644 --- a/internal/util/projutil/project_util.go +++ b/internal/util/projutil/project_util.go @@ -315,7 +315,7 @@ func CheckGoModules() error { } if !goModOn { return fmt.Errorf(`using go modules requires GO111MODULE="on", "auto", or unset.` + - ` More info: https://sdk.operatorframework.io/docs/golang/quickstart/#a-note-on-dependency-management`) + ` More info: https://v0-19-x.sdk.operatorframework.io/docs/golang/quickstart/#a-note-on-dependency-management`) } return nil } diff --git a/pkg/ansible/controller/reconcile.go b/pkg/ansible/controller/reconcile.go index 62aa3c540b..25b977e96c 100644 --- a/pkg/ansible/controller/reconcile.go +++ b/pkg/ansible/controller/reconcile.go @@ -186,7 +186,7 @@ func (r *AnsibleOperatorReconciler) Reconcile(request reconcile.Request) (reconc return reconcile.Result{}, err } } - if event.Event == eventapi.EventRunnerOnFailed && !event.IgnoreError() { + if event.Event == eventapi.EventRunnerOnFailed && !event.IgnoreError() && !event.Rescued() { failureMessages = append(failureMessages, event.GetFailedPlaybookMessage()) } } diff --git a/pkg/ansible/runner/eventapi/types.go b/pkg/ansible/runner/eventapi/types.go index f8098da3e8..d0ba259e7b 100644 --- a/pkg/ansible/runner/eventapi/types.go +++ b/pkg/ansible/runner/eventapi/types.go @@ -122,3 +122,15 @@ func (je JobEvent) IgnoreError() bool { } return false } + +// Rescued - Detects whether or not a task was rescued +func (je JobEvent) Rescued() bool { + if rescued, contains := je.EventData["rescued"]; contains { + for _, v := range rescued.(map[string]interface{}) { + if int(v.(float64)) == 1 { + return true + } + } + } + return false +}