-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Fix jib tagging #1475
Fix jib tagging #1475
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1475 +/- ##
==========================================
- Coverage 44.43% 44.42% -0.01%
==========================================
Files 112 112
Lines 4641 4642 +1
==========================================
Hits 2062 2062
- Misses 2372 2373 +1
Partials 207 207
Continue to review full report at Codecov.
|
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 should probably expose a simpler remote.AddTag
implementation in go-containerregistry for this, since we can optimize that a bit better than the whole remote.Write
flow.
@@ -84,7 +86,7 @@ func retrieveRemoteConfig(identifier string) (*v1.ConfigFile, error) { | |||
} | |||
|
|||
func remoteImage(identifier string) (v1.Image, error) { | |||
ref, err := name.ParseReference(identifier, name.WeakValidation) | |||
ref, err := name.ParseReference(identifier, name.StrictValidation) |
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 might have unintended consequences since it's used in a few places. If you're confident in your test coverage, it's probably fine 😃
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.
yeah it's slightly risky, but it's the "right" thing to do since we should never be passing an invalid reference anyway. I'll take responsibility if it breaks something 👀
That would be nice 😄 |
Great, when is the next release expected? (tag v0.2x)? |
How often is https://storage.googleapis.com/skaffold/builds/latest/skaffold-darwin-amd64 built/updated? |
@NicklasWallgren we've been on a short hiatus because of the holidays, but we normally release on a 2 week cycle every other Thursday. this should go out with the v0.21.0 release tomorrow. |
Fixes #1460
This fixes an issue when tagging a remote image built by jib directly to the registry.
Previously, the digest of the remote image was being passed to
docker.AddTag()
, which uses go-containerregistry'sname.ParseReference()
to retrieve a remote image reference to add a new tag.The issue was that Skaffold was using "WeakValidation", which tells the go-containerregistry to try and infer the remote registry in the event that we don't pass one in: so in trying to retrieve the remote image reference via image digest (e.g.
sha256:deadbeef...
), we were receiving back a "valid" remote reference toindex.docker.io/sha256:deadbeef....
.This change prepends the remote registry specified in the artifact to the provided remote digest (where we retrieved it from anyway) before attempting to add the tag, ensuring that the remote image reference comes from the place we expect it to. This also changes the call to
name.ParseReference()
to use "StrictValidation", which requires that we pass in a fully-qualified remote, so we're not making any misleading assumptions about the remote registry target.