Skip to content

Fix ansible-operator finalizer concurrency issue#5678

Merged
asmacdo merged 5 commits intooperator-framework:masterfrom
asmacdo:4909-fix-ansible-finalizer-race
Apr 28, 2022
Merged

Fix ansible-operator finalizer concurrency issue#5678
asmacdo merged 5 commits intooperator-framework:masterfrom
asmacdo:4909-fix-ansible-finalizer-race

Conversation

@asmacdo
Copy link
Copy Markdown
Member

@asmacdo asmacdo commented Apr 25, 2022

For ansible-based operators, this change fixes an issue that caused
finalizers to fail to run if the watched resource (CR) is deleted during
reconciliation.

Fixes #4909

Signed-off-by: Austin Macdonald austin@redhat.com

Description of the change:

Motivation for the change:

Checklist

If the pull request includes user-facing changes, extra documentation is required:

For ansible-based operators, this change fixes an issue that caused
finalizers to fail to run if the watched resource (CR) is deleted during
reconciliation.

Fixes operator-framework#4909

Signed-off-by: Austin Macdonald <austin@redhat.com>
@asmacdo asmacdo force-pushed the 4909-fix-ansible-finalizer-race branch from ff4991c to 5d3b1c3 Compare April 25, 2022 14:51
asmacdo added 2 commits April 25, 2022 11:28
Signed-off-by: Austin Macdonald <austin@redhat.com>
Signed-off-by: Austin Macdonald <austin@redhat.com>
Copy link
Copy Markdown
Contributor

@everettraven everettraven left a comment

Choose a reason for hiding this comment

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

The changes look good and make sense to me, but because I feel I don't know enough about Ansible operators I will leave explicit approval to someone more knowledgeable.

Copy link
Copy Markdown
Member

@jmrodri jmrodri left a comment

Choose a reason for hiding this comment

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

/lgtm

Just a couple nits but they can be fixed later if we want. The biggest one is the makefile targets should be in a .PHONY.

Comment thread Makefile
@@ -0,0 +1,58 @@
---
# TODO(asmacdo) this should be the only task. the other is getting magiced in
- name: Create the test.example.com/v1alpha1.FinalizerConcurrencyTest
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

is there a reason the file is finalizerconcurrencytest_test? vs finalizerconcurrency_test?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes, but its not a good one. The testdata generation takes the Kind name "FinalizerConcurrenctTest" and automagically creates a verify task finalizerconcurrencytest_test. Rather than delete that and put mine in place, I just clobbered it.

Comment thread hack/tests/e2e-ansible-molecule.sh Outdated
@openshift-ci openshift-ci Bot added lgtm Indicates that a PR is ready to be merged. and removed lgtm Indicates that a PR is ready to be merged. labels Apr 27, 2022
@asmacdo asmacdo added this to the v1.20.0 milestone Apr 28, 2022
@asmacdo asmacdo force-pushed the 4909-fix-ansible-finalizer-race branch from 6143ae2 to 518595e Compare April 28, 2022 15:26
Signed-off-by: Austin Macdonald <austin@redhat.com>
@asmacdo asmacdo force-pushed the 4909-fix-ansible-finalizer-race branch from 518595e to 18936db Compare April 28, 2022 15:37
Comment thread Makefile

KUBEBUILDER_ASSETS = $(PWD)/$(shell go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest && $(shell go env GOPATH)/bin/setup-envtest use $(ENVTEST_K8S_VERSION) --bin-dir tools/bin/ -p path)
test-e2e-setup: build
test-e2e-setup:: build dev-install cluster-create
Copy link
Copy Markdown
Member Author

@asmacdo asmacdo Apr 28, 2022

Choose a reason for hiding this comment

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

@ryantking Since you just changed this thought you might want to have a look. After digging in, the memcached-molecule test needs to create its own cluster, so I had to separate the make targets.

@asmacdo asmacdo modified the milestones: v1.20.0, v1.21.0 Apr 28, 2022
Signed-off-by: Austin Macdonald <austin@redhat.com>
@laxmikantbpandhare laxmikantbpandhare self-requested a review April 28, 2022 17:23
Copy link
Copy Markdown
Member

@laxmikantbpandhare laxmikantbpandhare left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Apr 28, 2022
@asmacdo asmacdo modified the milestones: v1.21.0, v1.20.0 Apr 28, 2022
@asmacdo asmacdo merged commit fee9778 into operator-framework:master Apr 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ansible operator finalizer is not called when CR is deleted during a reconcile

4 participants