Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2463 from StrongMonkey/print-pull-secrets
Browse files Browse the repository at this point in the history
Add pull secret information to debug build issues
  • Loading branch information
StrongMonkey authored Jan 29, 2024
2 parents 177abfe + 4bfbb7b commit a0bdfd8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/pullsecret/pullsecrets.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
}

Expand Down

0 comments on commit a0bdfd8

Please sign in to comment.