From 537428276fd341bdb03252f5091d6deb7b6166ce Mon Sep 17 00:00:00 2001 From: cPu1 Date: Fri, 16 Aug 2024 14:53:24 +0530 Subject: [PATCH] Skip creating OIDC manager for Outposts clusters --- pkg/actions/addon/tasks.go | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/pkg/actions/addon/tasks.go b/pkg/actions/addon/tasks.go index 7fafd2ab77..f4478c8620 100644 --- a/pkg/actions/addon/tasks.go +++ b/pkg/actions/addon/tasks.go @@ -14,6 +14,7 @@ import ( api "github.com/weaveworks/eksctl/pkg/apis/eksctl.io/v1alpha5" "github.com/weaveworks/eksctl/pkg/eks" + iamoidc "github.com/weaveworks/eksctl/pkg/iam/oidc" "github.com/weaveworks/eksctl/pkg/utils/tasks" ) @@ -183,14 +184,20 @@ func (t *createAddonTask) Do(errorCh chan error) error { } func createAddonManager(ctx context.Context, clusterProvider *eks.ClusterProvider, cfg *api.ClusterConfig) (*Manager, error) { - oidc, err := clusterProvider.NewOpenIDConnectManager(ctx, cfg) - if err != nil { - return nil, err - } - - oidcProviderExists, err := oidc.CheckProviderExists(ctx) - if err != nil { - return nil, err + var ( + oidc *iamoidc.OpenIDConnectManager + oidcProviderExists bool + ) + if api.IsEnabled(cfg.IAM.WithOIDC) { + var err error + oidc, err = clusterProvider.NewOpenIDConnectManager(ctx, cfg) + if err != nil { + return nil, err + } + oidcProviderExists, err = oidc.CheckProviderExists(ctx) + if err != nil { + return nil, err + } } stackManager := clusterProvider.NewStackManager(cfg)