From 005133fbfb33f591ab36ad6c9ff036c5e5d82cd1 Mon Sep 17 00:00:00 2001 From: Matt Moyer Date: Tue, 9 Mar 2021 16:56:53 -0600 Subject: [PATCH] Add more debug logging when waiting for pending strategies. Signed-off-by: Matt Moyer --- cmd/pinniped/cmd/kubeconfig.go | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) 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: