Closed abays closed 2 months ago
[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
/cherry-pick 18.0.0-proposed
@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".
We've come to realize three things recently:
RequeueAfter
will cause the reconciler to abandon the explicit requeue and only consider the error [1].VerifySecret
function inlib-common
was returning an error along with a requeue, thus contributing to the problem listed in item 1. [2]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-emptyctrl.Result{}
if theSecret
is missing, so let's handle that case in a separate if-clause. [4]Jira: https://issues.redhat.com/browse/OSPRH-9371
[1] https://github.com/openstack-k8s-operators/keystone-operator/pull/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