diff --git a/cmd/pinniped/cmd/kubeconfig.go b/cmd/pinniped/cmd/kubeconfig.go index 1e342226..4d6f1da7 100644 --- a/cmd/pinniped/cmd/kubeconfig.go +++ b/cmd/pinniped/cmd/kubeconfig.go @@ -310,6 +310,7 @@ func waitForCredentialIssuer(ctx context.Context, clientset conciergeclientset.I if !hasPendingStrategy(credentialIssuer) { break } + logStrategies(credentialIssuer, deps.log) deps.log.Info("waiting for CredentialIssuer pending strategies to finish", "attempts", attempts, "remaining", time.Until(deadline).Round(time.Second).String(), @@ -332,14 +333,7 @@ func discoverConciergeParams(credentialIssuer *configv1alpha1.CredentialIssuer, // Autodiscover the --concierge-mode. frontend, err := getConciergeFrontend(credentialIssuer, flags.concierge.mode) if err != nil { - for _, strategy := range credentialIssuer.Status.Strategies { - log.Info("found CredentialIssuer strategy", - "type", strategy.Type, - "status", strategy.Status, - "reason", strategy.Reason, - "message", strategy.Message, - ) - } + logStrategies(credentialIssuer, log) return err } @@ -383,6 +377,17 @@ func discoverConciergeParams(credentialIssuer *configv1alpha1.CredentialIssuer, return nil } +func logStrategies(credentialIssuer *configv1alpha1.CredentialIssuer, log logr.Logger) { + for _, strategy := range credentialIssuer.Status.Strategies { + log.Info("found CredentialIssuer strategy", + "type", strategy.Type, + "status", strategy.Status, + "reason", strategy.Reason, + "message", strategy.Message, + ) + } +} + func discoverAuthenticatorParams(authenticator metav1.Object, flags *getKubeconfigParams, log logr.Logger) error { switch auth := authenticator.(type) { case *conciergev1alpha1.WebhookAuthenticator: