Skip to content

fix: resolve oauth-proxy image from cluster release payload for multi-arch support - #2190

Merged
tolusha merged 3 commits into
eclipse-che:mainfrom
swapnilsingh-ibm:fix/s390x-oauth-proxy-dynamic-image
Sep 18, 2026
Merged

tolusha merged 3 commits into
eclipse-che:mainfrom
swapnilsingh-ibm:fix/s390x-oauth-proxy-dynamic-image

Conversation

@swapnilsingh-ibm

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes che-gateway deployment on OpenShift on IBM Z (s390x) where the oauth-proxy sidecar enters ImagePullBackOff because quay.io/openshift/origin-oauth-proxy:4.22(hardcoded as RELATED_IMAGE_gateway_authentication_sidecar) carries only a linux/amd64 manifest, making Che undeployable on s390x OpenShift.

The operator now resolves the oauth-proxy image dynamically at CheCluster reconciliation time from the cluster's own openshift/oauth-proxy ImageStream (namespace openshift). This ImageStream is managed by the Cluster Version Operator and always carries an architecture-native, digest-pinned image from the cluster's release payload — accessible from any pod via the node-level global pull secret without additional configuration.

Falls back to RELATED_IMAGE_gateway_authentication_sidecar when the ImageStream is unavailable, preserving existing behaviour for non-OCP environments. No RBAC changes required — the operator's ClusterRole already has image.openshift.io/imagestreams: get, list. Also extends build/scripts/olm/release-catalog.sh to produce linux/s390x and linux/ppc64le manifests for the OLM catalog image.

Screenshot/screencast of this PR

See attached screenshots:

  1. che-gateway reaching 4/4 Running on s390x
1
  1. All pods healthy in eclipse-che namespace
2
  1. oauth-proxy container image resolved from cluster release payload
3
  1. Operator log confirming dynamic image resolution
4
  1. All gateway unit tests passing
5

What issues does this PR fix or reference?

Fixes eclipse-che/che#23895

How to test this PR?

Deploy the operator on an OpenShift cluster running on a non-amd64 architecture (s390x, ppc64le, or arm64):

OpenShift

oc create namespace devworkspace-controller
oc apply --server-side -f https://raw.githubusercontent.com/devfile/devworkspace-operator/refs/heads/main/deploy/deployment/openshift/combined.yaml

OPERATOR_IMAGE=<...>
sed 's|quay.io/eclipse/che-operator:next|'${OPERATOR_IMAGE}'|g' \
  deploy/deployment/openshift/combined.yaml | oc apply --server-side -f -

oc apply --server-side -f deploy/deployment/openshift/org_v2_checluster.yaml
oc wait checluster eclipse-che -n eclipse-che \
  --for=jsonpath='.status.chePhase'=Active --timeout=120s

Verify:

  • Must show quay.io/openshift-release-dev/... not quay.io/openshift/origin-oauth-proxy:4.22
oc get deployment che-gateway -n eclipse-che \
  -o jsonpath='{.spec.template.spec.containers[?(@.name=="oauth-proxy")].image}'
  • Must show 4/4 Running
oc get pods -n eclipse-che -l app=che-gateway

Common Test Scenarios

  • Deploy Eclipse Che — verified on OpenShift 4.22 on IBM Z (s390x)
  • Start an empty workspace
  • Open terminal and build/run an image
  • Stop a workspace
  • Check operator logs for reconciliation errors or infinite reconciliation loops

PR Checklist

As the author of this Pull Request I made sure that:

Reviewers

Reviewers, please comment how you tested the PR when approving it.

@openshift-ci

openshift-ci Bot commented Sep 3, 2026

Copy link
Copy Markdown

Hi @swapnilsingh-ibm. Thanks for your PR.

I'm waiting for a eclipse-che member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@tolusha

tolusha commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

@swapnilsingh-ibm
Thank you for contribution. I will take a look

Comment thread pkg/deploy/gateway/oauth_proxy.go Resolved
Comment thread pkg/deploy/gateway/oauth_proxy.go Resolved
…-arch support

quay.io/openshift/origin-oauth-proxy has no s390x manifest, blocking Che
deployment on OpenShift on IBM Z. Resolve the oauth-proxy image dynamically
from the cluster's openshift/oauth-proxy ImageStream at reconciliation time.

The ImageStream is managed by the Cluster Version Operator and always carries
an architecture-native, digest-pinned reference from the cluster's own release
payload, accessible from any pod via the node-level global pull secret without
additional configuration.

Falls back to RELATED_IMAGE_gateway_authentication_sidecar when the ImageStream
is unavailable, preserving existing behaviour for non-OCP environments.

Also extends the OLM catalog build script to produce linux/s390x and linux/ppc64le
manifests so the CatalogSource pod can run on those architectures.

Fixes: eclipse-che/che#23895
Prefer the internal OCP registry reference (status.dockerImageRepository@digest)
over the source image reference when resolving the oauth-proxy image. The internal
registry is accessible in all OCP clusters including disconnected environments
where quay.io/openshift-release-dev is not reachable.

Guard the dynamic resolution with GetCheFlavor() == "che" so downstream builds
are not affected.
@swapnilsingh-ibm
swapnilsingh-ibm force-pushed the fix/s390x-oauth-proxy-dynamic-image branch from c9f5751 to ce604e6 Compare September 16, 2026 07:30
Comment thread pkg/deploy/gateway/oauth_proxy.go Resolved
Remove the dockerImageReference fallback to avoid returning a public image
that would fail to pull in disconnected clusters. The function now exclusively
uses the internal registry reference (status.dockerImageRepository@digest)
which is accessible in all OCP environments. Returns empty string when the
reference cannot be constructed so the caller falls back to the operator default.
@tolusha tolusha changed the title fix: resolve oauth-proxy image from cluster release payload for multi-arch support fix: resolve oauth-proxy image from cluster release payload for multi-arch support Sep 17, 2026
@tolusha

tolusha commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

/che-ai-assistant ok-pr-review

Task completed.

@tolusha tolusha left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Automated review - resolving oauth-proxy from the cluster ImageStream

Thanks for iterating on this. The three earlier threads (internal registry reference, flavor guard, no public-image fallback) all look properly addressed in edaf643e and ce604e6d, and the approach is a genuine improvement over shipping an amd64-only sidecar reference on s390x. RBAC is already in place: config/rbac/cluster_role.yaml:165 grants get, list on image.openshift.io/imagestreams, so the "no RBAC changes required" note in the description checks out.

Overall: request changes, on one correctness issue and one behavioural regression. Everything else is a suggestion.

Blocking

  1. A transient ImageStream read failure downgrades the running gateway to the amd64 default and can flap the Deployment (inline on oauth_proxy.go:197).
  2. spec.containerRegistry overrides are silently bypassed on the dynamic path (inline on oauth_proxy.go:243).

General points that did not fit on a line

  • No signal when resolution falls back. When the ImageStream is missing or unusable, the operator logs a warning and quietly uses the default. On s390x that means an ImagePullBackOff whose root cause is only visible in operator logs. A CheCluster status condition or a Kubernetes Event would make the degraded state visible to kubectl describe.
  • Disconnected installs need a documentation update. Pullthrough of openshift/oauth-proxy requires the image to be mirrored. Since the resolved digest is not in the CSV relatedImages and never passes through addDigests.sh, standard oc adm catalog mirror output will not include it. The disconnected-install docs should call this out explicitly.
  • The CSV no longer describes what runs. RELATED_IMAGE_gateway_authentication_sidecar stays in the CSV while the pod may run a different image. Anything auditing deployed images against relatedImages will report a mismatch.
  • Rollback is asymmetric. Downgrading the operator after this change reintroduces the ImagePullBackOff on s390x. Worth a release note.
  • opm:latest is unpinned in olm-catalog/index.Dockerfile:14. With two more architectures in the catalog build, an upstream opm change now breaks four platforms at once rather than two. Pinning it would make the multi-arch build reproducible. Also expect catalog build time to roughly double, since s390x and ppc64le run under QEMU emulation.
  • Existing arch-specific mechanism. GetArchitectureDependentEnvName (pkg/common/utils/env.go:87) already supports RELATED_IMAGE_gateway_authentication_sidecar_s390x. That is not an argument against this PR (it needs a per-arch image built and maintained), but mentioning in the description why it was not sufficient would help reviewers understand the tradeoff.
  • Revisiting dockerImageReference. Following up on #2190 (comment) - dropping it entirely is right for disconnected clusters, but it also removes the only option for a connected cluster that has ImageRegistry disabled. A conditional second fallback (use it only when the internal registry is unavailable and the cluster is not disconnected) could cover that case, if it is one you care about.

Verification note: no Go toolchain is available in this environment, so go build and go test ./pkg/deploy/gateway/... were not run. All findings come from source reading against main and the OpenShift ImageStream / capability documentation.

Comment thread pkg/deploy/gateway/oauth_proxy.go Resolved
Comment thread pkg/deploy/gateway/oauth_proxy.go Resolved
Comment thread pkg/deploy/gateway/oauth_proxy.go Resolved
Comment thread pkg/deploy/gateway/oauth_proxy.go Resolved
Comment thread pkg/deploy/gateway/oauth_proxy.go Resolved
Comment thread pkg/deploy/gateway/oauth_proxy_test.go Resolved
Comment thread pkg/deploy/gateway/oauth_proxy_test.go Resolved
Comment thread pkg/deploy/gateway/oauth_proxy_test.go Resolved
Comment thread pkg/deploy/gateway/oauth_proxy_test.go Resolved
Comment thread build/scripts/olm/release-catalog.sh Resolved
@openshift-ci

openshift-ci Bot commented Sep 17, 2026

Copy link
Copy Markdown

@swapnilsingh-ibm: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/v19-devworkspace-happy-path edaf643 link true /test v19-devworkspace-happy-path

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@openshift-ci

openshift-ci Bot commented Sep 18, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: swapnilsingh-ibm, tolusha

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tolusha
tolusha merged commit 4aea588 into eclipse-che:main Sep 18, 2026
15 of 20 checks passed
@swapnilsingh-ibm
swapnilsingh-ibm deleted the fix/s390x-oauth-proxy-dynamic-image branch September 18, 2026 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Che deployment blocked on OpenShift for IBM Z(s390x) — quay.io/openshift/origin-oauth-proxy has no s390x manifest

2 participants