Skip to content

Commit 3121dff

Browse files
authored
Merge pull request #3118 from sbueringer/pr-drop-feature-gate
🌱 Drop WCP fault domains feature gate
2 parents 9ec3236 + b3dee41 commit 3121dff

File tree

4 files changed

+96
-19
lines changed

4 files changed

+96
-19
lines changed

config/deployments/integration-tests/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ To sync the new CRD's use the following script **and** update `kustomization.yam
1010
make clean-vm-operator checkout-vm-operator
1111
rm -r config/deployments/integration-tests/crds
1212
cp -r test/infrastructure/vm-operator/vm-operator.tmp/config/crd/bases config/deployments/integration-tests/crds
13+
# Note: for now we only need the AvailabilityZone CRD in our integration tests
14+
cp test/infrastructure/vm-operator/vm-operator.tmp/config/crd/external-crds/topology.tanzu.vmware.com_availabilityzones.yaml config/deployments/integration-tests/crds
1315

1416
make clean-vm-operator
1517
```
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
apiVersion: apiextensions.k8s.io/v1
2+
kind: CustomResourceDefinition
3+
metadata:
4+
annotations:
5+
controller-gen.kubebuilder.io/version: v0.6.1
6+
creationTimestamp: null
7+
name: availabilityzones.topology.tanzu.vmware.com
8+
spec:
9+
group: topology.tanzu.vmware.com
10+
names:
11+
kind: AvailabilityZone
12+
listKind: AvailabilityZoneList
13+
plural: availabilityzones
14+
shortNames:
15+
- az
16+
singular: availabilityzone
17+
scope: Cluster
18+
versions:
19+
- name: v1alpha1
20+
schema:
21+
openAPIV3Schema:
22+
description: AvailabilityZone is the schema for the AvailabilityZone resource
23+
for the vSphere topology API.
24+
properties:
25+
apiVersion:
26+
description: 'APIVersion defines the versioned schema of this representation
27+
of an object. Servers should convert recognized schemas to the latest
28+
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
29+
type: string
30+
kind:
31+
description: 'Kind is a string value representing the REST resource this
32+
object represents. Servers may infer this from the endpoint the client
33+
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
34+
type: string
35+
metadata:
36+
type: object
37+
spec:
38+
description: AvailabilityZoneSpec defines the desired state of AvailabilityZone.
39+
properties:
40+
clusterComputeResourceMoIDs:
41+
description: ClusterComputeResourceMoIDs are the managed object IDs
42+
of the vSphere ClusterComputeResources represented by this availability
43+
zone.
44+
items:
45+
type: string
46+
type: array
47+
clusterComputeResourceMoId:
48+
description: ClusterComputeResourceMoId is the managed object ID of
49+
the vSphere ClusterComputeResource represented by this availability
50+
zone.
51+
type: string
52+
namespaces:
53+
additionalProperties:
54+
description: NamespaceInfo contains identifying information about
55+
the vSphere resources used to represent a Kubernetes namespace
56+
on individual vSphere Zones.
57+
properties:
58+
folderMoId:
59+
description: FolderMoId is the managed object ID of the vSphere
60+
Folder for a Namespace. Folders are global and not per-vSphere
61+
Cluster, but the FolderMoId is stored here, alongside the
62+
PoolMoId for convenience.
63+
type: string
64+
poolMoIDs:
65+
description: PoolMoIDs are the managed object ID of the vSphere
66+
ResourcePools for a Namespace in an individual vSphere Zone.
67+
A zone may be comprised of multiple ResourcePools.
68+
items:
69+
type: string
70+
type: array
71+
poolMoId:
72+
description: PoolMoId is the managed object ID of the vSphere
73+
ResourcePool for a Namespace on an individual vSphere Cluster.
74+
type: string
75+
type: object
76+
description: Namespaces is a map that enables querying information
77+
about the vSphere objects that make up a Kubernetes Namespace based
78+
on its name.
79+
type: object
80+
type: object
81+
status:
82+
description: AvailabilityZoneStatus defines the observed state of AvailabilityZone.
83+
type: object
84+
type: object
85+
served: true
86+
storage: true
87+
subresources:
88+
status: {}
89+
status:
90+
acceptedNames:
91+
kind: ""
92+
plural: ""
93+
conditions: []
94+
storedVersions: []

controllers/vmware/vspherecluster_reconciler.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ package vmware
2020
import (
2121
"context"
2222
"fmt"
23-
"os"
2423

2524
"github.com/pkg/errors"
2625
topologyv1 "github.com/vmware-tanzu/vm-operator/external/tanzu-topology/api/v1alpha1"
@@ -370,17 +369,9 @@ func (r *ClusterReconciler) VSphereMachineToCluster(ctx context.Context, o clien
370369
}}
371370
}
372371

373-
var isFaultDomainsFSSEnabled = func() bool {
374-
return os.Getenv("FSS_WCP_FAULTDOMAINS") == "true"
375-
}
376-
377372
// Returns the failure domain information discovered on the cluster
378373
// hosting this controller.
379374
func (r *ClusterReconciler) getFailureDomains(ctx context.Context) (clusterv1.FailureDomains, error) {
380-
if !isFaultDomainsFSSEnabled() {
381-
return nil, nil
382-
}
383-
384375
availabilityZoneList := &topologyv1.AvailabilityZoneList{}
385376
if err := r.Client.List(ctx, availabilityZoneList); err != nil {
386377
return nil, err

controllers/vmware/vspherecluster_reconciler_test.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -130,16 +130,6 @@ var _ = Describe("Cluster Controller Tests", func() {
130130
})
131131

132132
Context("Test getFailureDomains", func() {
133-
fss := isFaultDomainsFSSEnabled
134-
135-
BeforeEach(func() {
136-
isFaultDomainsFSSEnabled = func() bool { return true }
137-
})
138-
139-
AfterEach(func() {
140-
isFaultDomainsFSSEnabled = fss
141-
})
142-
143133
It("should not find FailureDomains", func() {
144134
fds, err := reconciler.getFailureDomains(ctx)
145135
Expect(err).ToNot(HaveOccurred())

0 commit comments

Comments
 (0)