-
Notifications
You must be signed in to change notification settings - Fork 65
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
update HasUniqueTag logic to fall back to the value the user provided #759
update HasUniqueTag logic to fall back to the value the user provided #759
Conversation
There might be a better way to throw errors in the tests, so if there is please let me know! Thanks! |
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.
Couple of changes, and please fix the DeferCleanup on L109 to be consistent.
if strings.HasPrefix(imgRef.ImageTagOrSha, "sha256:") { | ||
tags, err = p.getDataToValidate(ctx, imgRepo) | ||
if err != nil { | ||
return false, fmt.Errorf("failed to get tags list for %s when sha256 provided: %v", imgRepo, err) |
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 looks like the only difference between these is just the log message. I don't think that necessarily adds any value. This can be reduced to a single if this || that
.
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.
Along this line, to improve readability, I'd say that these two cases should be methods or functions. Then it literally becomes if this || that
.
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.
This has been simplified, into one if
statement.
Barring what Brad already said (I'm in agreement), this LGTM. /lgtm |
…, if they do not provide a sha, or a latest tag Signed-off-by: Adam D. Cornett <adc@redhat.com>
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.
/lgtm
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: acornett21, bcrochet, komish 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 |
Updating the HashUniqueTag logic to follow the below rules:
The order above is so that the failover logic can be preserved for partners where we call the partners registry, and
/tags/list
is available but they also returntags
as an empty list.Signed-off-by: Adam D. Cornett adc@redhat.com