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
Bug 1548311 - Return success on depro extcred miss #791
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the strings.Contains feels weird. I think we started using the IsKeyNotFound for etcd errors.
pkg/broker/deprovision_subscriber.go
Outdated
| log.Error("failed to delete extracted credentials - %v", err) | ||
| err := dao.DeleteExtractedCredentials(instanceID) | ||
|
|
||
| if err != nil && strings.Contains(err.Error(), etcdKeyNotFoundContents) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the other places we do dao calls this is how we check for the not found key error:
if err != nil {
// no jobs or states to recover, this is OK.
if client.IsKeyNotFound(err) {
log.Info("No jobs to recover")
return "", nil
}
return "", err
}
The above comes from broker.go
pkg/broker/deprovision_subscriber.go
Outdated
| err := dao.DeleteExtractedCredentials(instanceID) | ||
|
|
||
| if err != nil && strings.Contains(err.Error(), etcdKeyNotFoundContents) { | ||
| log.Debugf("Attempted to delete extracted credentials, but key was not found: [%v]", instanceID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will we ever want to know this in production? That is would we want to see it at INFO level? If not, leave it at debug. Just wondering if this will be useful information or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's probably useful in production, I'll bump it up to INFO.
0e39e73
to
de55f9a
Compare
|
@jmrodri updated to use |
Forward port of #790 to master