mirror of
https://github.com/hauler-dev/hauler.git
synced 2026-02-14 18:09:51 +00:00
add better logging for save
Signed-off-by: Adam Martin <adam.martin@rancherfederal.com>
This commit is contained in:
@@ -43,6 +43,7 @@ func VerifySignature(ctx context.Context, s *store.Layout, keyPath string, ref s
|
||||
|
||||
// SaveImage saves image and any signatures/attestations to the store.
|
||||
func SaveImage(ctx context.Context, s *store.Layout, ref string, platform string) error {
|
||||
l := log.FromContext(ctx)
|
||||
operation := func() error {
|
||||
cosignBinaryPath, err := getCosignPath(ctx)
|
||||
if err != nil {
|
||||
@@ -58,7 +59,8 @@ func SaveImage(ctx context.Context, s *store.Layout, ref string, platform string
|
||||
output, err := cmd.CombinedOutput()
|
||||
if err != nil {
|
||||
if strings.Contains(string(output), "specified reference is not a multiarch image") {
|
||||
// Rerun the command without the platform flag
|
||||
l.Infof(fmt.Sprintf("specified image [%s] is not a multiarch image. (choosing default)", ref))
|
||||
// Rerun the command without the platform flag
|
||||
cmd = exec.Command(cosignBinaryPath, "save", ref, "--dir", s.Root)
|
||||
output, err = cmd.CombinedOutput()
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user