-
Notifications
You must be signed in to change notification settings - Fork 76
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
Resolve SHA256 to tags automatically if the images specified in the k8s manifests doesn't contain tag. #70
base: main
Are you sure you want to change the base?
Conversation
@jahantech: Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Hi @jahantech. Thanks for your PR. I'm waiting for a jetstack member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Signed-off-by: Jahan Syed <[email protected]>
Signed-off-by: Jahan Syed <[email protected]>
Signed-off-by: Jahan Syed <[email protected]>
ac66e25
to
4d2f0bf
Compare
Signed-off-by: Jahan Syed <[email protected]>
Signed-off-by: Jahan Syed <[email protected]>
Any update on this please if this feature is acceptable? thank you |
Hmm, the problem with this is that multiple tags can be assigned to the same sha. In this current implementation we are just taking the first we come across. This can be wrong most of the time. |
imageURL = *opts.OverrideURL | ||
} | ||
resolvedTag, err := c.search.ResolveSHAToTag(ctx, imageURL, currentSHA) | ||
|
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.
Should we not be doing something with the error here? At least logging it?
|
||
tag, err := s.versionGetter.ResolveSHAToTag(ctx, imageURL, imageSHA) | ||
if err != nil { | ||
fmt.Println("failed to resolve the sha " + err.Error()) |
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.
We never use ‘fmt.Printf’, and instead use a loft which maintains context.
I don’t think a log here is necessary anyway.
tag, err := s.versionGetter.ResolveSHAToTag(ctx, imageURL, imageSHA) | ||
if err != nil { | ||
fmt.Println("failed to resolve the sha " + err.Error()) | ||
return "", fmt.Errorf("failed to resolve sha to tag") |
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.
Include 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.
Some comments from me. The approach makes sense to me!
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: jahantech The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
We currently have a case where the images are resolved to sha256 digest before being added to the manifest. Which means it becomes impossible for us to resolve them back to tags with the current functionality of the version checker. These changes allow the resolution of tags from sha256 in the image field.