Skip to content

Commit 2d2016b

Browse files
Merge pull request #334 from JoelSpeed/remove-cloud-fg
OCPCLOUD-2514: Remove reliance on feature gates for whether to deploy CCMs
2 parents b06bfa1 + a292ad6 commit 2d2016b

File tree

195 files changed

+15470
-2723
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

195 files changed

+15470
-2723
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
```

go.mod

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ require (
1010
github.com/golangci/golangci-lint v1.52.2
1111
github.com/onsi/ginkgo/v2 v2.15.0
1212
github.com/onsi/gomega v1.31.1
13-
github.com/openshift/api v0.0.0-20231120222239-b86761094ee3
14-
github.com/openshift/client-go v0.0.0-20230503144108-75015d2347cb
15-
github.com/openshift/library-go v0.0.0-20230614142803-865e70cc6b32
13+
github.com/openshift/api v0.0.0-20231218131639-7a5aa77cc72d
14+
github.com/openshift/client-go v0.0.0-20231218140158-47f6d749b9d9
15+
github.com/openshift/library-go v0.0.0-20240228143125-4602d24d27bc
1616
github.com/spf13/cobra v1.8.0
1717
github.com/spf13/pflag v1.0.5
1818
github.com/stretchr/testify v1.8.4
@@ -98,7 +98,6 @@ require (
9898
github.com/firefart/nonamedreturns v1.0.4 // indirect
9999
github.com/fsnotify/fsnotify v1.7.0 // indirect
100100
github.com/fzipp/gocyclo v0.6.0 // indirect
101-
github.com/ghodss/yaml v1.0.0 // indirect
102101
github.com/go-critic/go-critic v0.7.0 // indirect
103102
github.com/go-logr/zapr v1.3.0 // indirect
104103
github.com/go-openapi/jsonpointer v0.20.2 // indirect
@@ -261,14 +260,14 @@ require (
261260
k8s.io/apiserver v0.29.0 // indirect
262261
k8s.io/cloud-provider v0.29.0 // indirect
263262
k8s.io/component-helpers v0.29.0 // indirect
264-
k8s.io/kube-aggregator v0.28.2 // indirect
263+
k8s.io/kube-aggregator v0.29.0 // indirect
265264
k8s.io/kube-openapi v0.0.0-20240105020646-a37d4de58910 // indirect
266265
mvdan.cc/gofumpt v0.4.0 // indirect
267266
mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed // indirect
268267
mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b // indirect
269268
mvdan.cc/unparam v0.0.0-20221223090309-7455f1af531d // indirect
270269
sigs.k8s.io/cloud-provider-azure/pkg/azclient/configloader v0.0.0-20231205023417-1ba5a224ab0e // indirect
271270
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
272-
sigs.k8s.io/kube-storage-version-migrator v0.0.4 // indirect
271+
sigs.k8s.io/kube-storage-version-migrator v0.0.6-0.20230721195810-5c8923c5ff96 // indirect
273272
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
274273
)

go.sum

Lines changed: 10 additions & 285 deletions
Large diffs are not rendered by default.

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
{

vendor/github.com/ghodss/yaml/.gitignore

Lines changed: 0 additions & 20 deletions
This file was deleted.

vendor/github.com/ghodss/yaml/.travis.yml

Lines changed: 0 additions & 7 deletions
This file was deleted.

vendor/github.com/ghodss/yaml/LICENSE

Lines changed: 0 additions & 50 deletions
This file was deleted.

0 commit comments

Comments
 (0)