From 310a54f0bd88a35fb2b5db13609b1ea4336d1d67 Mon Sep 17 00:00:00 2001 From: Meredith Lancaster Date: Tue, 12 Mar 2024 18:08:41 -0600 Subject: [PATCH] add comment around keychain option Signed-off-by: Meredith Lancaster --- pkg/cmd/attestation/artifact/oci/client.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/cmd/attestation/artifact/oci/client.go b/pkg/cmd/attestation/artifact/oci/client.go index 064f3835c..2c79faa39 100644 --- a/pkg/cmd/attestation/artifact/oci/client.go +++ b/pkg/cmd/attestation/artifact/oci/client.go @@ -42,6 +42,9 @@ func (c LiveClient) GetImageDigest(imgName string) (*v1.Hash, error) { return nil, fmt.Errorf("failed to create image tag: %w", err) } + // The user must already be authenticated with the container registry + // The authn.DefaultKeychain argument indicates that Get should checks the + // user's configuration for the registry credentials desc, err := c.Get(name, remote.WithAuthFromKeychain(authn.DefaultKeychain)) if err != nil { var transportErr *transport.Error