-
Notifications
You must be signed in to change notification settings - Fork 538
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 an issue accessing the Config when we mutate it. #88
Conversation
@@ -132,6 +132,10 @@ func Config(base v1.Image, cfg v1.Config) (v1.Image, error) { | |||
diffIDMap: make(map[v1.Hash]v1.Layer), | |||
digestMap: make(map[v1.Hash]v1.Layer), | |||
} | |||
image.manifest.Config.Digest, err = image.ConfigName() |
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.
I haven't read through all of this file, but we do this above in Append
, do we need to do it here too?
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 doesn't call append :)
if you rebase you'll pick up my patch that ignores vendor/ in gofmt. |
369c2c7
to
a0990f3
Compare
I fixed the test |
v1/mutate/mutate_test.go
Outdated
if !manifestsAreEqual(t, source, result) { | ||
t.Fatal("mutating the config mutated the manifest") | ||
if manifestsAreEqual(t, source, result) { | ||
t.Fatal("mutating the config MUST the manifest") |
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.
MUST mutate
We were changing the `ConfigFile.Config`, but we weren't updating the `Manifest`'s digest for the `ConfigFile`. This meant that things keying off of the `Manifest`'s `ConfigFile` digest field to access things through `LayerByDigest` would end up being delegated to the base image's implementation. In my case, this was manifesting as us asking GCR for a non-existent blob (`remote.Image`). Related: google#87
a0990f3
to
665ec5e
Compare
We were changing the
ConfigFile.Config
, but we weren't updating theManifest
's digest for theConfigFile
. This meant that things keying off of theManifest
'sConfigFile
digest field to access things throughLayerByDigest
would end up being delegated to the base image's implementation. In my case, this was manifesting as us asking GCR for a non-existent blob (remote.Image
).Related: #87