@@ -22,7 +22,6 @@ import (
22
22
corev1 "k8s.io/api/core/v1"
23
23
conv "k8s.io/apimachinery/pkg/conversion"
24
24
"sigs.k8s.io/cluster-api-provider-cloudstack/api/v1beta2"
25
- "sigs.k8s.io/cluster-api-provider-cloudstack/controllers/utils"
26
25
"sigs.k8s.io/cluster-api-provider-cloudstack/pkg/cloud"
27
26
"sigs.k8s.io/controller-runtime/pkg/client"
28
27
)
@@ -120,7 +119,7 @@ func GetFailureDomains(csCluster *CloudStackCluster) ([]v1beta2.CloudStackFailur
120
119
// When upgrading cluster using clusterctl directly, zoneID is fetched directly from kubernetes cluster in cloudstackzones.
121
120
func GetDefaultFailureDomainName (namespace string , clusterName string , zoneID string , zoneName string ) (string , error ) {
122
121
if len (zoneID ) > 0 {
123
- return WithZoneID ( zoneID , clusterName ) , nil
122
+ return zoneID , nil
124
123
}
125
124
126
125
secret , err := GetK8sSecret (DefaultEndpointCredential , namespace )
@@ -131,18 +130,14 @@ func GetDefaultFailureDomainName(namespace string, clusterName string, zoneID st
131
130
// try fetch zoneID using zoneName through cloudstack client
132
131
zoneID , err = fetchZoneIDUsingCloudStack (secret , zoneName )
133
132
if err == nil {
134
- return WithZoneID ( zoneID , clusterName ) , nil
133
+ return zoneID , nil
135
134
}
136
135
137
136
zoneID , err = fetchZoneIDUsingK8s (namespace , zoneName )
138
137
if err != nil {
139
138
return "" , nil
140
139
}
141
- return WithZoneID (zoneID , clusterName ), nil
142
- }
143
-
144
- func WithZoneID (zoneID , clusterName string ) string {
145
- return utils .WithClusterSuffix (zoneID [len (zoneID )- 8 :], clusterName )
140
+ return zoneID , nil
146
141
}
147
142
148
143
func fetchZoneIDUsingK8s (namespace string , zoneName string ) (string , error ) {
0 commit comments