Skip to content
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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
8 changes: 8 additions & 0 deletions changelog/fragments/rescue-reconciliation.yaml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion cmd/operator-sdk/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion hack/tests/e2e-ansible-molecule.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion internal/util/projutil/project_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/ansible/controller/reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ func (r *AnsibleOperatorReconciler) Reconcile(request reconcile.Request) (reconc
return reconcile.Result{}, err
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is missing the fragment with the bug fix which will be used to gen the CHANGELOG.
if it was not added in master we also need a PR with it there as well.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh ok. I'll make that change here & open a PR on master as well then. Thanks.

}
}
if event.Event == eventapi.EventRunnerOnFailed && !event.IgnoreError() {
if event.Event == eventapi.EventRunnerOnFailed && !event.IgnoreError() && !event.Rescued() {
failureMessages = append(failureMessages, event.GetFailedPlaybookMessage())
}
}
Expand Down
12 changes: 12 additions & 0 deletions pkg/ansible/runner/eventapi/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}