Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Remove enable OIDC issuer bootstrap step and set ASO-related flags #456

Merged
merged 7 commits into from
Oct 11, 2023
Merged
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
Loading