Skip to content

Commit aa3786a

Browse files
author
Joshua Reed
committed
Removed account and domain from cluster type.
1 parent fd3ac14 commit aa3786a

File tree

4 files changed

+0
-30
lines changed

4 files changed

+0
-30
lines changed

api/v1beta2/cloudstackcluster_types.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,6 @@ type CloudStackClusterSpec struct {
3131

3232
// The kubernetes control plane endpoint.
3333
ControlPlaneEndpoint clusterv1.APIEndpoint `json:"controlPlaneEndpoint"`
34-
35-
// CloudStack account.
36-
// +optional
37-
Account string `json:"account,omitempty"`
38-
39-
// CloudStack domain.
40-
// +optional
41-
Domain string `json:"domain,omitempty"`
4234
}
4335

4436
// The status of the CloudStackCluster object.

api/v1beta2/cloudstackcluster_webhook.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,6 @@ func (r *CloudStackCluster) ValidateCreate() error {
5555

5656
var errorList field.ErrorList
5757

58-
if (r.Spec.Account != "") && (r.Spec.Domain == "") {
59-
errorList = append(errorList, field.Required(
60-
field.NewPath("spec", "account"), "specifying account requires additionally specifying domain"))
61-
}
62-
6358
// Require FailureDomains and their respective sub-fields.
6459
if len(r.Spec.FailureDomains) <= 0 {
6560
errorList = append(errorList, field.Required(field.NewPath("spec", "FailureDomains"), "FailureDomains"))

config/crd/bases/infrastructure.cluster.x-k8s.io_cloudstackclusters.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,6 @@ spec:
201201
spec:
202202
description: CloudStackClusterSpec defines the desired state of CloudStackCluster.
203203
properties:
204-
account:
205-
description: CloudStack account.
206-
type: string
207204
controlPlaneEndpoint:
208205
description: The kubernetes control plane endpoint.
209206
properties:
@@ -218,9 +215,6 @@ spec:
218215
- host
219216
- port
220217
type: object
221-
domain:
222-
description: CloudStack domain.
223-
type: string
224218
failureDomains:
225219
items:
226220
description: CloudStackFailureDomainSpec defines the desired state

controllers/utils/failuredomains.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,6 @@ func (c *CloudClientImplementation) RegisterExtension(r *ReconciliationRunner) C
126126
// AsFailureDomainUser uses the credentials specified in the failure domain to set the ReconciliationSubject's CSUser client.
127127
func (c *CloudClientImplementation) AsFailureDomainUser(fdSpec *infrav1.CloudStackFailureDomainSpec) CloudStackReconcilerMethod {
128128
return func() (ctrl.Result, error) {
129-
if !strings.HasSuffix(fdSpec.Name, "-"+c.CAPICluster.Name) { // Add cluster name suffix if missing.
130-
fdSpec.Name = fdSpec.Name + "-" + c.CAPICluster.Name
131-
}
132129
endpointCredentials := &corev1.Secret{}
133130
key := client.ObjectKey{Name: fdSpec.ACSEndpoint.Name, Namespace: fdSpec.ACSEndpoint.Namespace}
134131
if err := c.K8sClient.Get(c.RequestCtx, key, endpointCredentials); err != nil {
@@ -144,14 +141,6 @@ func (c *CloudClientImplementation) AsFailureDomainUser(fdSpec *infrav1.CloudSta
144141
return ctrl.Result{}, errors.Wrapf(err, "parsing ACSEndpoint secret with ref: %v", fdSpec.ACSEndpoint)
145142
}
146143

147-
// Transfer Cluster Domain & Account to FailureDomain as needed.
148-
if fdSpec.Account == "" {
149-
if c.CSCluster.Spec.Account != "" {
150-
fdSpec.Account = c.CSCluster.Spec.Account
151-
fdSpec.Domain = c.CSCluster.Spec.Domain
152-
}
153-
}
154-
155144
if fdSpec.Account != "" { // Set r.CSUser CloudStack Client per Account and Domain.
156145
client, err := c.CSClient.NewClientInDomainAndAccount(fdSpec.Domain, fdSpec.Account)
157146
if err != nil {

0 commit comments

Comments
 (0)