Skip to content

Commit

Permalink
Merge pull request #3 from spectrocloud/nianyu/fix-insecure
Browse files Browse the repository at this point in the history
fix: respect remote options in save and remote-load
  • Loading branch information
rishi-anand authored Oct 22, 2024
2 parents 33e0af0 + 47e6941 commit af461b1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cmd/cosign/cli/remote_load.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ func RemoteLoadCmd(ctx context.Context, opts options.RemoteLoadOptions, src, dst
return err
}

se, err := ociremote.SignedEntity(srcRef)
ociremoteOpts, err := opts.Registry.ClientOpts(ctx)
if err != nil {
return err
}

ociremoteOpts, err := opts.Registry.ClientOpts(ctx)
se, err := ociremote.SignedEntity(srcRef, ociremoteOpts...)
if err != nil {
return err
}
Expand Down
5 changes: 4 additions & 1 deletion cmd/cosign/cli/save.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ func SaveCmd(ctx context.Context, opts options.SaveOptions, imageRef string) err
return fmt.Errorf("parsing image name %s: %w", imageRef, err)
}

se, err := ociremote.SignedEntity(ref, ociremote.WithCachePath(opts.CachePath))
se, err := ociremote.SignedEntity(ref,
ociremote.WithCachePath(opts.CachePath),
ociremote.WithRemoteOptions(opts.Registry.GetRegistryClientOpts(ctx)...),
)
if err != nil {
return fmt.Errorf("signed entity: %w", err)
}
Expand Down

0 comments on commit af461b1

Please sign in to comment.