Skip to content

Commit

Permalink
feat: Remove enable OIDC issuer bootstrap step and set ASO-related fl…
Browse files Browse the repository at this point in the history
…ags (#456)

* remove enable OIDC issuer bootstrap step

* fix linter issues

* update bootstrapMode flags

* update asoControllerSettings
  • Loading branch information
maciaszczykm authored Oct 11, 2023
1 parent b68efbc commit b5649c1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
9 changes: 0 additions & 9 deletions pkg/bootstrap/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand Down
4 changes: 4 additions & 0 deletions pkg/bootstrap/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}
Expand Down Expand Up @@ -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) {
Expand Down
4 changes: 4 additions & 0 deletions pkg/bootstrap/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit b5649c1

Please sign in to comment.