Skip to content

Commit cbfe3ce

Browse files
committed
Merge branch 'feature/multi-endpoint-failure-domains' of github.com:rejoshed/cluster-api-provider-cloudstack into feature/multi-endpoint-failure-domains
2 parents 7a1c583 + 35947e6 commit cbfe3ce

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
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) {

api/v1beta2/cloudstackcluster_webhook.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ func ValidateFailureDomainUpdates(oldFDs, newFDs []CloudStackFailureDomainSpec)
131131
}
132132
}
133133
if !atLeastOneRemains {
134-
return field.Forbidden(field.NewPath("spec", "FailureDomains"), "At least one FailureDomain must be unchanged on udpate.")
134+
return field.Forbidden(field.NewPath("spec", "FailureDomains"), "At least one FailureDomain must be unchanged on update.")
135135
}
136136
return nil
137137
}

test/helpers/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ type CSConf struct {
1919
type Config struct {
2020
ApiVersion string `yaml:"apiVersion"`
2121
Kind string `yaml:"kind"`
22-
Tind string `yaml:"type"`
22+
Type string `yaml:"type"`
2323
Metadata map[string]string `yaml:"metadata"`
2424
StringData CSConf `yaml:"stringData"`
2525
}

0 commit comments

Comments
 (0)