From fb7da889ad88aec891f61658fe125a4595d64064 Mon Sep 17 00:00:00 2001 From: Vincent Link Date: Mon, 3 Aug 2026 14:13:09 +0200 Subject: [PATCH 1/5] AUTOSCALE-543: Add lint and e2e tests for kedacore-http-add-on Add CI test configuration for the HTTP add-on: a lint presubmit using the golangci-lint CI image, and an e2e test on AWS that installs KEDA via Helm, deploys the http-add-on from CI-built images, and runs the default profile tests. Changes: - Add grpc-echo test image build - Add golangci-lint base image and lint presubmit test - Add http-addon-e2e-aws inline multi-stage test (setup/run/clean) Signed-off-by: Vincent Link --- .../openshift-kedacore-http-add-on-main.yaml | 52 +++++- ...kedacore-http-add-on-main-postsubmits.yaml | 2 +- ...-kedacore-http-add-on-main-presubmits.yaml | 157 +++++++++++++++++- 3 files changed, 208 insertions(+), 3 deletions(-) diff --git a/ci-operator/config/openshift/kedacore-http-add-on/openshift-kedacore-http-add-on-main.yaml b/ci-operator/config/openshift/kedacore-http-add-on/openshift-kedacore-http-add-on-main.yaml index 84b4ccacf7586..58b4cbe92a6f9 100644 --- a/ci-operator/config/openshift/kedacore-http-add-on/openshift-kedacore-http-add-on-main.yaml +++ b/ci-operator/config/openshift/kedacore-http-add-on/openshift-kedacore-http-add-on-main.yaml @@ -5,7 +5,10 @@ base_images: tag: base binary_build_commands: make build build_root: - from_repository: true + image_stream_tag: + name: release + namespace: openshift + tag: rhel-9-release-golang-1.26-openshift-5.0 images: items: - build_args: @@ -26,6 +29,9 @@ images: dockerfile_path: scaler/Dockerfile from: base to: custom-metrics-autoscaler-http-add-on-scaler + - dockerfile_path: test/images/grpc-echo/Dockerfile + from: base + to: custom-metrics-autoscaler-http-add-on-grpc-echo promotion: to: - name: "5.0" @@ -48,6 +54,50 @@ resources: cpu: 100m memory: 200Mi test_binary_build_commands: make test +tests: +- as: lint + commands: GOFLAGS="" make lint + container: + from: src + skip_if_only_changed: ^docs/|^\.github|\.md$|^(?:.*/)?(?:\.gitignore|OWNERS|OWNERS_ALIASES|PROJECT|LICENSE)$ +- as: http-addon-e2e-aws + skip_if_only_changed: ^docs/|^\.github|\.md$|^(?:.*/)?(?:\.gitignore|OWNERS|OWNERS_ALIASES|PROJECT|LICENSE)$ + steps: + cluster_profile: openshift-org-aws + post: + - as: e2e-clean + cli: latest + commands: GOFLAGS="" make e2e-test-openshift-clean + from: src + resources: + requests: + cpu: 100m + test: + - as: e2e-setup + cli: latest + commands: GOFLAGS="" make e2e-test-openshift-setup + dependencies: + - env: IMAGE_HTTP_ADDON_OPERATOR + name: custom-metrics-autoscaler-http-add-on-operator + - env: IMAGE_HTTP_ADDON_INTERCEPTOR + name: custom-metrics-autoscaler-http-add-on-interceptor + - env: IMAGE_HTTP_ADDON_SCALER + name: custom-metrics-autoscaler-http-add-on-scaler + from: src + resources: + requests: + cpu: 100m + - as: e2e-run + cli: latest + commands: make e2e-test-openshift + dependencies: + - env: IMAGE_GRPC_ECHO + name: custom-metrics-autoscaler-http-add-on-grpc-echo + from: src + resources: + requests: + cpu: 100m + workflow: ipi-aws zz_generated_metadata: branch: main org: openshift diff --git a/ci-operator/jobs/openshift/kedacore-http-add-on/openshift-kedacore-http-add-on-main-postsubmits.yaml b/ci-operator/jobs/openshift/kedacore-http-add-on/openshift-kedacore-http-add-on-main-postsubmits.yaml index 78923691fdaac..9d15d14c28aec 100644 --- a/ci-operator/jobs/openshift/kedacore-http-add-on/openshift-kedacore-http-add-on-main-postsubmits.yaml +++ b/ci-operator/jobs/openshift/kedacore-http-add-on/openshift-kedacore-http-add-on-main-postsubmits.yaml @@ -8,10 +8,10 @@ postsubmits: decorate: true decoration_config: sparse_checkout_files: - - .ci-operator.yaml - interceptor/Dockerfile - operator/Dockerfile - scaler/Dockerfile + - test/images/grpc-echo/Dockerfile labels: ci-operator.openshift.io/is-promotion: "true" ci.openshift.io/generator: prowgen diff --git a/ci-operator/jobs/openshift/kedacore-http-add-on/openshift-kedacore-http-add-on-main-presubmits.yaml b/ci-operator/jobs/openshift/kedacore-http-add-on/openshift-kedacore-http-add-on-main-presubmits.yaml index 3c95ae51db5c0..8d48933d3b73d 100644 --- a/ci-operator/jobs/openshift/kedacore-http-add-on/openshift-kedacore-http-add-on-main-presubmits.yaml +++ b/ci-operator/jobs/openshift/kedacore-http-add-on/openshift-kedacore-http-add-on-main-presubmits.yaml @@ -1,5 +1,92 @@ presubmits: openshift/kedacore-http-add-on: + - agent: kubernetes + always_run: false + branches: + - ^main$ + - ^main- + cluster: build06 + context: ci/prow/http-addon-e2e-aws + decorate: true + decoration_config: + sparse_checkout_files: + - interceptor/Dockerfile + - operator/Dockerfile + - scaler/Dockerfile + - test/images/grpc-echo/Dockerfile + labels: + ci-operator.openshift.io/cloud: aws + ci-operator.openshift.io/cloud-cluster-profile: openshift-org-aws + ci.openshift.io/generator: prowgen + pj-rehearse.openshift.io/can-be-rehearsed: "true" + name: pull-ci-openshift-kedacore-http-add-on-main-http-addon-e2e-aws + rerun_command: /test http-addon-e2e-aws + skip_if_only_changed: ^docs/|^\.github|\.md$|^(?:.*/)?(?:\.gitignore|OWNERS|OWNERS_ALIASES|PROJECT|LICENSE)$ + spec: + containers: + - args: + - --gcs-upload-secret=/secrets/gcs/service-account.json + - --image-import-pull-secret=/etc/pull-secret/.dockerconfigjson + - --lease-server-credentials-file=/etc/boskos/credentials + - --report-credentials-file=/etc/report/credentials + - --secret-dir=/secrets/ci-pull-credentials + - --target=http-addon-e2e-aws + command: + - ci-operator + env: + - name: HTTP_SERVER_IP + valueFrom: + fieldRef: + fieldPath: status.podIP + image: quay-proxy.ci.openshift.org/openshift/ci:ci_ci-operator_latest + imagePullPolicy: Always + name: "" + ports: + - containerPort: 8080 + name: http + resources: + requests: + cpu: 10m + volumeMounts: + - mountPath: /etc/boskos + name: boskos + readOnly: true + - mountPath: /secrets/ci-pull-credentials + name: ci-pull-credentials + readOnly: true + - mountPath: /secrets/gcs + name: gcs-credentials + readOnly: true + - mountPath: /secrets/manifest-tool + name: manifest-tool-local-pusher + readOnly: true + - mountPath: /etc/pull-secret + name: pull-secret + readOnly: true + - mountPath: /etc/report + name: result-aggregator + readOnly: true + serviceAccountName: ci-operator + volumes: + - name: boskos + secret: + items: + - key: credentials + path: credentials + secretName: boskos-credentials + - name: ci-pull-credentials + secret: + secretName: ci-pull-credentials + - name: manifest-tool-local-pusher + secret: + secretName: manifest-tool-local-pusher + - name: pull-secret + secret: + secretName: registry-pull-credentials + - name: result-aggregator + secret: + secretName: result-aggregator + trigger: (?m)^/test( | .* )http-addon-e2e-aws,?($|\s.*) - agent: kubernetes always_run: true branches: @@ -10,10 +97,10 @@ presubmits: decorate: true decoration_config: sparse_checkout_files: - - .ci-operator.yaml - interceptor/Dockerfile - operator/Dockerfile - scaler/Dockerfile + - test/images/grpc-echo/Dockerfile labels: ci.openshift.io/generator: prowgen pj-rehearse.openshift.io/can-be-rehearsed: "true" @@ -60,3 +147,71 @@ presubmits: secret: secretName: result-aggregator trigger: (?m)^/test( | .* )images,?($|\s.*) + - agent: kubernetes + always_run: false + branches: + - ^main$ + - ^main- + cluster: build04 + context: ci/prow/lint + decorate: true + decoration_config: + sparse_checkout_files: + - interceptor/Dockerfile + - operator/Dockerfile + - scaler/Dockerfile + - test/images/grpc-echo/Dockerfile + labels: + ci.openshift.io/generator: prowgen + pj-rehearse.openshift.io/can-be-rehearsed: "true" + name: pull-ci-openshift-kedacore-http-add-on-main-lint + rerun_command: /test lint + skip_if_only_changed: ^docs/|^\.github|\.md$|^(?:.*/)?(?:\.gitignore|OWNERS|OWNERS_ALIASES|PROJECT|LICENSE)$ + spec: + containers: + - args: + - --gcs-upload-secret=/secrets/gcs/service-account.json + - --image-import-pull-secret=/etc/pull-secret/.dockerconfigjson + - --report-credentials-file=/etc/report/credentials + - --target=lint + command: + - ci-operator + env: + - name: HTTP_SERVER_IP + valueFrom: + fieldRef: + fieldPath: status.podIP + image: quay-proxy.ci.openshift.org/openshift/ci:ci_ci-operator_latest + imagePullPolicy: Always + name: "" + ports: + - containerPort: 8080 + name: http + resources: + requests: + cpu: 10m + volumeMounts: + - mountPath: /secrets/gcs + name: gcs-credentials + readOnly: true + - mountPath: /secrets/manifest-tool + name: manifest-tool-local-pusher + readOnly: true + - mountPath: /etc/pull-secret + name: pull-secret + readOnly: true + - mountPath: /etc/report + name: result-aggregator + readOnly: true + serviceAccountName: ci-operator + volumes: + - name: manifest-tool-local-pusher + secret: + secretName: manifest-tool-local-pusher + - name: pull-secret + secret: + secretName: registry-pull-credentials + - name: result-aggregator + secret: + secretName: result-aggregator + trigger: (?m)^/test( | .* )lint,?($|\s.*) From 0f4266eacebf84673c149c7a836b27d61a441db3 Mon Sep 17 00:00:00 2001 From: Vincent Link Date: Fri, 7 Aug 2026 22:15:37 +0200 Subject: [PATCH 2/5] fixup: add ipi-aws-post, send-results-to-reportportal, GOLANGCI_LINT_CACHE Signed-off-by: Vincent Link --- .../openshift-kedacore-http-add-on-main.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ci-operator/config/openshift/kedacore-http-add-on/openshift-kedacore-http-add-on-main.yaml b/ci-operator/config/openshift/kedacore-http-add-on/openshift-kedacore-http-add-on-main.yaml index 58b4cbe92a6f9..3b5e1efb05cf5 100644 --- a/ci-operator/config/openshift/kedacore-http-add-on/openshift-kedacore-http-add-on-main.yaml +++ b/ci-operator/config/openshift/kedacore-http-add-on/openshift-kedacore-http-add-on-main.yaml @@ -56,7 +56,7 @@ resources: test_binary_build_commands: make test tests: - as: lint - commands: GOFLAGS="" make lint + commands: GOFLAGS="" GOLANGCI_LINT_CACHE=/tmp/golangci-lint-cache make lint container: from: src skip_if_only_changed: ^docs/|^\.github|\.md$|^(?:.*/)?(?:\.gitignore|OWNERS|OWNERS_ALIASES|PROJECT|LICENSE)$ @@ -72,6 +72,8 @@ tests: resources: requests: cpu: 100m + - chain: ipi-aws-post + - ref: send-results-to-reportportal test: - as: e2e-setup cli: latest From 16c46bf0d7cf6eeeffa5ed7af8a3c84f4250fba9 Mon Sep 17 00:00:00 2001 From: Vincent Link Date: Mon, 10 Aug 2026 12:01:00 +0200 Subject: [PATCH 3/5] fixup: add gather-keda-namespace post step for diagnostics --- .../openshift-kedacore-http-add-on-main.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ci-operator/config/openshift/kedacore-http-add-on/openshift-kedacore-http-add-on-main.yaml b/ci-operator/config/openshift/kedacore-http-add-on/openshift-kedacore-http-add-on-main.yaml index 3b5e1efb05cf5..d2098e9921d06 100644 --- a/ci-operator/config/openshift/kedacore-http-add-on/openshift-kedacore-http-add-on-main.yaml +++ b/ci-operator/config/openshift/kedacore-http-add-on/openshift-kedacore-http-add-on-main.yaml @@ -65,6 +65,18 @@ tests: steps: cluster_profile: openshift-org-aws post: + - as: gather-keda-namespace + cli: latest + commands: | + echo "=== keda pods ===" && oc get pods -n keda -o wide || true + echo "=== operator describe ===" && oc describe pods -n keda -l app.kubernetes.io/instance=operator || true + echo "=== operator logs (current) ===" && oc logs -n keda -l app.kubernetes.io/instance=operator 2>/dev/null || true + echo "=== operator logs (previous) ===" && oc logs -n keda -l app.kubernetes.io/instance=operator --previous 2>/dev/null || true + echo "=== keda events ===" && oc get events -n keda --sort-by='.lastTimestamp' | tail -50 || true + from: src + resources: + requests: + cpu: 100m - as: e2e-clean cli: latest commands: GOFLAGS="" make e2e-test-openshift-clean From 9eaf6f65e569d1f3cba077b6d414a3f8b2d55fc1 Mon Sep 17 00:00:00 2001 From: Vincent Link Date: Mon, 10 Aug 2026 12:12:24 +0200 Subject: [PATCH 4/5] tmp: use inline OCP Dockerfiles with CGO_ENABLED=0 for image builds --- .../openshift-kedacore-http-add-on-main.yaml | 50 +++++++++++++------ ...kedacore-http-add-on-main-postsubmits.yaml | 3 -- ...-kedacore-http-add-on-main-presubmits.yaml | 9 ---- 3 files changed, 34 insertions(+), 28 deletions(-) diff --git a/ci-operator/config/openshift/kedacore-http-add-on/openshift-kedacore-http-add-on-main.yaml b/ci-operator/config/openshift/kedacore-http-add-on/openshift-kedacore-http-add-on-main.yaml index d2098e9921d06..73a532d19eee5 100644 --- a/ci-operator/config/openshift/kedacore-http-add-on/openshift-kedacore-http-add-on-main.yaml +++ b/ci-operator/config/openshift/kedacore-http-add-on/openshift-kedacore-http-add-on-main.yaml @@ -2,7 +2,7 @@ base_images: base: name: "5.0" namespace: ocp - tag: base + tag: base-rhel9 binary_build_commands: make build build_root: image_stream_tag: @@ -11,23 +11,41 @@ build_root: tag: rhel-9-release-golang-1.26-openshift-5.0 images: items: - - build_args: - - name: GIT_COMMIT - value: dummy-ci-commit-value - dockerfile_path: operator/Dockerfile - from: base + - dockerfile_literal: | + FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.26-openshift-5.0 AS builder + ARG GIT_COMMIT=HEAD + WORKDIR /workspace + COPY . . + RUN CGO_ENABLED=0 go build -mod=vendor \ + -ldflags "-X github.com/kedacore/http-add-on/pkg/build.version=ci -X github.com/kedacore/http-add-on/pkg/build.gitCommit=${GIT_COMMIT}" \ + -o bin/operator ./operator + FROM registry.ci.openshift.org/ocp/5.0:base-rhel9 + COPY --from=builder /workspace/bin/operator /usr/bin/ + ENTRYPOINT ["/usr/bin/operator"] to: custom-metrics-autoscaler-http-add-on-operator - - build_args: - - name: GIT_COMMIT - value: dummy-ci-commit-value - dockerfile_path: interceptor/Dockerfile - from: base + - dockerfile_literal: | + FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.26-openshift-5.0 AS builder + ARG GIT_COMMIT=HEAD + WORKDIR /workspace + COPY . . + RUN CGO_ENABLED=0 go build -mod=vendor \ + -ldflags "-X github.com/kedacore/http-add-on/pkg/build.version=ci -X github.com/kedacore/http-add-on/pkg/build.gitCommit=${GIT_COMMIT}" \ + -o bin/interceptor ./interceptor + FROM registry.ci.openshift.org/ocp/5.0:base-rhel9 + COPY --from=builder /workspace/bin/interceptor /usr/bin/ + ENTRYPOINT ["/usr/bin/interceptor"] to: custom-metrics-autoscaler-http-add-on-interceptor - - build_args: - - name: GIT_COMMIT - value: dummy-ci-commit-value - dockerfile_path: scaler/Dockerfile - from: base + - dockerfile_literal: | + FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.26-openshift-5.0 AS builder + ARG GIT_COMMIT=HEAD + WORKDIR /workspace + COPY . . + RUN CGO_ENABLED=0 go build -mod=vendor \ + -ldflags "-X github.com/kedacore/http-add-on/pkg/build.version=ci -X github.com/kedacore/http-add-on/pkg/build.gitCommit=${GIT_COMMIT}" \ + -o bin/scaler ./scaler + FROM registry.ci.openshift.org/ocp/5.0:base-rhel9 + COPY --from=builder /workspace/bin/scaler /usr/bin/ + ENTRYPOINT ["/usr/bin/scaler"] to: custom-metrics-autoscaler-http-add-on-scaler - dockerfile_path: test/images/grpc-echo/Dockerfile from: base diff --git a/ci-operator/jobs/openshift/kedacore-http-add-on/openshift-kedacore-http-add-on-main-postsubmits.yaml b/ci-operator/jobs/openshift/kedacore-http-add-on/openshift-kedacore-http-add-on-main-postsubmits.yaml index 9d15d14c28aec..6180ec0a3626b 100644 --- a/ci-operator/jobs/openshift/kedacore-http-add-on/openshift-kedacore-http-add-on-main-postsubmits.yaml +++ b/ci-operator/jobs/openshift/kedacore-http-add-on/openshift-kedacore-http-add-on-main-postsubmits.yaml @@ -8,9 +8,6 @@ postsubmits: decorate: true decoration_config: sparse_checkout_files: - - interceptor/Dockerfile - - operator/Dockerfile - - scaler/Dockerfile - test/images/grpc-echo/Dockerfile labels: ci-operator.openshift.io/is-promotion: "true" diff --git a/ci-operator/jobs/openshift/kedacore-http-add-on/openshift-kedacore-http-add-on-main-presubmits.yaml b/ci-operator/jobs/openshift/kedacore-http-add-on/openshift-kedacore-http-add-on-main-presubmits.yaml index 8d48933d3b73d..52d62375c0a6c 100644 --- a/ci-operator/jobs/openshift/kedacore-http-add-on/openshift-kedacore-http-add-on-main-presubmits.yaml +++ b/ci-operator/jobs/openshift/kedacore-http-add-on/openshift-kedacore-http-add-on-main-presubmits.yaml @@ -10,9 +10,6 @@ presubmits: decorate: true decoration_config: sparse_checkout_files: - - interceptor/Dockerfile - - operator/Dockerfile - - scaler/Dockerfile - test/images/grpc-echo/Dockerfile labels: ci-operator.openshift.io/cloud: aws @@ -97,9 +94,6 @@ presubmits: decorate: true decoration_config: sparse_checkout_files: - - interceptor/Dockerfile - - operator/Dockerfile - - scaler/Dockerfile - test/images/grpc-echo/Dockerfile labels: ci.openshift.io/generator: prowgen @@ -157,9 +151,6 @@ presubmits: decorate: true decoration_config: sparse_checkout_files: - - interceptor/Dockerfile - - operator/Dockerfile - - scaler/Dockerfile - test/images/grpc-echo/Dockerfile labels: ci.openshift.io/generator: prowgen From 58b3efba5f433406a7ba438b4adc2a724aa60060 Mon Sep 17 00:00:00 2001 From: Vincent Link Date: Mon, 10 Aug 2026 16:24:58 +0200 Subject: [PATCH 5/5] fixup: label keda namespace privileged for e2e tests --- .../openshift-kedacore-http-add-on-main.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ci-operator/config/openshift/kedacore-http-add-on/openshift-kedacore-http-add-on-main.yaml b/ci-operator/config/openshift/kedacore-http-add-on/openshift-kedacore-http-add-on-main.yaml index 73a532d19eee5..7555e8cb3dab0 100644 --- a/ci-operator/config/openshift/kedacore-http-add-on/openshift-kedacore-http-add-on-main.yaml +++ b/ci-operator/config/openshift/kedacore-http-add-on/openshift-kedacore-http-add-on-main.yaml @@ -107,7 +107,11 @@ tests: test: - as: e2e-setup cli: latest - commands: GOFLAGS="" make e2e-test-openshift-setup + commands: | + oc label --overwrite ns keda \ + security.openshift.io/scc.podSecurityLabelSync=false \ + pod-security.kubernetes.io/enforce=privileged + GOFLAGS="" make e2e-test-openshift-setup dependencies: - env: IMAGE_HTTP_ADDON_OPERATOR name: custom-metrics-autoscaler-http-add-on-operator