From 4bfbb7b151cd87f2a247df2ccb78bfe9255788aa Mon Sep 17 00:00:00 2001 From: Daishan Peng Date: Fri, 26 Jan 2024 16:44:40 -0700 Subject: [PATCH] Add pull secret information to debug build issues Signed-off-by: Daishan Peng --- pkg/pullsecret/pullsecrets.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkg/pullsecret/pullsecrets.go b/pkg/pullsecret/pullsecrets.go index 414ba0fce..3114d3fd6 100644 --- a/pkg/pullsecret/pullsecrets.go +++ b/pkg/pullsecret/pullsecrets.go @@ -13,6 +13,7 @@ import ( "github.com/google/go-containerregistry/pkg/authn" "github.com/google/go-containerregistry/pkg/authn/kubernetes" "github.com/google/go-containerregistry/pkg/name" + "github.com/sirupsen/logrus" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" @@ -71,6 +72,13 @@ func Keychain(ctx context.Context, c client.Reader, namespace string) (authn.Key } keychainSecrets = append(keychainSecrets, secrets...) } + + var pullSecretNameAndNamespace []string + for _, secret := range keychainSecrets { + pullSecretNameAndNamespace = append(pullSecretNameAndNamespace, fmt.Sprintf("%s/%s", secret.Namespace, secret.Name)) + } + + logrus.Infof("Using pull secrets: %v for builder namespace %s", pullSecretNameAndNamespace, namespace) return kubernetes.NewFromPullSecrets(ctx, keychainSecrets) }