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

[OSPRH-9371] Fix VerifySecret so it requeues when necessary #149

Merged
merged 1 commit into from
Aug 9, 2024

Conversation

abays
Copy link
Contributor

@abays abays commented Aug 9, 2024

We've come to realize three things recently:

  1. Returning an error to the reconciler along with a RequeueAfter will cause the reconciler to abandon the explicit requeue and only consider the error [1].
  2. The VerifySecret function in lib-common was returning an error along with a requeue, thus contributing to the problem listed in item 1. [2]
  3. Also, the error VerifySecret was returning was not a "not found" error, but a generic k8s error -- so it wouldn't be properly handled by callers looking for a "not found" error. [3]

Now VerifySecret only returns a non-empty ctrl.Result{} if the Secret is missing, so let's handle that case in a separate if-clause. [4]

Jira: https://issues.redhat.com/browse/OSPRH-9371

[1] openstack-k8s-operators/keystone-operator#459
[2] https://github.com/openstack-k8s-operators/lib-common/blob/ad3edb6e67ab738cfdbf4e2e78ac403784a08ab7/modules/common/secret/secret.go#L423-L425
[3] https://github.com/openstack-k8s-operators/lib-common/blob/ad3edb6e67ab738cfdbf4e2e78ac403784a08ab7/modules/common/secret/secret.go#L425
[4] https://github.com/openstack-k8s-operators/lib-common/blob/579da98fa7a62b70b43cdba92e82d6497afe8835/modules/common/secret/secret.go#L425-L427

@openshift-ci openshift-ci bot requested review from stuggi and vakwetu August 9, 2024 11:13
@openshift-ci openshift-ci bot added the approved label Aug 9, 2024
@abays abays requested a review from dmendiza August 9, 2024 11:13
Copy link
Contributor

@stuggi stuggi left a comment

Choose a reason for hiding this comment

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

/lgtm

Copy link

openshift-ci bot commented Aug 9, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: abays, stuggi

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit 56b5125 into openstack-k8s-operators:main Aug 9, 2024
6 checks passed
@abays
Copy link
Contributor Author

abays commented Sep 18, 2024

/cherry-pick 18.0.0-proposed

@openshift-cherrypick-robot

@abays: #149 failed to apply on top of branch "18.0.0-proposed":

Applying: Fix VerifySecret so it requeues when necessary
Using index info to reconstruct a base tree...
M	api/go.mod
M	api/go.sum
M	controllers/barbicanapi_controller.go
M	go.mod
M	go.sum
Falling back to patching base and 3-way merge...
Auto-merging go.sum
CONFLICT (content): Merge conflict in go.sum
Auto-merging go.mod
CONFLICT (content): Merge conflict in go.mod
Auto-merging api/go.sum
Auto-merging api/go.mod
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Fix VerifySecret so it requeues when necessary
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick 18.0.0-proposed

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

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