-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Fix DockerImageName compatibility check when digest is present #11629
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
base: main
Are you sure you want to change the base?
Changes from 2 commits
6c576a5
6da85e7
a63de7c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -79,8 +79,20 @@ class Sha256Versioning implements Versioning { | |
|
|
||
| private final String hash; | ||
|
|
||
| @EqualsAndHashCode.Exclude | ||
| private final String tag; | ||
|
|
||
| Sha256Versioning(String hash) { | ||
| this(hash, null); | ||
| } | ||
|
|
||
| Sha256Versioning(String hash, String tag) { | ||
| this.hash = hash; | ||
| this.tag = tag; | ||
| } | ||
|
Comment on lines
+88
to
+91
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
After introducing the optional Useful? React with 👍 / 👎. |
||
|
|
||
| String getTag() { | ||
| return tag; | ||
| } | ||
|
|
||
| @Override | ||
|
|
||
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 branch assumes
beforeDigest.split(":")[1]always exists, but Java drops trailing empty segments, so an input likerepo:@sha256:...throwsArrayIndexOutOfBoundsExceptionduring parse instead of being rejected cleanly byassertValid(). That turns a user-facing validation error into an unexpected runtime crash path for malformed image names.Useful? React with 👍 / 👎.