File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -79,8 +79,8 @@ func Autodetect(path string) (string, error) {
7979
8080 header := struct {
8181 SchemaVersion int `json:"schemaVersion"`
82- MediaType string `json:"mediaType"`
8382 Config interface {} `json:"config"`
83+ Manifests interface {} `json:"manifests"`
8484 }{}
8585
8686 if err := json .NewDecoder (f ).Decode (& header ); err != nil {
@@ -97,13 +97,13 @@ func Autodetect(path string) (string, error) {
9797 }
9898
9999 switch {
100- case header .MediaType == string ( schema . ValidatorMediaTypeManifest ) :
100+ case header .SchemaVersion == 2 && header . Config != nil :
101101 return TypeManifest , nil
102102
103- case header .MediaType == string ( schema . ValidatorMediaTypeImageIndex ) :
103+ case header .Manifests != nil :
104104 return TypeImageIndex , nil
105105
106- case header .MediaType == "" && header . SchemaVersion == 0 && header .Config != nil :
106+ case header .SchemaVersion == 0 && header .Config != nil :
107107 // config files don't have mediaType/schemaVersion header
108108 return TypeConfig , nil
109109 }
You can’t perform that action at this time.
0 commit comments