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

ROX-12219: Add support for pause-reconcile annotation #29

Merged
merged 3 commits into from
Sep 19, 2022

Conversation

vladbologa
Copy link
Contributor

@vladbologa vladbologa commented Sep 2, 2022

Implemented support for customizable "pause-reconcile" annotation, and added unit tests.

Comment on lines 36 to 37
ReasonUninstallSuccessful = status.ConditionReason("UninstallSuccessful")
ReasonPauseReconcileAnnotationSet = status.ConditionReason("PauseReconcileAnnotationSet")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
ReasonUninstallSuccessful = status.ConditionReason("UninstallSuccessful")
ReasonPauseReconcileAnnotationSet = status.ConditionReason("PauseReconcileAnnotationSet")
ReasonUninstallSuccessful = status.ConditionReason("UninstallSuccessful")
ReasonPauseReconcileAnnotationSet = status.ConditionReason("PauseReconcileAnnotationSet")

Copy link
Member

Choose a reason for hiding this comment

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

nit: WDYTH renaming ReasonPauseReconcileAnnotationSet to ReasonPauseReconcileAnnotationPresent?

The Set in the end sounds to me like an action which happens.

Copy link
Collaborator

Choose a reason for hiding this comment

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

The only problem is that mere presence does not cause this. The value needs to be true. I renamed to ReasonPauseReconcileAnnotationTrue.
Please let me know what you think.

pkg/reconciler/reconciler.go Outdated Show resolved Hide resolved
pkg/reconciler/reconciler.go Outdated Show resolved Hide resolved
pkg/reconciler/reconciler_test.go Show resolved Hide resolved
Copy link
Collaborator

@porridge porridge left a comment

Choose a reason for hiding this comment

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

FTR, this is the reason why stackrox/stackrox#2953 tests are failing.

pkg/reconciler/reconciler.go Outdated Show resolved Hide resolved
Copy link
Member

@SimonBaeumer SimonBaeumer left a comment

Choose a reason for hiding this comment

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

Good job!
@porridge my review is finished, just some nits on naming. I think your review already covers the most important parts.

Comment on lines 36 to 37
ReasonUninstallSuccessful = status.ConditionReason("UninstallSuccessful")
ReasonPauseReconcileAnnotationSet = status.ConditionReason("PauseReconcileAnnotationSet")
Copy link
Member

Choose a reason for hiding this comment

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

nit: WDYTH renaming ReasonPauseReconcileAnnotationSet to ReasonPauseReconcileAnnotationPresent?

The Set in the end sounds to me like an action which happens.

pkg/reconciler/reconciler.go Outdated Show resolved Hide resolved
pkg/reconciler/reconciler_test.go Outdated Show resolved Hide resolved
pkg/reconciler/reconciler_test.go Outdated Show resolved Hide resolved
Expect(err).To(BeNil())
})

By("getting the CR", func() {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
By("getting the CR", func() {
By("getting the CR verify the reconciler is paused", func() {

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sorry, I cannot parse your suggestion.

Expect(err).To(BeNil())
})

By("verifying the release is uninstalled", func() {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
By("verifying the release is uninstalled", func() {
By("verifying reconciliation unpaused and the release is uninstalled", func() {

Copy link
Collaborator

Choose a reason for hiding this comment

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

Well, we don't actually check the status here, so I'd leave this as is...

@porridge porridge changed the base branch from main to rebase-main-2022-09-01 September 7, 2022 09:58
@porridge
Copy link
Collaborator

porridge commented Sep 7, 2022

FTR, I changed base branch from main to rebase-main-2022-09-01 in order to keep the diff sane after I force-push the backed-up main to main.
I will rebase this PR on top of the restored main next.

@porridge porridge force-pushed the vbologa/ROX-12219-pause-reconcile-annotation branch from 17b3f45 to 2985fab Compare September 15, 2022 09:41
@porridge porridge changed the base branch from rebase-main-2022-09-01 to main September 15, 2022 09:42
Comment on lines 36 to 37
ReasonUninstallSuccessful = status.ConditionReason("UninstallSuccessful")
ReasonPauseReconcileAnnotationSet = status.ConditionReason("PauseReconcileAnnotationSet")
Copy link
Collaborator

Choose a reason for hiding this comment

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

The only problem is that mere presence does not cause this. The value needs to be true. I renamed to ReasonPauseReconcileAnnotationTrue.
Please let me know what you think.

Expect(err).To(BeNil())
})

By("getting the CR", func() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Sorry, I cannot parse your suggestion.

Expect(err).To(BeNil())
})

By("verifying the release is uninstalled", func() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Well, we don't actually check the status here, so I'd leave this as is...

@porridge porridge merged commit 89f9785 into main Sep 19, 2022
misberner pushed a commit that referenced this pull request Oct 3, 2022
Co-authored-by: Marcin Owsiany <porridge@redhat.com>
ludydoo pushed a commit that referenced this pull request Jun 27, 2023
Co-authored-by: Marcin Owsiany <porridge@redhat.com>
ludydoo pushed a commit that referenced this pull request Jun 27, 2023
Co-authored-by: Marcin Owsiany <porridge@redhat.com>
ludydoo pushed a commit that referenced this pull request Jun 27, 2023
Co-authored-by: Marcin Owsiany <porridge@redhat.com>
ludydoo pushed a commit that referenced this pull request Jun 29, 2023
Co-authored-by: Marcin Owsiany <porridge@redhat.com>
ludydoo pushed a commit that referenced this pull request Aug 4, 2023
Co-authored-by: Marcin Owsiany <porridge@redhat.com>
porridge added a commit that referenced this pull request Sep 5, 2024
Co-authored-by: Marcin Owsiany <porridge@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants