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

Credential was deleted due to "Failed to update online status" #217

Closed
qibobo opened this issue Sep 23, 2020 · 3 comments
Closed

Credential was deleted due to "Failed to update online status" #217

qibobo opened this issue Sep 23, 2020 · 3 comments
Labels
help wanted Extra attention is needed

Comments

@qibobo
Copy link
Contributor

qibobo commented Sep 23, 2020

When there are multiple CRD consume the Binding CR and they will fetch the binding secret and save them in another secret. So when the following error occurred, the ICO will delete and regenerate IBM service credential, which make the consumers' secret stale.

{"level":"info","ts":1600754662.29132,"logger":"binding","msg":"Failed to update online status, will delete external resource ","code-engine-cos-codeengine-credential":"Operation cannot be fulfilled on bindings.ibmcloud.ibm.com \"code-engine-cos-codeengine-credential\": the object has been modified; please apply your changes to the latest version and try again"}

I believe the update error happens inside https://github.com/IBM/cloud-operators/blob/master/controllers/binding_controller.go#L340.

How about using client-go RetryOnConflict https://github.com/kubernetes/client-go/blob/master/util/retry/util.go#L68-L105 to avoid deleteCredential when it is a conflict error?

@cdlliuy
Copy link
Contributor

cdlliuy commented Sep 29, 2020

@JohnStarich How about using client-go RetryOnConflict https://github.com/kubernetes/client-go/blob/master/util/retry/util.go#L68-L105 to avoid deleteCredential when it is a conflict error?

@JohnStarich JohnStarich added the help wanted Extra attention is needed label Oct 12, 2020
@JohnStarich
Copy link
Member

Agreed, deleting the resource should be avoided where we could do an update instead. I think we should also use ctrl.CreateOrUpdate, which automatically creates the resource if it does not exist, or mutates and updates if it does.

If you would like to open a PR, we can review 👍

qibobo added a commit to qibobo/cloud-operators that referenced this issue Oct 13, 2020
qibobo added a commit to qibobo/cloud-operators that referenced this issue Oct 13, 2020
qibobo added a commit to qibobo/cloud-operators that referenced this issue Oct 13, 2020
qibobo added a commit to qibobo/cloud-operators that referenced this issue Oct 13, 2020
qibobo added a commit to qibobo/cloud-operators that referenced this issue Nov 4, 2020
@JohnStarich
Copy link
Member

Fixed in #226 and release on GitHub in v1.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants