From b5649c1a6e65de3107c785cde419efcef9827b33 Mon Sep 17 00:00:00 2001 From: Marcin Maciaszczyk Date: Wed, 11 Oct 2023 10:32:11 +0200 Subject: [PATCH] feat: Remove enable OIDC issuer bootstrap step and set ASO-related flags (#456) * remove enable OIDC issuer bootstrap step * fix linter issues * update bootstrapMode flags * update asoControllerSettings --- pkg/bootstrap/bootstrap.go | 9 --------- pkg/bootstrap/common.go | 4 ++++ pkg/bootstrap/migrate.go | 4 ++++ 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/pkg/bootstrap/bootstrap.go b/pkg/bootstrap/bootstrap.go index 9a0b07a0..1346146f 100644 --- a/pkg/bootstrap/bootstrap.go +++ b/pkg/bootstrap/bootstrap.go @@ -159,15 +159,6 @@ func getBootstrapSteps(runPlural ActionFunc, additionalFlags []string) ([]*Step, } }, }, - { - // TODO: Once https://github.com/kubernetes-sigs/cluster-api-provider-azure/issues/2498 - // will be done we can use it and remove this step. - Name: "Enable OIDC issuer", - Execute: func(_ []string) error { - return utils.Exec("az", "aks", "update", "-g", man.Project, "-n", man.Cluster, "--enable-oidc-issuer") - }, - Skip: man.Provider != api.ProviderAzure, - }, { Name: "Initialize kubeconfig for target cluster", Args: []string{"plural", "wkspace", "kube-init"}, diff --git a/pkg/bootstrap/common.go b/pkg/bootstrap/common.go index bad08176..e2ecefb3 100644 --- a/pkg/bootstrap/common.go +++ b/pkg/bootstrap/common.go @@ -147,6 +147,7 @@ func getBootstrapFlags(prov string) []string { case api.ProviderAzure: return []string{ "--set", "cluster-api-cluster.cluster.azure.clusterIdentity.bootstrapMode=true", + "--set", "cluster-api-provider-azure.cluster-api-provider-azure.bootstrapMode=true", "--set", "bootstrap.external-dns.enabled=false", "--set", "plural-certmanager-webhook.enabled=false", } @@ -280,9 +281,12 @@ func RunWithTempCredentials(function ActionFunc) error { } pathPrefix := "cluster-api-cluster.cluster.azure.clusterIdentity.bootstrapCredentials" + asoPathPrefix := "cluster-api-provider-azure.cluster-api-provider-azure.asoControllerSettings" flags = []string{ "--set", fmt.Sprintf("%s.%s=%s", pathPrefix, "clientID", clientId), "--set", fmt.Sprintf("%s.%s=%s", pathPrefix, "clientSecret", clientSecret), + "--set", fmt.Sprintf("%s.%s=%s", asoPathPrefix, "azureClientId", clientId), + "--set", fmt.Sprintf("%s.%s=%s", asoPathPrefix, "azureClientSecret", clientSecret), } defer func(as *azure.AuthService) { diff --git a/pkg/bootstrap/migrate.go b/pkg/bootstrap/migrate.go index 6be1bbcc..98325fbc 100644 --- a/pkg/bootstrap/migrate.go +++ b/pkg/bootstrap/migrate.go @@ -243,6 +243,10 @@ func getMigrationFlags(prov string) []string { return []string{ "--set", "cluster-api-provider-aws.cluster-api-provider-aws.bootstrapMode=false", } + case api.ProviderAzure: + return []string{ + "--set", "cluster-api-provider-azure.cluster-api-provider-azure.bootstrapMode=false", + } case api.ProviderGCP: return []string{ "--set", "cluster-api-provider-gcp.cluster-api-provider-gcp.bootstrapMode=false",