Skip to content

Commit

Permalink
add simple ConfigFile() support for schema1
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
  • Loading branch information
matthyx committed Feb 27, 2024
1 parent 8dadbe7 commit 63ceb71
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion pkg/v1/remote/schema1.go
Expand Up @@ -71,7 +71,18 @@ func (s *schema1) ConfigName() (v1.Hash, error) {
}

func (s *schema1) ConfigFile() (*v1.ConfigFile, error) {
return nil, newErrSchema1(s.mediaType)
configFile := &v1.ConfigFile{
RootFS: v1.RootFS{},
}
layers, err := s.Layers()
if err != nil {
return nil, err
}
for _, layer := range layers {
d, _ := layer.Digest()
configFile.RootFS.DiffIDs = append(configFile.RootFS.DiffIDs, d)
}
return configFile, nil
}

func (s *schema1) RawConfigFile() ([]byte, error) {
Expand Down

0 comments on commit 63ceb71

Please sign in to comment.