Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
thesayyn committed Feb 17, 2024
1 parent 68bf6a7 commit 5927d21
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions cmd/crane/cmd/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,13 @@ The platform for appended manifests is inferred from the config file or omitted
if err != nil {
return fmt.Errorf("pulling %s: %w", baseRef, err)
}
mt, err := desc.MediaType()
if err != nil {
return fmt.Errorf("getting media type %s: %w", baseRef, err)
}
if base, ok = desc.(v1.ImageIndex); !ok {

Check failure on line 175 in cmd/crane/cmd/index.go

View workflow job for this annotation

GitHub Actions / Lint

unnecessary leading newline (whitespace)
return fmt.Errorf("expected %s to be an index, got %q", baseRef, desc.MediaType)

return fmt.Errorf("expected %s to be an index, got %q", baseRef, mt)
}
}

Expand Down Expand Up @@ -234,7 +239,11 @@ The platform for appended manifests is inferred from the config file or omitted
})
}
} else {
return fmt.Errorf("saw unexpected MediaType %q for %q", desc.MediaType, m)
mt, err := desc.MediaType()
if err != nil {
return fmt.Errorf("getting media type %s: %w", baseRef, err)
}
return fmt.Errorf("saw unexpected MediaType %q for %q", mt, m)
}
}

Expand Down

0 comments on commit 5927d21

Please sign in to comment.