Repository navigation
fix: resolve oauth-proxy image from cluster release payload for multi-arch support - #2190
Conversation
|
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 Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
|
@swapnilsingh-ibm |
…-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.
c9f5751 to
ce604e6
Compare
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.
|
/che-ai-assistant ok-pr-review Task completed. |
tolusha
left a comment
There was a problem hiding this comment.
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
- A transient ImageStream read failure downgrades the running gateway to the amd64 default and can flap the Deployment (inline on
oauth_proxy.go:197). spec.containerRegistryoverrides are silently bypassed on the dynamic path (inline onoauth_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
ImagePullBackOffwhose root cause is only visible in operator logs. ACheClusterstatus condition or a Kubernetes Event would make the degraded state visible tokubectl describe. - Disconnected installs need a documentation update. Pullthrough of
openshift/oauth-proxyrequires the image to be mirrored. Since the resolved digest is not in the CSVrelatedImagesand never passes throughaddDigests.sh, standardoc adm catalog mirroroutput will not include it. The disconnected-install docs should call this out explicitly. - The CSV no longer describes what runs.
RELATED_IMAGE_gateway_authentication_sidecarstays in the CSV while the pod may run a different image. Anything auditing deployed images againstrelatedImageswill report a mismatch. - Rollback is asymmetric. Downgrading the operator after this change reintroduces the
ImagePullBackOffon s390x. Worth a release note. opm:latestis unpinned inolm-catalog/index.Dockerfile:14. With two more architectures in the catalog build, an upstreamopmchange 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 supportsRELATED_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 hasImageRegistrydisabled. 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.
|
@swapnilsingh-ibm: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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. |
|
[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. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
What does this PR do?
Fixes
che-gatewaydeployment on OpenShift on IBM Z (s390x) where the oauth-proxy sidecar entersImagePullBackOffbecausequay.io/openshift/origin-oauth-proxy:4.22(hardcoded asRELATED_IMAGE_gateway_authentication_sidecar) carries only alinux/amd64manifest, 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-proxyImageStream (namespaceopenshift). 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_sidecarwhen the ImageStream is unavailable, preserving existing behaviour for non-OCP environments. No RBAC changes required — the operator's ClusterRole already hasimage.openshift.io/imagestreams: get, list. Also extendsbuild/scripts/olm/release-catalog.shto producelinux/s390xandlinux/ppc64lemanifests for the OLM catalog image.Screenshot/screencast of this PR
See attached screenshots:
che-gatewayreaching4/4 Runningon s390xeclipse-chenamespaceWhat 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
Verify:
oc get deployment che-gateway -n eclipse-che \ -o jsonpath='{.spec.template.spec.containers[?(@.name=="oauth-proxy")].image}'Common Test Scenarios
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.