From 1e1ac9a9c20c1826ac275644012195c266e2e586 Mon Sep 17 00:00:00 2001 From: Joao Morais Date: Mon, 20 Jul 2026 10:58:51 -0300 Subject: [PATCH] feat: configure HAProxy version selection Configures Hypershift with the new command-line options used to declare the available HAProxy versions in the current release, as well as the default HAProxy version in case it is not provided in the IngressController resource. https://redhat.atlassian.net/browse/NE-2815 --- ...lPlaneComponents_ingress_operator_deployment.yaml | 12 ++++++++++++ ...lPlaneComponents_ingress_operator_deployment.yaml | 12 ++++++++++++ ...lPlaneComponents_ingress_operator_deployment.yaml | 12 ++++++++++++ ...lPlaneComponents_ingress_operator_deployment.yaml | 12 ++++++++++++ ...lPlaneComponents_ingress_operator_deployment.yaml | 12 ++++++++++++ ...lPlaneComponents_ingress_operator_deployment.yaml | 12 ++++++++++++ .../v2/assets/ingress-operator/deployment.yaml | 12 ++++++++++++ .../v2/ingressoperator/deployment.go | 9 +++++++++ 8 files changed, 93 insertions(+) diff --git a/control-plane-operator/controllers/hostedcontrolplane/testdata/ingress-operator/AROSwift/zz_fixture_TestControlPlaneComponents_ingress_operator_deployment.yaml b/control-plane-operator/controllers/hostedcontrolplane/testdata/ingress-operator/AROSwift/zz_fixture_TestControlPlaneComponents_ingress_operator_deployment.yaml index e5c553e336d3..8432c1c0607e 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/testdata/ingress-operator/AROSwift/zz_fixture_TestControlPlaneComponents_ingress_operator_deployment.yaml +++ b/control-plane-operator/controllers/hostedcontrolplane/testdata/ingress-operator/AROSwift/zz_fixture_TestControlPlaneComponents_ingress_operator_deployment.yaml @@ -68,6 +68,12 @@ spec: - openshift-ingress-operator - --image - $(IMAGE) + - --haproxy-image + - 2.8=$(HAPROXY_28_IMAGE) + - --haproxy-image + - 3.2=$(HAPROXY_32_IMAGE) + - --default-haproxy-version + - $(DEFAULT_HAPROXY_VERSION) - --canary-image - $(CANARY_IMAGE) - --release-version @@ -79,6 +85,12 @@ spec: value: 4.18.0 - name: IMAGE value: haproxy-router + - name: HAPROXY_28_IMAGE + value: haproxy-router-haproxy28 + - name: HAPROXY_32_IMAGE + value: haproxy-router-haproxy32 + - name: DEFAULT_HAPROXY_VERSION + value: "3.2" - name: CANARY_IMAGE value: cluster-ingress-operator - name: KUBECONFIG diff --git a/control-plane-operator/controllers/hostedcontrolplane/testdata/ingress-operator/GCP/zz_fixture_TestControlPlaneComponents_ingress_operator_deployment.yaml b/control-plane-operator/controllers/hostedcontrolplane/testdata/ingress-operator/GCP/zz_fixture_TestControlPlaneComponents_ingress_operator_deployment.yaml index 4ffbeb92446f..8e2771e8e094 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/testdata/ingress-operator/GCP/zz_fixture_TestControlPlaneComponents_ingress_operator_deployment.yaml +++ b/control-plane-operator/controllers/hostedcontrolplane/testdata/ingress-operator/GCP/zz_fixture_TestControlPlaneComponents_ingress_operator_deployment.yaml @@ -68,6 +68,12 @@ spec: - openshift-ingress-operator - --image - $(IMAGE) + - --haproxy-image + - 2.8=$(HAPROXY_28_IMAGE) + - --haproxy-image + - 3.2=$(HAPROXY_32_IMAGE) + - --default-haproxy-version + - $(DEFAULT_HAPROXY_VERSION) - --canary-image - $(CANARY_IMAGE) - --release-version @@ -79,6 +85,12 @@ spec: value: 4.18.0 - name: IMAGE value: haproxy-router + - name: HAPROXY_28_IMAGE + value: haproxy-router-haproxy28 + - name: HAPROXY_32_IMAGE + value: haproxy-router-haproxy32 + - name: DEFAULT_HAPROXY_VERSION + value: "3.2" - name: CANARY_IMAGE value: cluster-ingress-operator - name: KUBECONFIG diff --git a/control-plane-operator/controllers/hostedcontrolplane/testdata/ingress-operator/IBMCloud/zz_fixture_TestControlPlaneComponents_ingress_operator_deployment.yaml b/control-plane-operator/controllers/hostedcontrolplane/testdata/ingress-operator/IBMCloud/zz_fixture_TestControlPlaneComponents_ingress_operator_deployment.yaml index 258ac5ba9c73..d7fcb412a5ea 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/testdata/ingress-operator/IBMCloud/zz_fixture_TestControlPlaneComponents_ingress_operator_deployment.yaml +++ b/control-plane-operator/controllers/hostedcontrolplane/testdata/ingress-operator/IBMCloud/zz_fixture_TestControlPlaneComponents_ingress_operator_deployment.yaml @@ -68,6 +68,12 @@ spec: - openshift-ingress-operator - --image - $(IMAGE) + - --haproxy-image + - 2.8=$(HAPROXY_28_IMAGE) + - --haproxy-image + - 3.2=$(HAPROXY_32_IMAGE) + - --default-haproxy-version + - $(DEFAULT_HAPROXY_VERSION) - --canary-image - $(CANARY_IMAGE) - --release-version @@ -79,6 +85,12 @@ spec: value: 4.18.0 - name: IMAGE value: haproxy-router + - name: HAPROXY_28_IMAGE + value: haproxy-router-haproxy28 + - name: HAPROXY_32_IMAGE + value: haproxy-router-haproxy32 + - name: DEFAULT_HAPROXY_VERSION + value: "3.2" - name: CANARY_IMAGE value: cluster-ingress-operator - name: KUBECONFIG diff --git a/control-plane-operator/controllers/hostedcontrolplane/testdata/ingress-operator/ModernTLS/zz_fixture_TestControlPlaneComponents_ingress_operator_deployment.yaml b/control-plane-operator/controllers/hostedcontrolplane/testdata/ingress-operator/ModernTLS/zz_fixture_TestControlPlaneComponents_ingress_operator_deployment.yaml index 20270519640a..27adb8312862 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/testdata/ingress-operator/ModernTLS/zz_fixture_TestControlPlaneComponents_ingress_operator_deployment.yaml +++ b/control-plane-operator/controllers/hostedcontrolplane/testdata/ingress-operator/ModernTLS/zz_fixture_TestControlPlaneComponents_ingress_operator_deployment.yaml @@ -68,6 +68,12 @@ spec: - openshift-ingress-operator - --image - $(IMAGE) + - --haproxy-image + - 2.8=$(HAPROXY_28_IMAGE) + - --haproxy-image + - 3.2=$(HAPROXY_32_IMAGE) + - --default-haproxy-version + - $(DEFAULT_HAPROXY_VERSION) - --canary-image - $(CANARY_IMAGE) - --release-version @@ -79,6 +85,12 @@ spec: value: 4.18.0 - name: IMAGE value: haproxy-router + - name: HAPROXY_28_IMAGE + value: haproxy-router-haproxy28 + - name: HAPROXY_32_IMAGE + value: haproxy-router-haproxy32 + - name: DEFAULT_HAPROXY_VERSION + value: "3.2" - name: CANARY_IMAGE value: cluster-ingress-operator - name: KUBECONFIG diff --git a/control-plane-operator/controllers/hostedcontrolplane/testdata/ingress-operator/TechPreviewNoUpgrade/zz_fixture_TestControlPlaneComponents_ingress_operator_deployment.yaml b/control-plane-operator/controllers/hostedcontrolplane/testdata/ingress-operator/TechPreviewNoUpgrade/zz_fixture_TestControlPlaneComponents_ingress_operator_deployment.yaml index 20270519640a..27adb8312862 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/testdata/ingress-operator/TechPreviewNoUpgrade/zz_fixture_TestControlPlaneComponents_ingress_operator_deployment.yaml +++ b/control-plane-operator/controllers/hostedcontrolplane/testdata/ingress-operator/TechPreviewNoUpgrade/zz_fixture_TestControlPlaneComponents_ingress_operator_deployment.yaml @@ -68,6 +68,12 @@ spec: - openshift-ingress-operator - --image - $(IMAGE) + - --haproxy-image + - 2.8=$(HAPROXY_28_IMAGE) + - --haproxy-image + - 3.2=$(HAPROXY_32_IMAGE) + - --default-haproxy-version + - $(DEFAULT_HAPROXY_VERSION) - --canary-image - $(CANARY_IMAGE) - --release-version @@ -79,6 +85,12 @@ spec: value: 4.18.0 - name: IMAGE value: haproxy-router + - name: HAPROXY_28_IMAGE + value: haproxy-router-haproxy28 + - name: HAPROXY_32_IMAGE + value: haproxy-router-haproxy32 + - name: DEFAULT_HAPROXY_VERSION + value: "3.2" - name: CANARY_IMAGE value: cluster-ingress-operator - name: KUBECONFIG diff --git a/control-plane-operator/controllers/hostedcontrolplane/testdata/ingress-operator/zz_fixture_TestControlPlaneComponents_ingress_operator_deployment.yaml b/control-plane-operator/controllers/hostedcontrolplane/testdata/ingress-operator/zz_fixture_TestControlPlaneComponents_ingress_operator_deployment.yaml index 20270519640a..27adb8312862 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/testdata/ingress-operator/zz_fixture_TestControlPlaneComponents_ingress_operator_deployment.yaml +++ b/control-plane-operator/controllers/hostedcontrolplane/testdata/ingress-operator/zz_fixture_TestControlPlaneComponents_ingress_operator_deployment.yaml @@ -68,6 +68,12 @@ spec: - openshift-ingress-operator - --image - $(IMAGE) + - --haproxy-image + - 2.8=$(HAPROXY_28_IMAGE) + - --haproxy-image + - 3.2=$(HAPROXY_32_IMAGE) + - --default-haproxy-version + - $(DEFAULT_HAPROXY_VERSION) - --canary-image - $(CANARY_IMAGE) - --release-version @@ -79,6 +85,12 @@ spec: value: 4.18.0 - name: IMAGE value: haproxy-router + - name: HAPROXY_28_IMAGE + value: haproxy-router-haproxy28 + - name: HAPROXY_32_IMAGE + value: haproxy-router-haproxy32 + - name: DEFAULT_HAPROXY_VERSION + value: "3.2" - name: CANARY_IMAGE value: cluster-ingress-operator - name: KUBECONFIG diff --git a/control-plane-operator/controllers/hostedcontrolplane/v2/assets/ingress-operator/deployment.yaml b/control-plane-operator/controllers/hostedcontrolplane/v2/assets/ingress-operator/deployment.yaml index 1c23aef7958d..f0670159a7d4 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/v2/assets/ingress-operator/deployment.yaml +++ b/control-plane-operator/controllers/hostedcontrolplane/v2/assets/ingress-operator/deployment.yaml @@ -26,6 +26,12 @@ spec: - openshift-ingress-operator - --image - $(IMAGE) + - --haproxy-image + - 2.8=$(HAPROXY_28_IMAGE) + - --haproxy-image + - 3.2=$(HAPROXY_32_IMAGE) + - --default-haproxy-version + - $(DEFAULT_HAPROXY_VERSION) - --canary-image - $(CANARY_IMAGE) - --release-version @@ -37,6 +43,12 @@ spec: value: "" - name: IMAGE value: "" + - name: HAPROXY_28_IMAGE + value: "" + - name: HAPROXY_32_IMAGE + value: "" + - name: DEFAULT_HAPROXY_VERSION + value: "" - name: CANARY_IMAGE value: "" - name: KUBECONFIG diff --git a/control-plane-operator/controllers/hostedcontrolplane/v2/ingressoperator/deployment.go b/control-plane-operator/controllers/hostedcontrolplane/v2/ingressoperator/deployment.go index 74c97a55ddb9..ecc9c5e1fc87 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/v2/ingressoperator/deployment.go +++ b/control-plane-operator/controllers/hostedcontrolplane/v2/ingressoperator/deployment.go @@ -18,6 +18,15 @@ func adaptDeployment(cpContext component.WorkloadContext, deployment *appsv1.Dep podspec.UpsertEnvVar(c, corev1.EnvVar{ Name: "IMAGE", Value: cpContext.UserReleaseImageProvider.GetImage("haproxy-router"), }) + podspec.UpsertEnvVar(c, corev1.EnvVar{ + Name: "HAPROXY_28_IMAGE", Value: cpContext.UserReleaseImageProvider.GetImage("haproxy-router-haproxy28"), + }) + podspec.UpsertEnvVar(c, corev1.EnvVar{ + Name: "HAPROXY_32_IMAGE", Value: cpContext.UserReleaseImageProvider.GetImage("haproxy-router-haproxy32"), + }) + podspec.UpsertEnvVar(c, corev1.EnvVar{ + Name: "DEFAULT_HAPROXY_VERSION", Value: "3.2", + }) podspec.UpsertEnvVar(c, corev1.EnvVar{ Name: "CANARY_IMAGE", Value: cpContext.UserReleaseImageProvider.GetImage("cluster-ingress-operator"), })