From a35751ad10d55c8e314a6a1b007dc6ee69cbdae2 Mon Sep 17 00:00:00 2001 From: Juan Manuel Parrilla Madrid Date: Mon, 2 Dec 2024 17:55:20 +0100 Subject: [PATCH] OCPBUGS-43083: Fix IsIPv4 function identifying also addresses instead of CIDRs The issue deploying IPv6 disconnected clusters happens on the validation of the KASEndpointSlice (https://github.com/openshift/hypershift/blob/main/control-plane-operator/hostedclusterconfigoperator/controllers/resources/kas/reconcile.go\#L32). Now that function supports IPv4/IPv6 addresses too, so the workflow is not modified but the validation and configuration of the Kubernetes endpointSlice Signed-off-by: Juan Manuel Parrilla Madrid --- .../hostedcontrolplane/etcd/params.go | 2 +- .../hostedcontrolplane_controller.go | 1 + .../hostedcontrolplane_controller_test.go | 11 +- .../hostedcontrolplane/pki/params.go | 2 +- ...zz_fixture_TestControlPlaneComponents.yaml | 2 +- ...lPlaneComponents_TechPreviewNoUpgrade.yaml | 2 +- ...zz_fixture_TestControlPlaneComponents.yaml | 2 +- ...lPlaneComponents_TechPreviewNoUpgrade.yaml | 2 +- ...zz_fixture_TestControlPlaneComponents.yaml | 2 +- ...lPlaneComponents_TechPreviewNoUpgrade.yaml | 2 +- ...zz_fixture_TestControlPlaneComponents.yaml | 2 +- ...lPlaneComponents_TechPreviewNoUpgrade.yaml | 2 +- ...zz_fixture_TestControlPlaneComponents.yaml | 2 +- ...lPlaneComponents_TechPreviewNoUpgrade.yaml | 2 +- ...zz_fixture_TestControlPlaneComponents.yaml | 2 +- ...lPlaneComponents_TechPreviewNoUpgrade.yaml | 2 +- ...zz_fixture_TestControlPlaneComponents.yaml | 2 +- ...lPlaneComponents_TechPreviewNoUpgrade.yaml | 2 +- ...zz_fixture_TestControlPlaneComponents.yaml | 5 +- ...lPlaneComponents_TechPreviewNoUpgrade.yaml | 6 +- ...zz_fixture_TestControlPlaneComponents.yaml | 2 +- ...lPlaneComponents_TechPreviewNoUpgrade.yaml | 2 +- ...zz_fixture_TestControlPlaneComponents.yaml | 3 +- ...lPlaneComponents_TechPreviewNoUpgrade.yaml | 3 +- ...zz_fixture_TestControlPlaneComponents.yaml | 2 +- ...lPlaneComponents_TechPreviewNoUpgrade.yaml | 2 +- ...zz_fixture_TestControlPlaneComponents.yaml | 2 +- ...lPlaneComponents_TechPreviewNoUpgrade.yaml | 2 +- ...zz_fixture_TestControlPlaneComponents.yaml | 2 +- ...lPlaneComponents_TechPreviewNoUpgrade.yaml | 2 +- ...zz_fixture_TestControlPlaneComponents.yaml | 2 +- ...lPlaneComponents_TechPreviewNoUpgrade.yaml | 2 +- ...zz_fixture_TestControlPlaneComponents.yaml | 2 +- ...lPlaneComponents_TechPreviewNoUpgrade.yaml | 2 +- ...zz_fixture_TestControlPlaneComponents.yaml | 2 +- ...lPlaneComponents_TechPreviewNoUpgrade.yaml | 2 +- ...zz_fixture_TestControlPlaneComponents.yaml | 2 +- ...lPlaneComponents_TechPreviewNoUpgrade.yaml | 2 +- ...zz_fixture_TestControlPlaneComponents.yaml | 2 +- ...lPlaneComponents_TechPreviewNoUpgrade.yaml | 2 +- .../hostedcontrolplane/v2/etcd/statefulset.go | 2 +- .../controllers/resources/kas/reconcile.go | 2 +- .../controllers/nodepool/conditions_test.go | 25 ++-- .../controllers/nodepool/haproxy.go | 2 +- .../controlplane-component.go | 3 + support/globalconfig/network.go | 2 +- support/util/networking.go | 2 +- support/util/util.go | 25 ++-- support/util/util_test.go | 131 +++++++++++------- test/e2e/util/util.go | 6 +- 50 files changed, 180 insertions(+), 117 deletions(-) diff --git a/control-plane-operator/controllers/hostedcontrolplane/etcd/params.go b/control-plane-operator/controllers/hostedcontrolplane/etcd/params.go index b42cf54308..3ba9111e87 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/etcd/params.go +++ b/control-plane-operator/controllers/hostedcontrolplane/etcd/params.go @@ -40,7 +40,7 @@ func etcdPodSelector() map[string]string { func NewEtcdParams(hcp *hyperv1.HostedControlPlane, releaseImageProvider imageprovider.ReleaseImageProvider) (*EtcdParams, error) { - ipv4, err := hyputils.IsIPv4(hcp.Spec.Networking.ClusterNetwork[0].CIDR.String()) + ipv4, err := hyputils.IsIPv4CIDR(hcp.Spec.Networking.ClusterNetwork[0].CIDR.String()) if err != nil { return nil, fmt.Errorf("error checking the ClusterNetworkCIDR: %v", err) } diff --git a/control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go b/control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go index e25fdc6c6b..a6562a6147 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go +++ b/control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go @@ -988,6 +988,7 @@ func (r *HostedControlPlaneReconciler) reconcileCPOV2(ctx context.Context, hcp * SetDefaultSecurityContext: r.SetDefaultSecurityContext, MetricsSet: r.MetricsSet, EnableCIDebugOutput: r.EnableCIDebugOutput, + ImageMetadataProvider: r.ImageMetadataProvider, } var errs []error diff --git a/control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller_test.go b/control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller_test.go index 7d2bdc524b..8a09e42c4e 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller_test.go +++ b/control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller_test.go @@ -34,8 +34,10 @@ import ( "github.com/openshift/hypershift/support/releaseinfo" fakereleaseprovider "github.com/openshift/hypershift/support/releaseinfo/fake" "github.com/openshift/hypershift/support/testutil" + "github.com/openshift/hypershift/support/thirdparty/library-go/pkg/image/dockerv1client" "github.com/openshift/hypershift/support/upsert" "github.com/openshift/hypershift/support/util" + "github.com/openshift/hypershift/support/util/fakeimagemetadataprovider" "go.uber.org/zap/zaptest" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" @@ -1649,6 +1651,7 @@ func TestControlPlaneComponents(t *testing.T) { VPC: &hyperv1.PowerVSVPC{}, }, }, + ReleaseImage: "quay.io/openshift-release-dev/ocp-release:4.16.10-x86_64", }, } @@ -1664,8 +1667,12 @@ func TestControlPlaneComponents(t *testing.T) { CreateOrUpdateProviderV2: upsert.NewV2(false), ReleaseImageProvider: testutil.FakeImageProvider(), UserReleaseImageProvider: testutil.FakeImageProvider(), - HCP: hcp, - SkipPredicate: true, + ImageMetadataProvider: &fakeimagemetadataprovider.FakeRegistryClientImageMetadataProvider{ + Result: &dockerv1client.DockerImageConfig{}, + Manifest: fakeimagemetadataprovider.FakeManifest{}, + }, + HCP: hcp, + SkipPredicate: true, } for _, featureSet := range []configv1.FeatureSet{configv1.Default, configv1.TechPreviewNoUpgrade} { cpContext.HCP.Spec.Configuration.FeatureGate.FeatureGateSelection.FeatureSet = featureSet diff --git a/control-plane-operator/controllers/hostedcontrolplane/pki/params.go b/control-plane-operator/controllers/hostedcontrolplane/pki/params.go index 068e888dc0..413e90c843 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/pki/params.go +++ b/control-plane-operator/controllers/hostedcontrolplane/pki/params.go @@ -84,7 +84,7 @@ func NewPKIParams(hcp *hyperv1.HostedControlPlane, // Even with that, we cannot set more than one AdvertiseAddress so both // are not supported at the same time. // Check this for more info: https://github.com/kubernetes/enhancements/issues/2438 - ipv4, err := util.IsIPv4(p.ServiceCIDR[0]) + ipv4, err := util.IsIPv4CIDR(p.ServiceCIDR[0]) if err != nil || ipv4 { p.NodeInternalAPIServerIP = util.AdvertiseAddressWithDefault(hcp, config.DefaultAdvertiseIPv4Address) } else { diff --git a/control-plane-operator/controllers/hostedcontrolplane/testdata/cloud-controller-manager-aws/zz_fixture_TestControlPlaneComponents.yaml b/control-plane-operator/controllers/hostedcontrolplane/testdata/cloud-controller-manager-aws/zz_fixture_TestControlPlaneComponents.yaml index 6e8d56ddc2..351808d9b0 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/testdata/cloud-controller-manager-aws/zz_fixture_TestControlPlaneComponents.yaml +++ b/control-plane-operator/controllers/hostedcontrolplane/testdata/cloud-controller-manager-aws/zz_fixture_TestControlPlaneComponents.yaml @@ -26,7 +26,7 @@ spec: metadata: annotations: cluster-autoscaler.kubernetes.io/safe-to-evict-local-volumes: cloud-token - hypershift.openshift.io/release-image: "" + hypershift.openshift.io/release-image: quay.io/openshift-release-dev/ocp-release:4.16.10-x86_64 creationTimestamp: null labels: app: cloud-controller-manager diff --git a/control-plane-operator/controllers/hostedcontrolplane/testdata/cloud-controller-manager-aws/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml b/control-plane-operator/controllers/hostedcontrolplane/testdata/cloud-controller-manager-aws/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml index 6e8d56ddc2..351808d9b0 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/testdata/cloud-controller-manager-aws/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml +++ b/control-plane-operator/controllers/hostedcontrolplane/testdata/cloud-controller-manager-aws/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml @@ -26,7 +26,7 @@ spec: metadata: annotations: cluster-autoscaler.kubernetes.io/safe-to-evict-local-volumes: cloud-token - hypershift.openshift.io/release-image: "" + hypershift.openshift.io/release-image: quay.io/openshift-release-dev/ocp-release:4.16.10-x86_64 creationTimestamp: null labels: app: cloud-controller-manager diff --git a/control-plane-operator/controllers/hostedcontrolplane/testdata/cloud-controller-manager-azure/zz_fixture_TestControlPlaneComponents.yaml b/control-plane-operator/controllers/hostedcontrolplane/testdata/cloud-controller-manager-azure/zz_fixture_TestControlPlaneComponents.yaml index 8a467d0b9f..4221abbab1 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/testdata/cloud-controller-manager-azure/zz_fixture_TestControlPlaneComponents.yaml +++ b/control-plane-operator/controllers/hostedcontrolplane/testdata/cloud-controller-manager-azure/zz_fixture_TestControlPlaneComponents.yaml @@ -25,7 +25,7 @@ spec: template: metadata: annotations: - hypershift.openshift.io/release-image: "" + hypershift.openshift.io/release-image: quay.io/openshift-release-dev/ocp-release:4.16.10-x86_64 creationTimestamp: null labels: app: cloud-controller-manager diff --git a/control-plane-operator/controllers/hostedcontrolplane/testdata/cloud-controller-manager-azure/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml b/control-plane-operator/controllers/hostedcontrolplane/testdata/cloud-controller-manager-azure/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml index 8a467d0b9f..4221abbab1 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/testdata/cloud-controller-manager-azure/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml +++ b/control-plane-operator/controllers/hostedcontrolplane/testdata/cloud-controller-manager-azure/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml @@ -25,7 +25,7 @@ spec: template: metadata: annotations: - hypershift.openshift.io/release-image: "" + hypershift.openshift.io/release-image: quay.io/openshift-release-dev/ocp-release:4.16.10-x86_64 creationTimestamp: null labels: app: cloud-controller-manager diff --git a/control-plane-operator/controllers/hostedcontrolplane/testdata/cloud-controller-manager-kubevirt/zz_fixture_TestControlPlaneComponents.yaml b/control-plane-operator/controllers/hostedcontrolplane/testdata/cloud-controller-manager-kubevirt/zz_fixture_TestControlPlaneComponents.yaml index 9ceb39dd6f..0ae35b3531 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/testdata/cloud-controller-manager-kubevirt/zz_fixture_TestControlPlaneComponents.yaml +++ b/control-plane-operator/controllers/hostedcontrolplane/testdata/cloud-controller-manager-kubevirt/zz_fixture_TestControlPlaneComponents.yaml @@ -28,7 +28,7 @@ spec: template: metadata: annotations: - hypershift.openshift.io/release-image: "" + hypershift.openshift.io/release-image: quay.io/openshift-release-dev/ocp-release:4.16.10-x86_64 creationTimestamp: null labels: app: cloud-controller-manager diff --git a/control-plane-operator/controllers/hostedcontrolplane/testdata/cloud-controller-manager-kubevirt/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml b/control-plane-operator/controllers/hostedcontrolplane/testdata/cloud-controller-manager-kubevirt/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml index 9ceb39dd6f..0ae35b3531 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/testdata/cloud-controller-manager-kubevirt/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml +++ b/control-plane-operator/controllers/hostedcontrolplane/testdata/cloud-controller-manager-kubevirt/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml @@ -28,7 +28,7 @@ spec: template: metadata: annotations: - hypershift.openshift.io/release-image: "" + hypershift.openshift.io/release-image: quay.io/openshift-release-dev/ocp-release:4.16.10-x86_64 creationTimestamp: null labels: app: cloud-controller-manager diff --git a/control-plane-operator/controllers/hostedcontrolplane/testdata/cloud-controller-manager-openstack/zz_fixture_TestControlPlaneComponents.yaml b/control-plane-operator/controllers/hostedcontrolplane/testdata/cloud-controller-manager-openstack/zz_fixture_TestControlPlaneComponents.yaml index 3378b3527c..c94aed63f3 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/testdata/cloud-controller-manager-openstack/zz_fixture_TestControlPlaneComponents.yaml +++ b/control-plane-operator/controllers/hostedcontrolplane/testdata/cloud-controller-manager-openstack/zz_fixture_TestControlPlaneComponents.yaml @@ -26,7 +26,7 @@ spec: template: metadata: annotations: - hypershift.openshift.io/release-image: "" + hypershift.openshift.io/release-image: quay.io/openshift-release-dev/ocp-release:4.16.10-x86_64 creationTimestamp: null labels: hypershift.openshift.io/control-plane-component: cloud-controller-manager-openstack diff --git a/control-plane-operator/controllers/hostedcontrolplane/testdata/cloud-controller-manager-openstack/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml b/control-plane-operator/controllers/hostedcontrolplane/testdata/cloud-controller-manager-openstack/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml index 3378b3527c..c94aed63f3 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/testdata/cloud-controller-manager-openstack/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml +++ b/control-plane-operator/controllers/hostedcontrolplane/testdata/cloud-controller-manager-openstack/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml @@ -26,7 +26,7 @@ spec: template: metadata: annotations: - hypershift.openshift.io/release-image: "" + hypershift.openshift.io/release-image: quay.io/openshift-release-dev/ocp-release:4.16.10-x86_64 creationTimestamp: null labels: hypershift.openshift.io/control-plane-component: cloud-controller-manager-openstack diff --git a/control-plane-operator/controllers/hostedcontrolplane/testdata/cloud-controller-manager-powervs/zz_fixture_TestControlPlaneComponents.yaml b/control-plane-operator/controllers/hostedcontrolplane/testdata/cloud-controller-manager-powervs/zz_fixture_TestControlPlaneComponents.yaml index b851d1949d..36412166d2 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/testdata/cloud-controller-manager-powervs/zz_fixture_TestControlPlaneComponents.yaml +++ b/control-plane-operator/controllers/hostedcontrolplane/testdata/cloud-controller-manager-powervs/zz_fixture_TestControlPlaneComponents.yaml @@ -24,7 +24,7 @@ spec: template: metadata: annotations: - hypershift.openshift.io/release-image: "" + hypershift.openshift.io/release-image: quay.io/openshift-release-dev/ocp-release:4.16.10-x86_64 creationTimestamp: null labels: hypershift.openshift.io/control-plane-component: cloud-controller-manager-powervs diff --git a/control-plane-operator/controllers/hostedcontrolplane/testdata/cloud-controller-manager-powervs/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml b/control-plane-operator/controllers/hostedcontrolplane/testdata/cloud-controller-manager-powervs/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml index b851d1949d..36412166d2 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/testdata/cloud-controller-manager-powervs/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml +++ b/control-plane-operator/controllers/hostedcontrolplane/testdata/cloud-controller-manager-powervs/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml @@ -24,7 +24,7 @@ spec: template: metadata: annotations: - hypershift.openshift.io/release-image: "" + hypershift.openshift.io/release-image: quay.io/openshift-release-dev/ocp-release:4.16.10-x86_64 creationTimestamp: null labels: hypershift.openshift.io/control-plane-component: cloud-controller-manager-powervs diff --git a/control-plane-operator/controllers/hostedcontrolplane/testdata/cluster-autoscaler/zz_fixture_TestControlPlaneComponents.yaml b/control-plane-operator/controllers/hostedcontrolplane/testdata/cluster-autoscaler/zz_fixture_TestControlPlaneComponents.yaml index bd18d6ad63..c6e3961408 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/testdata/cluster-autoscaler/zz_fixture_TestControlPlaneComponents.yaml +++ b/control-plane-operator/controllers/hostedcontrolplane/testdata/cluster-autoscaler/zz_fixture_TestControlPlaneComponents.yaml @@ -28,7 +28,7 @@ spec: template: metadata: annotations: - hypershift.openshift.io/release-image: "" + hypershift.openshift.io/release-image: quay.io/openshift-release-dev/ocp-release:4.16.10-x86_64 creationTimestamp: null labels: app: cluster-autoscaler diff --git a/control-plane-operator/controllers/hostedcontrolplane/testdata/cluster-autoscaler/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml b/control-plane-operator/controllers/hostedcontrolplane/testdata/cluster-autoscaler/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml index bd18d6ad63..c6e3961408 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/testdata/cluster-autoscaler/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml +++ b/control-plane-operator/controllers/hostedcontrolplane/testdata/cluster-autoscaler/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml @@ -28,7 +28,7 @@ spec: template: metadata: annotations: - hypershift.openshift.io/release-image: "" + hypershift.openshift.io/release-image: quay.io/openshift-release-dev/ocp-release:4.16.10-x86_64 creationTimestamp: null labels: app: cluster-autoscaler diff --git a/control-plane-operator/controllers/hostedcontrolplane/testdata/cluster-policy-controller/zz_fixture_TestControlPlaneComponents.yaml b/control-plane-operator/controllers/hostedcontrolplane/testdata/cluster-policy-controller/zz_fixture_TestControlPlaneComponents.yaml index adf471a82a..e25573bf2d 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/testdata/cluster-policy-controller/zz_fixture_TestControlPlaneComponents.yaml +++ b/control-plane-operator/controllers/hostedcontrolplane/testdata/cluster-policy-controller/zz_fixture_TestControlPlaneComponents.yaml @@ -28,7 +28,7 @@ spec: template: metadata: annotations: - hypershift.openshift.io/release-image: "" + hypershift.openshift.io/release-image: quay.io/openshift-release-dev/ocp-release:4.16.10-x86_64 creationTimestamp: null labels: app: cluster-policy-controller diff --git a/control-plane-operator/controllers/hostedcontrolplane/testdata/cluster-policy-controller/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml b/control-plane-operator/controllers/hostedcontrolplane/testdata/cluster-policy-controller/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml index adf471a82a..e25573bf2d 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/testdata/cluster-policy-controller/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml +++ b/control-plane-operator/controllers/hostedcontrolplane/testdata/cluster-policy-controller/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml @@ -28,7 +28,7 @@ spec: template: metadata: annotations: - hypershift.openshift.io/release-image: "" + hypershift.openshift.io/release-image: quay.io/openshift-release-dev/ocp-release:4.16.10-x86_64 creationTimestamp: null labels: app: cluster-policy-controller diff --git a/control-plane-operator/controllers/hostedcontrolplane/testdata/cluster-version-operator/zz_fixture_TestControlPlaneComponents.yaml b/control-plane-operator/controllers/hostedcontrolplane/testdata/cluster-version-operator/zz_fixture_TestControlPlaneComponents.yaml index db7d878f3a..14d88d5924 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/testdata/cluster-version-operator/zz_fixture_TestControlPlaneComponents.yaml +++ b/control-plane-operator/controllers/hostedcontrolplane/testdata/cluster-version-operator/zz_fixture_TestControlPlaneComponents.yaml @@ -30,7 +30,7 @@ spec: metadata: annotations: cluster-autoscaler.kubernetes.io/safe-to-evict-local-volumes: payload,update-payloads - hypershift.openshift.io/release-image: "" + hypershift.openshift.io/release-image: quay.io/openshift-release-dev/ocp-release:4.16.10-x86_64 creationTimestamp: null labels: app: cluster-version-operator @@ -85,6 +85,7 @@ spec: - name: CLUSTER_PROFILE value: ibm-cloud-managed - name: RELEASE_IMAGE + value: quay.io/openshift-release-dev/ocp-release:4.16.10-x86_64 - name: NODE_NAME valueFrom: fieldRef: @@ -287,7 +288,7 @@ spec: EOF command: - /bin/bash - image: cluster-version-operator + image: quay.io/openshift-release-dev/ocp-release:4.16.10-x86_64 imagePullPolicy: IfNotPresent name: prepare-payload resources: diff --git a/control-plane-operator/controllers/hostedcontrolplane/testdata/cluster-version-operator/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml b/control-plane-operator/controllers/hostedcontrolplane/testdata/cluster-version-operator/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml index b74b682536..bf90668770 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/testdata/cluster-version-operator/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml +++ b/control-plane-operator/controllers/hostedcontrolplane/testdata/cluster-version-operator/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml @@ -30,7 +30,7 @@ spec: metadata: annotations: cluster-autoscaler.kubernetes.io/safe-to-evict-local-volumes: payload,update-payloads - hypershift.openshift.io/release-image: "" + hypershift.openshift.io/release-image: quay.io/openshift-release-dev/ocp-release:4.16.10-x86_64 creationTimestamp: null labels: app: cluster-version-operator @@ -85,6 +85,7 @@ spec: - name: CLUSTER_PROFILE value: ibm-cloud-managed - name: RELEASE_IMAGE + value: quay.io/openshift-release-dev/ocp-release:4.16.10-x86_64 - name: NODE_NAME valueFrom: fieldRef: @@ -284,9 +285,10 @@ spec: annotations: include.release.openshift.io/ibm-cloud-managed: "true" release.openshift.io/delete: "true" + EOF command: - /bin/bash - image: cluster-version-operator + image: quay.io/openshift-release-dev/ocp-release:4.16.10-x86_64 imagePullPolicy: IfNotPresent name: prepare-payload resources: diff --git a/control-plane-operator/controllers/hostedcontrolplane/testdata/etcd/zz_fixture_TestControlPlaneComponents.yaml b/control-plane-operator/controllers/hostedcontrolplane/testdata/etcd/zz_fixture_TestControlPlaneComponents.yaml index 93c0916429..a7d0c5e9ce 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/testdata/etcd/zz_fixture_TestControlPlaneComponents.yaml +++ b/control-plane-operator/controllers/hostedcontrolplane/testdata/etcd/zz_fixture_TestControlPlaneComponents.yaml @@ -26,7 +26,7 @@ spec: template: metadata: annotations: - hypershift.openshift.io/release-image: "" + hypershift.openshift.io/release-image: quay.io/openshift-release-dev/ocp-release:4.16.10-x86_64 creationTimestamp: null labels: app: etcd diff --git a/control-plane-operator/controllers/hostedcontrolplane/testdata/etcd/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml b/control-plane-operator/controllers/hostedcontrolplane/testdata/etcd/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml index 93c0916429..a7d0c5e9ce 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/testdata/etcd/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml +++ b/control-plane-operator/controllers/hostedcontrolplane/testdata/etcd/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml @@ -26,7 +26,7 @@ spec: template: metadata: annotations: - hypershift.openshift.io/release-image: "" + hypershift.openshift.io/release-image: quay.io/openshift-release-dev/ocp-release:4.16.10-x86_64 creationTimestamp: null labels: app: etcd diff --git a/control-plane-operator/controllers/hostedcontrolplane/testdata/hosted-cluster-config-operator/zz_fixture_TestControlPlaneComponents.yaml b/control-plane-operator/controllers/hostedcontrolplane/testdata/hosted-cluster-config-operator/zz_fixture_TestControlPlaneComponents.yaml index e4d1c676c2..8a69bc1944 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/testdata/hosted-cluster-config-operator/zz_fixture_TestControlPlaneComponents.yaml +++ b/control-plane-operator/controllers/hostedcontrolplane/testdata/hosted-cluster-config-operator/zz_fixture_TestControlPlaneComponents.yaml @@ -25,7 +25,7 @@ spec: template: metadata: annotations: - hypershift.openshift.io/release-image: "" + hypershift.openshift.io/release-image: quay.io/openshift-release-dev/ocp-release:4.16.10-x86_64 creationTimestamp: null labels: app: hosted-cluster-config-operator @@ -89,6 +89,7 @@ spec: - name: KUBERNETES_VERSION value: "1.30" - name: OPERATE_ON_RELEASE_IMAGE + value: quay.io/openshift-release-dev/ocp-release:4.16.10-x86_64 - name: OPENSHIFT_IMG_OVERRIDES value: = image: hosted-cluster-config-operator diff --git a/control-plane-operator/controllers/hostedcontrolplane/testdata/hosted-cluster-config-operator/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml b/control-plane-operator/controllers/hostedcontrolplane/testdata/hosted-cluster-config-operator/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml index e4d1c676c2..8a69bc1944 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/testdata/hosted-cluster-config-operator/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml +++ b/control-plane-operator/controllers/hostedcontrolplane/testdata/hosted-cluster-config-operator/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml @@ -25,7 +25,7 @@ spec: template: metadata: annotations: - hypershift.openshift.io/release-image: "" + hypershift.openshift.io/release-image: quay.io/openshift-release-dev/ocp-release:4.16.10-x86_64 creationTimestamp: null labels: app: hosted-cluster-config-operator @@ -89,6 +89,7 @@ spec: - name: KUBERNETES_VERSION value: "1.30" - name: OPERATE_ON_RELEASE_IMAGE + value: quay.io/openshift-release-dev/ocp-release:4.16.10-x86_64 - name: OPENSHIFT_IMG_OVERRIDES value: = image: hosted-cluster-config-operator diff --git a/control-plane-operator/controllers/hostedcontrolplane/testdata/kube-apiserver/zz_fixture_TestControlPlaneComponents.yaml b/control-plane-operator/controllers/hostedcontrolplane/testdata/kube-apiserver/zz_fixture_TestControlPlaneComponents.yaml index 335f66b28c..52cdcf8ce4 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/testdata/kube-apiserver/zz_fixture_TestControlPlaneComponents.yaml +++ b/control-plane-operator/controllers/hostedcontrolplane/testdata/kube-apiserver/zz_fixture_TestControlPlaneComponents.yaml @@ -30,7 +30,7 @@ spec: annotations: cluster-autoscaler.kubernetes.io/safe-to-evict-local-volumes: bootstrap-manifests,logs component.hypershift.openshift.io/config-hash: 19dc307e1d8949e23415eb6680075ec3 - hypershift.openshift.io/release-image: "" + hypershift.openshift.io/release-image: quay.io/openshift-release-dev/ocp-release:4.16.10-x86_64 creationTimestamp: null labels: app: kube-apiserver diff --git a/control-plane-operator/controllers/hostedcontrolplane/testdata/kube-apiserver/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml b/control-plane-operator/controllers/hostedcontrolplane/testdata/kube-apiserver/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml index 9c643fd7be..a6f158429d 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/testdata/kube-apiserver/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml +++ b/control-plane-operator/controllers/hostedcontrolplane/testdata/kube-apiserver/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml @@ -30,7 +30,7 @@ spec: annotations: cluster-autoscaler.kubernetes.io/safe-to-evict-local-volumes: bootstrap-manifests,logs component.hypershift.openshift.io/config-hash: 19dc307e1d8949e23415eb667d1e0a2d - hypershift.openshift.io/release-image: "" + hypershift.openshift.io/release-image: quay.io/openshift-release-dev/ocp-release:4.16.10-x86_64 creationTimestamp: null labels: app: kube-apiserver diff --git a/control-plane-operator/controllers/hostedcontrolplane/testdata/kube-controller-manager/zz_fixture_TestControlPlaneComponents.yaml b/control-plane-operator/controllers/hostedcontrolplane/testdata/kube-controller-manager/zz_fixture_TestControlPlaneComponents.yaml index 0a791151b3..4d11fa69b0 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/testdata/kube-controller-manager/zz_fixture_TestControlPlaneComponents.yaml +++ b/control-plane-operator/controllers/hostedcontrolplane/testdata/kube-controller-manager/zz_fixture_TestControlPlaneComponents.yaml @@ -30,7 +30,7 @@ spec: annotations: cluster-autoscaler.kubernetes.io/safe-to-evict-local-volumes: logs,certs component.hypershift.openshift.io/config-hash: "1252551421580954" - hypershift.openshift.io/release-image: "" + hypershift.openshift.io/release-image: quay.io/openshift-release-dev/ocp-release:4.16.10-x86_64 creationTimestamp: null labels: app: kube-controller-manager diff --git a/control-plane-operator/controllers/hostedcontrolplane/testdata/kube-controller-manager/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml b/control-plane-operator/controllers/hostedcontrolplane/testdata/kube-controller-manager/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml index 38bc8078f7..31df76b6f4 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/testdata/kube-controller-manager/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml +++ b/control-plane-operator/controllers/hostedcontrolplane/testdata/kube-controller-manager/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml @@ -30,7 +30,7 @@ spec: annotations: cluster-autoscaler.kubernetes.io/safe-to-evict-local-volumes: logs,certs component.hypershift.openshift.io/config-hash: "1252551421580954" - hypershift.openshift.io/release-image: "" + hypershift.openshift.io/release-image: quay.io/openshift-release-dev/ocp-release:4.16.10-x86_64 creationTimestamp: null labels: app: kube-controller-manager diff --git a/control-plane-operator/controllers/hostedcontrolplane/testdata/kube-scheduler/zz_fixture_TestControlPlaneComponents.yaml b/control-plane-operator/controllers/hostedcontrolplane/testdata/kube-scheduler/zz_fixture_TestControlPlaneComponents.yaml index 59136d04e3..986a1592a9 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/testdata/kube-scheduler/zz_fixture_TestControlPlaneComponents.yaml +++ b/control-plane-operator/controllers/hostedcontrolplane/testdata/kube-scheduler/zz_fixture_TestControlPlaneComponents.yaml @@ -30,7 +30,7 @@ spec: annotations: cluster-autoscaler.kubernetes.io/safe-to-evict-local-volumes: cert-work component.hypershift.openshift.io/config-hash: 022a8a3a - hypershift.openshift.io/release-image: "" + hypershift.openshift.io/release-image: quay.io/openshift-release-dev/ocp-release:4.16.10-x86_64 creationTimestamp: null labels: app: kube-scheduler diff --git a/control-plane-operator/controllers/hostedcontrolplane/testdata/kube-scheduler/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml b/control-plane-operator/controllers/hostedcontrolplane/testdata/kube-scheduler/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml index 0777d09b49..10655fb4d4 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/testdata/kube-scheduler/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml +++ b/control-plane-operator/controllers/hostedcontrolplane/testdata/kube-scheduler/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml @@ -30,7 +30,7 @@ spec: annotations: cluster-autoscaler.kubernetes.io/safe-to-evict-local-volumes: cert-work component.hypershift.openshift.io/config-hash: 022a8a3a - hypershift.openshift.io/release-image: "" + hypershift.openshift.io/release-image: quay.io/openshift-release-dev/ocp-release:4.16.10-x86_64 creationTimestamp: null labels: app: kube-scheduler diff --git a/control-plane-operator/controllers/hostedcontrolplane/testdata/openshift-apiserver/zz_fixture_TestControlPlaneComponents.yaml b/control-plane-operator/controllers/hostedcontrolplane/testdata/openshift-apiserver/zz_fixture_TestControlPlaneComponents.yaml index cc72d37d53..508b443710 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/testdata/openshift-apiserver/zz_fixture_TestControlPlaneComponents.yaml +++ b/control-plane-operator/controllers/hostedcontrolplane/testdata/openshift-apiserver/zz_fixture_TestControlPlaneComponents.yaml @@ -30,7 +30,7 @@ spec: annotations: cluster-autoscaler.kubernetes.io/safe-to-evict-local-volumes: work-logs,oas-trust-anchor component.hypershift.openshift.io/config-hash: 19dc307e3415eb666d06370b - hypershift.openshift.io/release-image: "" + hypershift.openshift.io/release-image: quay.io/openshift-release-dev/ocp-release:4.16.10-x86_64 creationTimestamp: null labels: app: openshift-apiserver diff --git a/control-plane-operator/controllers/hostedcontrolplane/testdata/openshift-apiserver/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml b/control-plane-operator/controllers/hostedcontrolplane/testdata/openshift-apiserver/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml index cc72d37d53..508b443710 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/testdata/openshift-apiserver/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml +++ b/control-plane-operator/controllers/hostedcontrolplane/testdata/openshift-apiserver/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml @@ -30,7 +30,7 @@ spec: annotations: cluster-autoscaler.kubernetes.io/safe-to-evict-local-volumes: work-logs,oas-trust-anchor component.hypershift.openshift.io/config-hash: 19dc307e3415eb666d06370b - hypershift.openshift.io/release-image: "" + hypershift.openshift.io/release-image: quay.io/openshift-release-dev/ocp-release:4.16.10-x86_64 creationTimestamp: null labels: app: openshift-apiserver diff --git a/control-plane-operator/controllers/hostedcontrolplane/testdata/openshift-controller-manager/zz_fixture_TestControlPlaneComponents.yaml b/control-plane-operator/controllers/hostedcontrolplane/testdata/openshift-controller-manager/zz_fixture_TestControlPlaneComponents.yaml index cc0a301355..77a55cbf2b 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/testdata/openshift-controller-manager/zz_fixture_TestControlPlaneComponents.yaml +++ b/control-plane-operator/controllers/hostedcontrolplane/testdata/openshift-controller-manager/zz_fixture_TestControlPlaneComponents.yaml @@ -29,7 +29,7 @@ spec: metadata: annotations: component.hypershift.openshift.io/config-hash: 8bcb4d22 - hypershift.openshift.io/release-image: "" + hypershift.openshift.io/release-image: quay.io/openshift-release-dev/ocp-release:4.16.10-x86_64 creationTimestamp: null labels: app: openshift-controller-manager diff --git a/control-plane-operator/controllers/hostedcontrolplane/testdata/openshift-controller-manager/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml b/control-plane-operator/controllers/hostedcontrolplane/testdata/openshift-controller-manager/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml index cc0a301355..77a55cbf2b 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/testdata/openshift-controller-manager/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml +++ b/control-plane-operator/controllers/hostedcontrolplane/testdata/openshift-controller-manager/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml @@ -29,7 +29,7 @@ spec: metadata: annotations: component.hypershift.openshift.io/config-hash: 8bcb4d22 - hypershift.openshift.io/release-image: "" + hypershift.openshift.io/release-image: quay.io/openshift-release-dev/ocp-release:4.16.10-x86_64 creationTimestamp: null labels: app: openshift-controller-manager diff --git a/control-plane-operator/controllers/hostedcontrolplane/testdata/openshift-oauth-apiserver/zz_fixture_TestControlPlaneComponents.yaml b/control-plane-operator/controllers/hostedcontrolplane/testdata/openshift-oauth-apiserver/zz_fixture_TestControlPlaneComponents.yaml index 65b140a9d2..cff17575b1 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/testdata/openshift-oauth-apiserver/zz_fixture_TestControlPlaneComponents.yaml +++ b/control-plane-operator/controllers/hostedcontrolplane/testdata/openshift-oauth-apiserver/zz_fixture_TestControlPlaneComponents.yaml @@ -30,7 +30,7 @@ spec: annotations: cluster-autoscaler.kubernetes.io/safe-to-evict-local-volumes: work-logs component.hypershift.openshift.io/config-hash: 19dc307e3415eb66 - hypershift.openshift.io/release-image: "" + hypershift.openshift.io/release-image: quay.io/openshift-release-dev/ocp-release:4.16.10-x86_64 creationTimestamp: null labels: app: openshift-oauth-apiserver diff --git a/control-plane-operator/controllers/hostedcontrolplane/testdata/openshift-oauth-apiserver/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml b/control-plane-operator/controllers/hostedcontrolplane/testdata/openshift-oauth-apiserver/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml index 65b140a9d2..cff17575b1 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/testdata/openshift-oauth-apiserver/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml +++ b/control-plane-operator/controllers/hostedcontrolplane/testdata/openshift-oauth-apiserver/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml @@ -30,7 +30,7 @@ spec: annotations: cluster-autoscaler.kubernetes.io/safe-to-evict-local-volumes: work-logs component.hypershift.openshift.io/config-hash: 19dc307e3415eb66 - hypershift.openshift.io/release-image: "" + hypershift.openshift.io/release-image: quay.io/openshift-release-dev/ocp-release:4.16.10-x86_64 creationTimestamp: null labels: app: openshift-oauth-apiserver diff --git a/control-plane-operator/controllers/hostedcontrolplane/testdata/openshift-route-controller-manager/zz_fixture_TestControlPlaneComponents.yaml b/control-plane-operator/controllers/hostedcontrolplane/testdata/openshift-route-controller-manager/zz_fixture_TestControlPlaneComponents.yaml index 4574809131..08c520d210 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/testdata/openshift-route-controller-manager/zz_fixture_TestControlPlaneComponents.yaml +++ b/control-plane-operator/controllers/hostedcontrolplane/testdata/openshift-route-controller-manager/zz_fixture_TestControlPlaneComponents.yaml @@ -29,7 +29,7 @@ spec: metadata: annotations: component.hypershift.openshift.io/config-hash: 57c9c948 - hypershift.openshift.io/release-image: "" + hypershift.openshift.io/release-image: quay.io/openshift-release-dev/ocp-release:4.16.10-x86_64 creationTimestamp: null labels: app: openshift-route-controller-manager diff --git a/control-plane-operator/controllers/hostedcontrolplane/testdata/openshift-route-controller-manager/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml b/control-plane-operator/controllers/hostedcontrolplane/testdata/openshift-route-controller-manager/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml index 4574809131..08c520d210 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/testdata/openshift-route-controller-manager/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml +++ b/control-plane-operator/controllers/hostedcontrolplane/testdata/openshift-route-controller-manager/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml @@ -29,7 +29,7 @@ spec: metadata: annotations: component.hypershift.openshift.io/config-hash: 57c9c948 - hypershift.openshift.io/release-image: "" + hypershift.openshift.io/release-image: quay.io/openshift-release-dev/ocp-release:4.16.10-x86_64 creationTimestamp: null labels: app: openshift-route-controller-manager diff --git a/control-plane-operator/controllers/hostedcontrolplane/testdata/router/zz_fixture_TestControlPlaneComponents.yaml b/control-plane-operator/controllers/hostedcontrolplane/testdata/router/zz_fixture_TestControlPlaneComponents.yaml index e3777464c2..8ab2c2b069 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/testdata/router/zz_fixture_TestControlPlaneComponents.yaml +++ b/control-plane-operator/controllers/hostedcontrolplane/testdata/router/zz_fixture_TestControlPlaneComponents.yaml @@ -29,7 +29,7 @@ spec: metadata: annotations: component.hypershift.openshift.io/config-hash: 417672c4 - hypershift.openshift.io/release-image: "" + hypershift.openshift.io/release-image: quay.io/openshift-release-dev/ocp-release:4.16.10-x86_64 creationTimestamp: null labels: app: private-router diff --git a/control-plane-operator/controllers/hostedcontrolplane/testdata/router/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml b/control-plane-operator/controllers/hostedcontrolplane/testdata/router/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml index e3777464c2..8ab2c2b069 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/testdata/router/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml +++ b/control-plane-operator/controllers/hostedcontrolplane/testdata/router/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml @@ -29,7 +29,7 @@ spec: metadata: annotations: component.hypershift.openshift.io/config-hash: 417672c4 - hypershift.openshift.io/release-image: "" + hypershift.openshift.io/release-image: quay.io/openshift-release-dev/ocp-release:4.16.10-x86_64 creationTimestamp: null labels: app: private-router diff --git a/control-plane-operator/controllers/hostedcontrolplane/v2/etcd/statefulset.go b/control-plane-operator/controllers/hostedcontrolplane/v2/etcd/statefulset.go index 3da9862ecf..c53eb7ac24 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/v2/etcd/statefulset.go +++ b/control-plane-operator/controllers/hostedcontrolplane/v2/etcd/statefulset.go @@ -21,7 +21,7 @@ func adaptStatefulSet(cpContext component.WorkloadContext, sts *appsv1.StatefulS hcp := cpContext.HCP managedEtcdSpec := hcp.Spec.Etcd.Managed - ipv4, err := util.IsIPv4(hcp.Spec.Networking.ClusterNetwork[0].CIDR.String()) + ipv4, err := util.IsIPv4CIDR(hcp.Spec.Networking.ClusterNetwork[0].CIDR.String()) if err != nil { return fmt.Errorf("error checking the ClusterNetworkCIDR: %v", err) } diff --git a/control-plane-operator/hostedclusterconfigoperator/controllers/resources/kas/reconcile.go b/control-plane-operator/hostedclusterconfigoperator/controllers/resources/kas/reconcile.go index 4221d736d4..014990fb33 100644 --- a/control-plane-operator/hostedclusterconfigoperator/controllers/resources/kas/reconcile.go +++ b/control-plane-operator/hostedclusterconfigoperator/controllers/resources/kas/reconcile.go @@ -29,7 +29,7 @@ func ReconcileKASEndpointSlice(endpointSlice *discoveryv1.EndpointSlice, address endpointSlice.Labels = map[string]string{} } endpointSlice.Labels[discoveryv1.LabelServiceName] = "kubernetes" - ipv4, err := util.IsIPv4(address) + ipv4, err := util.IsIPv4Address(address) if err != nil || ipv4 { endpointSlice.AddressType = discoveryv1.AddressTypeIPv4 } else { diff --git a/hypershift-operator/controllers/nodepool/conditions_test.go b/hypershift-operator/controllers/nodepool/conditions_test.go index 6b7d3fee23..30d1a60ef9 100644 --- a/hypershift-operator/controllers/nodepool/conditions_test.go +++ b/hypershift-operator/controllers/nodepool/conditions_test.go @@ -3,6 +3,9 @@ package nodepool import ( "context" "fmt" + "testing" + "time" + "github.com/blang/semver" "github.com/openshift/api/image/docker10" "github.com/openshift/hypershift/hypershift-operator/controllers/manifests/ignitionserver" @@ -13,8 +16,6 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client/fake" - "testing" - "time" hyperv1 "github.com/openshift/hypershift/api/hypershift/v1beta1" corev1 "k8s.io/api/core/v1" @@ -219,9 +220,13 @@ func TestUpdatingConfigCondition(t *testing.T) { r := &NodePoolReconciler{ Client: client, ReleaseProvider: &fakereleaseprovider.FakeReleaseProvider{Version: semver.MustParse("4.18.0").String()}, - ImageMetadataProvider: &fakeimagemetadataprovider.FakeImageMetadataProvider{Result: &dockerv1client.DockerImageConfig{Config: &docker10.DockerConfig{ - Labels: map[string]string{}, - }}}, + ImageMetadataProvider: &fakeimagemetadataprovider.FakeRegistryClientImageMetadataProvider{ + Result: &dockerv1client.DockerImageConfig{ + Config: &docker10.DockerConfig{ + Labels: map[string]string{}, + }, + }, + }, } if tc.machineSetExists { @@ -365,9 +370,13 @@ func TestUpdatingVersionCondition(t *testing.T) { r := &NodePoolReconciler{ Client: client, ReleaseProvider: &fakereleaseprovider.FakeReleaseProvider{Version: semver.MustParse("4.18.0").String()}, - ImageMetadataProvider: &fakeimagemetadataprovider.FakeImageMetadataProvider{Result: &dockerv1client.DockerImageConfig{Config: &docker10.DockerConfig{ - Labels: map[string]string{}, - }}}, + ImageMetadataProvider: &fakeimagemetadataprovider.FakeRegistryClientImageMetadataProvider{ + Result: &dockerv1client.DockerImageConfig{ + Config: &docker10.DockerConfig{ + Labels: map[string]string{}, + }, + }, + }, } if tc.machineSetExists { diff --git a/hypershift-operator/controllers/nodepool/haproxy.go b/hypershift-operator/controllers/nodepool/haproxy.go index 4db45165e2..7f4dc6ee0b 100644 --- a/hypershift-operator/controllers/nodepool/haproxy.go +++ b/hypershift-operator/controllers/nodepool/haproxy.go @@ -105,7 +105,7 @@ func (r *NodePoolReconciler) reconcileHAProxyIgnitionConfig(ctx context.Context, } // This provides support for HTTP Proxy on IPv6 scenarios - ipv4, err := util.IsIPv4(hcluster.Spec.Networking.ServiceNetwork[0].CIDR.String()) + ipv4, err := util.IsIPv4CIDR(hcluster.Spec.Networking.ServiceNetwork[0].CIDR.String()) if err != nil { return "", true, fmt.Errorf("error checking the stack in the first ServiceNetworkCIDR %s: %w", hcluster.Spec.Networking.ServiceNetwork[0].CIDR.String(), err) } diff --git a/support/controlplane-component/controlplane-component.go b/support/controlplane-component/controlplane-component.go index 3d7f1b8c37..890661e43e 100644 --- a/support/controlplane-component/controlplane-component.go +++ b/support/controlplane-component/controlplane-component.go @@ -39,6 +39,7 @@ type ControlPlaneContext struct { HCP *hyperv1.HostedControlPlane ReleaseImageProvider imageprovider.ReleaseImageProvider UserReleaseImageProvider imageprovider.ReleaseImageProvider + ImageMetadataProvider util.ImageMetadataProvider InfraStatus infra.InfrastructureStatus SetDefaultSecurityContext bool @@ -57,6 +58,7 @@ type WorkloadContext struct { HCP *hyperv1.HostedControlPlane ReleaseImageProvider imageprovider.ReleaseImageProvider UserReleaseImageProvider imageprovider.ReleaseImageProvider + ImageMetadataProvider util.ImageMetadataProvider InfraStatus infra.InfrastructureStatus SetDefaultSecurityContext bool @@ -75,6 +77,7 @@ func (cp *ControlPlaneContext) workloadContext() WorkloadContext { SetDefaultSecurityContext: cp.SetDefaultSecurityContext, EnableCIDebugOutput: cp.EnableCIDebugOutput, MetricsSet: cp.MetricsSet, + ImageMetadataProvider: cp.ImageMetadataProvider, } } diff --git a/support/globalconfig/network.go b/support/globalconfig/network.go index 5c034f228a..c073a24840 100644 --- a/support/globalconfig/network.go +++ b/support/globalconfig/network.go @@ -32,7 +32,7 @@ func ReconcileNetworkConfig(cfg *configv1.Network, hcp *hyperv1.HostedControlPla for _, entry := range hcp.Spec.Networking.ClusterNetwork { hostPrefix := uint32(entry.HostPrefix) if hostPrefix == 0 { - ipv4, err := util.IsIPv4(entry.CIDR.String()) + ipv4, err := util.IsIPv4CIDR(entry.CIDR.String()) if err != nil { return fmt.Errorf("the CIDR %s included in the cluster network spec is not valid: %w", entry.CIDR.String(), err) } diff --git a/support/util/networking.go b/support/util/networking.go index f46ac92b90..a6609d1a0d 100644 --- a/support/util/networking.go +++ b/support/util/networking.go @@ -117,7 +117,7 @@ func GetAdvertiseAddress(hcp *hyperv1.HostedControlPlane, ipv4DefaultAddress, ip var err error if len(hcp.Spec.Networking.ServiceNetwork) > 0 { - ipv4, err = IsIPv4(hcp.Spec.Networking.ServiceNetwork[0].CIDR.String()) + ipv4, err = IsIPv4CIDR(hcp.Spec.Networking.ServiceNetwork[0].CIDR.String()) } else { ipv4 = true } diff --git a/support/util/util.go b/support/util/util.go index 0a8feabd83..fc076cabd3 100644 --- a/support/util/util.go +++ b/support/util/util.go @@ -291,19 +291,28 @@ func ConvertImageRegistryOverrideStringToMap(envVar string) map[string][]string return imageRegistryOverrides } -// IsIPv4 function parse the CIDR and get the IPNet struct if the IPNet.IP cannot be converted to 4bytes format, -// the function returns nil, if it's an IPv6 it will return nil. -func IsIPv4(cidr string) (bool, error) { - _, ipnet, err := net.ParseCIDR(cidr) +// IsIPv4CIDR checks if the input string is an IPv4 CIDR. +func IsIPv4CIDR(input string) (bool, error) { + _, ipnet, err := net.ParseCIDR(input) if err != nil { - return false, fmt.Errorf("error validating the incoming CIDR %s: %v", cidr, err) + return false, fmt.Errorf("error parsing input '%s': not a valid CIDR", input) } - if ipnet.IP.To4() != nil { return true, nil - } else { - return false, nil } + return false, nil +} + +// IsIPv4Address checks if the input string is an IPv4 address. +func IsIPv4Address(input string) (bool, error) { + ip := net.ParseIP(input) + if ip == nil { + return false, fmt.Errorf("error parsing input '%s': not a valid IP address", input) + } + if ip.To4() != nil { + return true, nil + } + return false, nil } // FirstUsableIP returns the first usable IP in both, IPv4 and IPv6 stacks. diff --git a/support/util/util_test.go b/support/util/util_test.go index 83655dd88e..675983f158 100644 --- a/support/util/util_test.go +++ b/support/util/util_test.go @@ -260,57 +260,6 @@ func testDecompressFuncErr(t *testing.T, payload []byte) { g.Expect(out.String()).To(BeEmpty(), "should be an empty string") } -func TestIsIPv4(t *testing.T) { - type args struct { - cidrs []string - } - tests := []struct { - name string - args args - want bool - wantErr bool - }{ - { - name: "When an ipv4 CIDR is checked by isIPv4, it should return true", - args: args{ - cidrs: []string{"192.168.1.35/24", "0.0.0.0/0", "127.0.0.1/24"}, - }, - want: true, - wantErr: false, - }, - { - name: "When an ipv6 CIDR is checked by isIPv4, it should return false", - args: args{ - cidrs: []string{"2001::/17", "2001:db8::/62", "::/0", "2000::/3"}, - }, - want: false, - wantErr: false, - }, - { - name: "When a non valid CIDR is checked by isIPv4, it should return an error and false", - args: args{ - cidrs: []string{"192.168.35/68"}, - }, - want: false, - wantErr: true, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - for _, cidr := range tt.args.cidrs { - got, err := IsIPv4(cidr) - if (err != nil) != tt.wantErr { - t.Errorf("isIPv4() error = %v, wantErr %v", err, tt.wantErr) - return - } - if got != tt.want { - t.Errorf("isIPv4() = %v, want %v", got, tt.want) - } - } - }) - } -} - func TestFirstUsableIP(t *testing.T) { tests := []struct { name string @@ -740,3 +689,83 @@ func TestDetermineHostedClusterPayloadArch(t *testing.T) { }) } } + +func TestIsIPv4CIDR(t *testing.T) { + tests := []struct { + input string + expected bool + expectError bool + }{ + // Valid IPv4 CIDRs + {"192.168.1.0/24", true, false}, + {"10.0.0.0/8", true, false}, + + // Valid IPv6 CIDRs + {"2001:db8::/32", false, false}, + {"fd00::/8", false, false}, + + // Invalid inputs + {"invalid", false, true}, + {"192.168.1.1/33", false, true}, // Invalid CIDR prefix + {"", false, true}, // Empty input + {"1234::5678::/64", false, true}, // Malformed IP + + // Edge cases + {"0.0.0.0/0", true, false}, + {"255.255.255.255/32", true, false}, + } + + for _, test := range tests { + t.Run(test.input, func(t *testing.T) { + g := NewWithT(t) + result, err := IsIPv4CIDR(test.input) + if test.expectError { + g.Expect(err).To(HaveOccurred(), "Expected an error for input '%s'", test.input) + } else { + g.Expect(err).ToNot(HaveOccurred(), "Did not expect an error for input '%s'", test.input) + } + + g.Expect(result).To(Equal(test.expected), "Unexpected result for input '%s'", test.input) + }) + } +} + +func TestIsIPv4Address(t *testing.T) { + tests := []struct { + input string + expected bool + expectError bool + }{ + // Valid IPv4 addresses + {"192.168.1.1", true, false}, + {"10.0.0.1", true, false}, + + // Valid IPv6 addresses + {"2001:db8::1", false, false}, + {"fd00::1", false, false}, + + // Invalid inputs + {"invalid", false, true}, + {"192.168.1.256", false, true}, // Invalid IPv4 address + {"", false, true}, // Empty input + {"1234::5678::1", false, true}, // Malformed IP + + // Edge cases + {"0.0.0.0", true, false}, + {"255.255.255.255", true, false}, + } + + for _, test := range tests { + t.Run(test.input, func(t *testing.T) { + g := NewWithT(t) + result, err := IsIPv4Address(test.input) + if test.expectError { + g.Expect(err).To(HaveOccurred(), "Expected an error for input '%s'", test.input) + } else { + g.Expect(err).ToNot(HaveOccurred(), "Did not expect an error for input '%s'", test.input) + } + + g.Expect(result).To(Equal(test.expected), "Unexpected result for input '%s'", test.input) + }) + } +} diff --git a/test/e2e/util/util.go b/test/e2e/util/util.go index b2e5523b19..d7a9b41eb7 100644 --- a/test/e2e/util/util.go +++ b/test/e2e/util/util.go @@ -390,12 +390,12 @@ func WaitForImageRollout(t *testing.T, ctx context.Context, client crclient.Clie Status: metav1.ConditionFalse, }), func(hostedCluster *hyperv1.HostedCluster) (done bool, reasons string, err error) { - if wanted, got := image, ptr.Deref(hostedCluster.Status.Version, hyperv1.ClusterVersionStatus{}).Desired.Image; wanted != got { - return false, fmt.Sprintf("wanted HostedCluster to desire image %s, got %s", wanted, got), nil - } if len(ptr.Deref(hostedCluster.Status.Version, hyperv1.ClusterVersionStatus{}).History) == 0 { return false, "HostedCluster has no version history", nil } + if wanted, got := hostedCluster.Status.Version.History[0].Version, ptr.Deref(hostedCluster.Status.Version, hyperv1.ClusterVersionStatus{}).Desired.Version; wanted != got { + return false, fmt.Sprintf("wanted HostedCluster to desired version %s, got %s", wanted, got), nil + } if wanted, got := hostedCluster.Status.Version.Desired.Image, hostedCluster.Status.Version.History[0].Image; wanted != got { return false, fmt.Sprintf("desired image %s doesn't match most recent image in history %s", wanted, got), nil }