From e8b0b4cd731ade0232ef9634920afc16b3d7c34b Mon Sep 17 00:00:00 2001 From: Christopher Haar Date: Sun, 24 Dec 2023 10:23:38 +0100 Subject: [PATCH] feat(kubelogin): add kubelogin azure ad auth Signed-off-by: Christopher Haar --- internal/clients/azure/azure.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/clients/azure/azure.go b/internal/clients/azure/azure.go index 5a13307f..28c12ab3 100644 --- a/internal/clients/azure/azure.go +++ b/internal/clients/azure/azure.go @@ -28,6 +28,10 @@ func WrapRESTConfig(_ context.Context, rc *rest.Config, credentials []byte, _ .. return err } + if rc.ExecProvider == nil || rc.ExecProvider.Args == nil || len(rc.ExecProvider.Args) < 1 { + return errors.New("an identity configuration was specified but the provided kubeconfig does not have execProvider section") + } + fs := pflag.NewFlagSet("kubelogin", pflag.ContinueOnError) opts := token.NewOptions() opts.AddFlags(fs)