diff --git a/pkg/mirror/mirror.go b/pkg/mirror/mirror.go index 04508eb..3abf107 100644 --- a/pkg/mirror/mirror.go +++ b/pkg/mirror/mirror.go @@ -48,7 +48,9 @@ func PushToRegistry(image any, imageName string) error { return fmt.Errorf("failed to push image index %s: %w", imageName, err) } default: - return fmt.Errorf("unknown image type: %T", image) + if err := remote.WriteIndex(ref, image.(v1.ImageIndex), remote.WithAuth(auth)); err != nil { + return fmt.Errorf("failed to push image index %s: %w", imageName, err) + } } return nil } @@ -76,7 +78,10 @@ func SaveAsOCILayout(image any, path string) error { return fmt.Errorf("failed to create index: %w", err) } default: - return fmt.Errorf("unknown image type: %T", image) + _, err := layout.Write(path, image.(v1.ImageIndex)) + if err != nil { + return fmt.Errorf("failed to create index: %w", err) + } } return nil }