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

Bug 1548311 - Return success on depro extcred miss #791

Merged
merged 1 commit into from
Feb 27, 2018

Conversation

eriknelson
Copy link
Contributor

Forward port of #790 to master

@openshift-ci-robot openshift-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Feb 24, 2018
Copy link
Contributor

@jmrodri jmrodri left a 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.

log.Error("failed to delete extracted credentials - %v", err)
err := dao.DeleteExtractedCredentials(instanceID)

if err != nil && strings.Contains(err.Error(), etcdKeyNotFoundContents) {
Copy link
Contributor

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

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)
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@openshift-ci-robot openshift-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Feb 27, 2018
@eriknelson
Copy link
Contributor Author

@jmrodri updated to use client.IsKeyNotFound.

@jmrodri jmrodri merged commit c4f9483 into openshift:master Feb 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants