From 3f8fbee18d2db2cc75084455dd118f35557b6f88 Mon Sep 17 00:00:00 2001 From: Rob Best Date: Fri, 13 May 2022 12:03:54 +0100 Subject: [PATCH] tree: support --attachment-tag-prefix 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 --- cmd/cosign/cli/tree.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/cmd/cosign/cli/tree.go b/cmd/cosign/cli/tree.go index b19acbdf09f..27b9baed536 100644 --- a/cmd/cosign/cli/tree.go +++ b/cmd/cosign/cli/tree.go @@ -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 } @@ -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 } @@ -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 }