Skip to content

Commit

Permalink
tree: support --attachment-tag-prefix (#1900)
Browse files Browse the repository at this point in the history
Use the full set of remote options in all cases (rather than just the registry
options) so that tree will resolve attachments according to the provided
`--attachment-tag-prefix`.

Signed-off-by: Rob Best <robertbest89@gmail.com>
  • Loading branch information
ribbybibby committed May 18, 2022
1 parent 0948f31 commit cf80511
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions cmd/cosign/cli/tree.go
Expand Up @@ -64,9 +64,7 @@ func TreeCmd(ctx context.Context, regOpts options.RegistryOptions, imageRef stri
return err
}

registryClientOpts := regOpts.GetRegistryClientOpts(ctx)

attRef, err := ociremote.AttestationTag(ref, ociremote.WithRemoteOptions(registryClientOpts...))
attRef, err := ociremote.AttestationTag(ref, remoteOpts...)
if err != nil {
return err
}
Expand All @@ -82,7 +80,7 @@ func TreeCmd(ctx context.Context, regOpts options.RegistryOptions, imageRef stri
}
}

sigRef, err := ociremote.SignatureTag(ref, ociremote.WithRemoteOptions(registryClientOpts...))
sigRef, err := ociremote.SignatureTag(ref, remoteOpts...)
if err != nil {
return err
}
Expand All @@ -98,7 +96,7 @@ func TreeCmd(ctx context.Context, regOpts options.RegistryOptions, imageRef stri
}
}

sbomRef, err := ociremote.SBOMTag(ref, ociremote.WithRemoteOptions(registryClientOpts...))
sbomRef, err := ociremote.SBOMTag(ref, remoteOpts...)
if err != nil {
return err
}
Expand Down

0 comments on commit cf80511

Please sign in to comment.