Skip to content

Commit 3daf0d8

Browse files
author
Priya Wadhwa
committed
Get image config from reference
1 parent 37c5798 commit 3daf0d8

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

pkg/image/mutable_source.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ func (m *MutableSource) GetManifest(_ *digest.Digest) ([]byte, string, error) {
7676

7777
// populateManifestAndConfig parses the raw manifest and configs, storing them on the struct.
7878
func (m *MutableSource) populateManifestAndConfig() error {
79+
// First get manifest
7980
mfstBytes, _, err := m.ProxySource.GetManifest(nil)
8081
if err != nil {
8182
return err
@@ -86,18 +87,17 @@ func (m *MutableSource) populateManifestAndConfig() error {
8687
return err
8788
}
8889

89-
bi := types.BlobInfo{Digest: m.mfst.ConfigDescriptor.Digest}
90-
r, _, err := m.GetBlob(bi)
90+
// Now, get config
91+
img, err := m.ProxySource.Ref.NewImage(nil)
9192
if err != nil {
9293
return err
9394
}
94-
95-
cfgBytes, err := ioutil.ReadAll(r)
95+
defer img.Close()
96+
configBlob, err := img.ConfigBlob()
9697
if err != nil {
9798
return err
9899
}
99-
100-
return json.Unmarshal(cfgBytes, &m.cfg)
100+
return json.Unmarshal(configBlob, &m.cfg)
101101
}
102102

103103
// GetBlob first checks the stored "extra" blobs, then proxies the call to the original source.

0 commit comments

Comments
 (0)