Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 0 additions & 24 deletions docs/dev/hacking-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,33 +130,9 @@ OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE=quay.io/<your-repo>/release:<your-branc

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

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.

```bash
export OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE=quay.io/<your-repo>/release:<your-branch>

# This step would stop after creation of ./manifests folder. All resources placed there will be created in the cluster
# during bootstrap and would override the default state of the resource in the cluster.
openshift-install create manifests

cat <<EOF > manifests/manifest_feature_gate.yaml
apiVersion: config.openshift.io/v1
kind: FeatureGate
metadata:
annotations:
include.release.openshift.io/self-managed-high-availability: "true"
include.release.openshift.io/single-node-developer: "true"
release.openshift.io/create-only: "true"
name: cluster
spec:
customNoUpgrade:
enabled:
- ExternalCloudProvider
- CSIMigrationAWS
- CSIMigrationOpenStack
featureSet: CustomNoUpgrade
EOF

# Now you could create a cluster with your custom release image
openshift-install create cluster
```
Expand Down
11 changes: 5 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ require (
github.com/golangci/golangci-lint v1.52.2
github.com/onsi/ginkgo/v2 v2.15.0
github.com/onsi/gomega v1.31.1
github.com/openshift/api v0.0.0-20231120222239-b86761094ee3
github.com/openshift/client-go v0.0.0-20230503144108-75015d2347cb
github.com/openshift/library-go v0.0.0-20230614142803-865e70cc6b32
github.com/openshift/api v0.0.0-20231218131639-7a5aa77cc72d
github.com/openshift/client-go v0.0.0-20231218140158-47f6d749b9d9
github.com/openshift/library-go v0.0.0-20240228143125-4602d24d27bc
github.com/spf13/cobra v1.8.0
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.8.4
Expand Down Expand Up @@ -98,7 +98,6 @@ require (
github.com/firefart/nonamedreturns v1.0.4 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/fzipp/gocyclo v0.6.0 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/go-critic/go-critic v0.7.0 // indirect
github.com/go-logr/zapr v1.3.0 // indirect
github.com/go-openapi/jsonpointer v0.20.2 // indirect
Expand Down Expand Up @@ -261,14 +260,14 @@ require (
k8s.io/apiserver v0.29.0 // indirect
k8s.io/cloud-provider v0.29.0 // indirect
k8s.io/component-helpers v0.29.0 // indirect
k8s.io/kube-aggregator v0.28.2 // indirect
k8s.io/kube-aggregator v0.29.0 // indirect
k8s.io/kube-openapi v0.0.0-20240105020646-a37d4de58910 // indirect
mvdan.cc/gofumpt v0.4.0 // indirect
mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed // indirect
mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b // indirect
mvdan.cc/unparam v0.0.0-20221223090309-7455f1af531d // indirect
sigs.k8s.io/cloud-provider-azure/pkg/azclient/configloader v0.0.0-20231205023417-1ba5a224ab0e // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/kube-storage-version-migrator v0.0.4 // indirect
sigs.k8s.io/kube-storage-version-migrator v0.0.6-0.20230721195810-5c8923c5ff96 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
)
295 changes: 10 additions & 285 deletions go.sum

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions pkg/controllers/clusteroperator_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ func (r *CloudOperatorReconciler) provisioningAllowed(ctx context.Context, infra
}

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

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

if err := r.setStatusAvailable(ctx, conditionOverrides); err != nil {
klog.Errorf("Unable to sync cluster operator status: %s", err)
Expand Down
37 changes: 4 additions & 33 deletions pkg/controllers/clusteroperator_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,6 @@ var _ = Describe("Component sync controller", func() {
var operands []client.Object
var watcher mockedWatcher

externalFeatureGateAccessor := featuregates.NewHardcodedFeatureGateAccess(
[]configv1.FeatureGateName{configv1.FeatureGateExternalCloudProvider},
nil,
)

kcmStatus := &operatorv1.KubeControllerManagerStatus{
StaticPodOperatorStatus: operatorv1.StaticPodOperatorStatus{
OperatorStatus: operatorv1.OperatorStatus{
Expand Down Expand Up @@ -363,7 +358,6 @@ var _ = Describe("Component sync controller", func() {

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

if tc.featureGate != nil {
operatorController.FeatureGateAccess = tc.featureGate
}
operatorController.FeatureGateAccess = featuregates.NewHardcodedFeatureGateAccess(nil, nil)

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

watchMap := watcher.getWatchedResources()

operatorConfig := getOperatorConfigForPlatform(tc.status.PlatformStatus, tc.featureGate)
operatorConfig := getOperatorConfigForPlatform(tc.status.PlatformStatus, operatorController.FeatureGateAccess)

clusterOperator, err := operatorController.getOrCreateClusterOperator(context.Background())
Expect(err).To(Succeed())
Expand Down Expand Up @@ -452,7 +444,6 @@ var _ = Describe("Component sync controller", func() {
Type: configv1.AWSPlatformType,
},
},
featureGate: externalFeatureGateAccessor,
kcmStatus: kcmStatus,
coStatus: coStatus,
expectProvisioned: true,
Expand All @@ -466,7 +457,6 @@ var _ = Describe("Component sync controller", func() {
Type: configv1.OpenStackPlatformType,
},
},
featureGate: externalFeatureGateAccessor,
kcmStatus: kcmStatus,
coStatus: coStatus,
expectProvisioned: true,
Expand All @@ -480,7 +470,6 @@ var _ = Describe("Component sync controller", func() {
Type: configv1.AWSPlatformType,
},
},
featureGate: externalFeatureGateAccessor,
kcmStatus: &operatorv1.KubeControllerManagerStatus{},
coStatus: coStatus,
expectProvisioned: true,
Expand All @@ -494,24 +483,10 @@ var _ = Describe("Component sync controller", func() {
Type: configv1.KubevirtPlatformType,
},
},
featureGate: externalFeatureGateAccessor,
kcmStatus: kcmStatus,
coStatus: coStatus,
expectProvisioned: false,
}),
Entry("Should provision resources for AWS if external FeatureGate is not present", testCase{
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This case ended up being identical to another case

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yay for cleanup!

status: &configv1.InfrastructureStatus{
InfrastructureTopology: configv1.HighlyAvailableTopologyMode,
ControlPlaneTopology: configv1.HighlyAvailableTopologyMode,
Platform: configv1.AWSPlatformType,
PlatformStatus: &configv1.PlatformStatus{
Type: configv1.AWSPlatformType,
},
},
kcmStatus: kcmStatus,
coStatus: coStatus,
expectProvisioned: true,
}),
Entry("Should not provision resources for OpenStack if external FeatureGate is not present", testCase{
status: &configv1.InfrastructureStatus{
InfrastructureTopology: configv1.HighlyAvailableTopologyMode,
Expand All @@ -532,7 +507,6 @@ var _ = Describe("Component sync controller", func() {
Type: configv1.AWSPlatformType,
},
},
featureGate: externalFeatureGateAccessor,
kcmStatus: &operatorv1.KubeControllerManagerStatus{
StaticPodOperatorStatus: operatorv1.StaticPodOperatorStatus{
OperatorStatus: operatorv1.OperatorStatus{
Expand All @@ -558,7 +532,6 @@ var _ = Describe("Component sync controller", func() {
Type: configv1.AWSPlatformType,
},
},
featureGate: externalFeatureGateAccessor,
kcmStatus: &operatorv1.KubeControllerManagerStatus{
StaticPodOperatorStatus: operatorv1.StaticPodOperatorStatus{
OperatorStatus: operatorv1.OperatorStatus{
Expand All @@ -584,8 +557,7 @@ var _ = Describe("Component sync controller", func() {
Type: configv1.AWSPlatformType,
},
},
featureGate: externalFeatureGateAccessor,
kcmStatus: kcmStatus,
kcmStatus: kcmStatus,
coStatus: &configv1.ClusterOperatorStatus{
Conditions: []configv1.ClusterOperatorStatusCondition{
{
Expand Down Expand Up @@ -622,8 +594,7 @@ var _ = Describe("Component sync controller", func() {
Type: configv1.AWSPlatformType,
},
},
featureGate: externalFeatureGateAccessor,
kcmStatus: kcmStatus,
kcmStatus: kcmStatus,
coStatus: &configv1.ClusterOperatorStatus{
Conditions: []configv1.ClusterOperatorStatusCondition{
{
Expand Down
20 changes: 0 additions & 20 deletions vendor/github.com/ghodss/yaml/.gitignore

This file was deleted.

7 changes: 0 additions & 7 deletions vendor/github.com/ghodss/yaml/.travis.yml

This file was deleted.

50 changes: 0 additions & 50 deletions vendor/github.com/ghodss/yaml/LICENSE

This file was deleted.

Loading