Skip to content

Commit a91c10c

Browse files
author
Joshua Reed
committed
Revert cluster suffix naming on upgrade.
1 parent b7187fc commit a91c10c

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

api/v1beta1/conversion.go

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import (
2222
corev1 "k8s.io/api/core/v1"
2323
conv "k8s.io/apimachinery/pkg/conversion"
2424
"sigs.k8s.io/cluster-api-provider-cloudstack/api/v1beta2"
25-
"sigs.k8s.io/cluster-api-provider-cloudstack/controllers/utils"
2625
"sigs.k8s.io/cluster-api-provider-cloudstack/pkg/cloud"
2726
"sigs.k8s.io/controller-runtime/pkg/client"
2827
)
@@ -120,7 +119,7 @@ func GetFailureDomains(csCluster *CloudStackCluster) ([]v1beta2.CloudStackFailur
120119
// When upgrading cluster using clusterctl directly, zoneID is fetched directly from kubernetes cluster in cloudstackzones.
121120
func GetDefaultFailureDomainName(namespace string, clusterName string, zoneID string, zoneName string) (string, error) {
122121
if len(zoneID) > 0 {
123-
return WithZoneID(zoneID, clusterName), nil
122+
return zoneID, nil
124123
}
125124

126125
secret, err := GetK8sSecret(DefaultEndpointCredential, namespace)
@@ -131,18 +130,14 @@ func GetDefaultFailureDomainName(namespace string, clusterName string, zoneID st
131130
// try fetch zoneID using zoneName through cloudstack client
132131
zoneID, err = fetchZoneIDUsingCloudStack(secret, zoneName)
133132
if err == nil {
134-
return WithZoneID(zoneID, clusterName), nil
133+
return zoneID, nil
135134
}
136135

137136
zoneID, err = fetchZoneIDUsingK8s(namespace, zoneName)
138137
if err != nil {
139138
return "", nil
140139
}
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
146141
}
147142

148143
func fetchZoneIDUsingK8s(namespace string, zoneName string) (string, error) {

0 commit comments

Comments
 (0)