Skip to content

Commit a292ad6

Browse files
committed
Remove reliance on feature gates from CCMO for external cloud provider decision
1 parent bcc142e commit a292ad6

File tree

3 files changed

+6
-59
lines changed

3 files changed

+6
-59
lines changed

docs/dev/hacking-guide.md

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -130,33 +130,9 @@ OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE=quay.io/<your-repo>/release:<your-branc
130130

131131
However, in order for the cluster to run the CCM from the start, you need to add an additional step to the installation.
132132

133-
By specifying the `CustomNoUpgrade` feature gate in the cluster with `ExternalCloudProvider` you are enabling CCCMO logic for providers, which are currently in Technical Preview state.
134-
135133
```bash
136134
export OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE=quay.io/<your-repo>/release:<your-branch>
137135

138-
# This step would stop after creation of ./manifests folder. All resources placed there will be created in the cluster
139-
# during bootstrap and would override the default state of the resource in the cluster.
140-
openshift-install create manifests
141-
142-
cat <<EOF > manifests/manifest_feature_gate.yaml
143-
apiVersion: config.openshift.io/v1
144-
kind: FeatureGate
145-
metadata:
146-
annotations:
147-
include.release.openshift.io/self-managed-high-availability: "true"
148-
include.release.openshift.io/single-node-developer: "true"
149-
release.openshift.io/create-only: "true"
150-
name: cluster
151-
spec:
152-
customNoUpgrade:
153-
enabled:
154-
- ExternalCloudProvider
155-
- CSIMigrationAWS
156-
- CSIMigrationOpenStack
157-
featureSet: CustomNoUpgrade
158-
EOF
159-
160136
# Now you could create a cluster with your custom release image
161137
openshift-install create cluster
162138
```

pkg/controllers/clusteroperator_controller.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ func (r *CloudOperatorReconciler) provisioningAllowed(ctx context.Context, infra
244244
}
245245

246246
// Verify FeatureGate ExternalCloudProvider is enabled for operator to work in TP phase
247-
external, err := cloudprovider.IsCloudProviderExternal(infra.Status.PlatformStatus, r.FeatureGateAccess)
247+
external, err := cloudprovider.IsCloudProviderExternal(infra.Status.PlatformStatus)
248248
if err != nil {
249249
klog.Errorf("Could not determine external cloud provider state: %v", err)
250250

@@ -254,7 +254,7 @@ func (r *CloudOperatorReconciler) provisioningAllowed(ctx context.Context, infra
254254
}
255255
return false, err
256256
} else if !external {
257-
klog.Infof("FeatureGate cluster is not specifying external cloud provider requirement. Skipping...")
257+
klog.Infof("Platform does not require an external cloud provider. Skipping...")
258258

259259
if err := r.setStatusAvailable(ctx, conditionOverrides); err != nil {
260260
klog.Errorf("Unable to sync cluster operator status: %s", err)

pkg/controllers/clusteroperator_controller_test.go

Lines changed: 4 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -228,11 +228,6 @@ var _ = Describe("Component sync controller", func() {
228228
var operands []client.Object
229229
var watcher mockedWatcher
230230

231-
externalFeatureGateAccessor := featuregates.NewHardcodedFeatureGateAccess(
232-
[]configv1.FeatureGateName{configv1.FeatureGateExternalCloudProvider},
233-
nil,
234-
)
235-
236231
kcmStatus := &operatorv1.KubeControllerManagerStatus{
237232
StaticPodOperatorStatus: operatorv1.StaticPodOperatorStatus{
238233
OperatorStatus: operatorv1.OperatorStatus{
@@ -363,7 +358,6 @@ var _ = Describe("Component sync controller", func() {
363358

364359
type testCase struct {
365360
status *configv1.InfrastructureStatus
366-
featureGate featuregates.FeatureGateAccess
367361
kcmStatus *operatorv1.KubeControllerManagerStatus
368362
coStatus *configv1.ClusterOperatorStatus
369363
expectProvisioned bool
@@ -376,9 +370,7 @@ var _ = Describe("Component sync controller", func() {
376370
infra.Status = *tc.status
377371
Expect(cl.Status().Update(context.Background(), infra.DeepCopy())).To(Succeed())
378372

379-
if tc.featureGate != nil {
380-
operatorController.FeatureGateAccess = tc.featureGate
381-
}
373+
operatorController.FeatureGateAccess = featuregates.NewHardcodedFeatureGateAccess(nil, nil)
382374

383375
if tc.kcmStatus != nil {
384376
Expect(cl.Get(context.Background(), client.ObjectKeyFromObject(kcm), kcm)).To(Succeed())
@@ -400,7 +392,7 @@ var _ = Describe("Component sync controller", func() {
400392

401393
watchMap := watcher.getWatchedResources()
402394

403-
operatorConfig := getOperatorConfigForPlatform(tc.status.PlatformStatus, tc.featureGate)
395+
operatorConfig := getOperatorConfigForPlatform(tc.status.PlatformStatus, operatorController.FeatureGateAccess)
404396

405397
clusterOperator, err := operatorController.getOrCreateClusterOperator(context.Background())
406398
Expect(err).To(Succeed())
@@ -452,7 +444,6 @@ var _ = Describe("Component sync controller", func() {
452444
Type: configv1.AWSPlatformType,
453445
},
454446
},
455-
featureGate: externalFeatureGateAccessor,
456447
kcmStatus: kcmStatus,
457448
coStatus: coStatus,
458449
expectProvisioned: true,
@@ -466,7 +457,6 @@ var _ = Describe("Component sync controller", func() {
466457
Type: configv1.OpenStackPlatformType,
467458
},
468459
},
469-
featureGate: externalFeatureGateAccessor,
470460
kcmStatus: kcmStatus,
471461
coStatus: coStatus,
472462
expectProvisioned: true,
@@ -480,7 +470,6 @@ var _ = Describe("Component sync controller", func() {
480470
Type: configv1.AWSPlatformType,
481471
},
482472
},
483-
featureGate: externalFeatureGateAccessor,
484473
kcmStatus: &operatorv1.KubeControllerManagerStatus{},
485474
coStatus: coStatus,
486475
expectProvisioned: true,
@@ -494,24 +483,10 @@ var _ = Describe("Component sync controller", func() {
494483
Type: configv1.KubevirtPlatformType,
495484
},
496485
},
497-
featureGate: externalFeatureGateAccessor,
498486
kcmStatus: kcmStatus,
499487
coStatus: coStatus,
500488
expectProvisioned: false,
501489
}),
502-
Entry("Should provision resources for AWS if external FeatureGate is not present", testCase{
503-
status: &configv1.InfrastructureStatus{
504-
InfrastructureTopology: configv1.HighlyAvailableTopologyMode,
505-
ControlPlaneTopology: configv1.HighlyAvailableTopologyMode,
506-
Platform: configv1.AWSPlatformType,
507-
PlatformStatus: &configv1.PlatformStatus{
508-
Type: configv1.AWSPlatformType,
509-
},
510-
},
511-
kcmStatus: kcmStatus,
512-
coStatus: coStatus,
513-
expectProvisioned: true,
514-
}),
515490
Entry("Should not provision resources for OpenStack if external FeatureGate is not present", testCase{
516491
status: &configv1.InfrastructureStatus{
517492
InfrastructureTopology: configv1.HighlyAvailableTopologyMode,
@@ -532,7 +507,6 @@ var _ = Describe("Component sync controller", func() {
532507
Type: configv1.AWSPlatformType,
533508
},
534509
},
535-
featureGate: externalFeatureGateAccessor,
536510
kcmStatus: &operatorv1.KubeControllerManagerStatus{
537511
StaticPodOperatorStatus: operatorv1.StaticPodOperatorStatus{
538512
OperatorStatus: operatorv1.OperatorStatus{
@@ -558,7 +532,6 @@ var _ = Describe("Component sync controller", func() {
558532
Type: configv1.AWSPlatformType,
559533
},
560534
},
561-
featureGate: externalFeatureGateAccessor,
562535
kcmStatus: &operatorv1.KubeControllerManagerStatus{
563536
StaticPodOperatorStatus: operatorv1.StaticPodOperatorStatus{
564537
OperatorStatus: operatorv1.OperatorStatus{
@@ -584,8 +557,7 @@ var _ = Describe("Component sync controller", func() {
584557
Type: configv1.AWSPlatformType,
585558
},
586559
},
587-
featureGate: externalFeatureGateAccessor,
588-
kcmStatus: kcmStatus,
560+
kcmStatus: kcmStatus,
589561
coStatus: &configv1.ClusterOperatorStatus{
590562
Conditions: []configv1.ClusterOperatorStatusCondition{
591563
{
@@ -622,8 +594,7 @@ var _ = Describe("Component sync controller", func() {
622594
Type: configv1.AWSPlatformType,
623595
},
624596
},
625-
featureGate: externalFeatureGateAccessor,
626-
kcmStatus: kcmStatus,
597+
kcmStatus: kcmStatus,
627598
coStatus: &configv1.ClusterOperatorStatus{
628599
Conditions: []configv1.ClusterOperatorStatusCondition{
629600
{

0 commit comments

Comments
 (0)