diff --git a/pkg/cluster/internal/create/actions/createworker/keosinstaller.go b/pkg/cluster/internal/create/actions/createworker/keosinstaller.go index 873cb44fef..b55ad3e5ee 100644 --- a/pkg/cluster/internal/create/actions/createworker/keosinstaller.go +++ b/pkg/cluster/internal/create/actions/createworker/keosinstaller.go @@ -34,8 +34,9 @@ type KEOSDescriptor struct { EKS bool `yaml:"eks"` } `yaml:"aws,omitempty"` Azure struct { - Enabled bool `yaml:"enabled"` - AKS bool `yaml:"aks"` + Enabled bool `yaml:"enabled"` + AKS bool `yaml:"aks"` + ResourceGroup string `yaml:"resource_group"` } `yaml:"azure,omitempty"` GCP struct { Enabled bool `yaml:"enabled"` @@ -89,6 +90,7 @@ func createKEOSDescriptor(descriptorFile commons.DescriptorFile, storageClass st if descriptorFile.InfraProvider == "azure" { keosDescriptor.Azure.Enabled = true keosDescriptor.Azure.AKS = descriptorFile.ControlPlane.Managed + keosDescriptor.Azure.ResourceGroup = descriptorFile.ClusterID } // GCP diff --git a/pkg/commons/cluster.go b/pkg/commons/cluster.go index 957c12946c..9c228bbf85 100644 --- a/pkg/commons/cluster.go +++ b/pkg/commons/cluster.go @@ -212,8 +212,7 @@ type AWS struct { } type AZURE struct { - Credentials AzureCredentials `yaml:"credentials"` - ResourceGroup string `yaml:"resource_group"` + Credentials AzureCredentials `yaml:"credentials"` } type GCP struct { diff --git a/pkg/commons/utils.go b/pkg/commons/utils.go index e44b512094..28eaf0aeaa 100644 --- a/pkg/commons/utils.go +++ b/pkg/commons/utils.go @@ -191,11 +191,7 @@ func EnsureSecretsFile(descriptorFile DescriptorFile, vaultPassword string) erro if len(credentials) > 0 { creds := convertStringMapToInterfaceMap(credentials) creds = convertMapKeysToSnakeCase(creds) - if descriptorFile.InfraProvider == "azure" { - secretMap[descriptorFile.InfraProvider] = map[string]interface{}{"credentials": creds, "resource_group": descriptorFile.ClusterID} - } else { - secretMap[descriptorFile.InfraProvider] = map[string]interface{}{"credentials": creds} - } + secretMap[descriptorFile.InfraProvider] = map[string]interface{}{"credentials": creds} } if len(externalRegistry) > 0 { @@ -236,11 +232,7 @@ func EnsureSecretsFile(descriptorFile DescriptorFile, vaultPassword string) erro edited = true creds := convertStringMapToInterfaceMap(credentials) creds = convertMapKeysToSnakeCase(creds) - if descriptorFile.InfraProvider == "azure" { - secretMap["secrets"][descriptorFile.InfraProvider] = map[string]interface{}{"credentials": creds, "resource_group": descriptorFile.ClusterID} - } else { - secretMap["secrets"][descriptorFile.InfraProvider] = map[string]interface{}{"credentials": creds} - } + secretMap["secrets"][descriptorFile.InfraProvider] = map[string]interface{}{"credentials": creds} } if secretMap["secrets"]["external_registry"] == nil && len(externalRegistry) > 0 {