Skip to content

test(e2e): run the gateway live test on OpenShift - #13627

Merged
cv merged 2 commits into
v1from
test-12733-openshift-gateway-live
Oct 26, 2026
Merged

cv merged 2 commits into
v1from
test-12733-openshift-gateway-live

Conversation

@cuongdangn

Copy link
Copy Markdown

Part of #12733.

The managed-gateway live test could run only on kind.
It always deployed runtime.provider: kubernetes, so on OpenShift the chart's UID and fsGroup 1000 fall outside the namespace's range and restricted-v2 refuses the gateway pod.
Its last step waited for the gateway's volumes to disappear after deleting the namespace, which never happens under the Retain reclaim policy of OpenShift Local's default StorageClass.
The OpenShift-profile test writes the namespace's UID range itself, so on an OpenShift cluster it would replace the range that the cluster assigns.

This change:

  • Adds NEMOCLAW_TEST_KUBE_RUNTIME (kubernetes by default, or openshift) to the gateway test.
    With openshift, after each installation every pod in the namespace must be admitted under restricted-v2, run every container as the first UID of the namespace's range, and use the first supplemental group as fsGroup.
    The SCC name is asserted because [Kubernetes/OpenShift] Qualify v1 platform support and verify real OpenShift behavior #12733 asks whether the gateway needs any SCC grant beyond the cluster's default.
  • Before deleting the namespace, switches each volume bound to the test's PVCs whose reclaim policy is not Delete to Delete, after checking that the provisioner created it for that PVC, so that the provisioner removes the volume and its storage.
    kind's volumes already use Delete and are left as they are.
  • Makes the OpenShift-profile test refuse a cluster that serves the security.openshift.io API group, before it deploys anything.
  • Pins NEMOCLAW_TEST_KUBE_RUNTIME=kubernetes in cargo ci live-kind, so a value exported for an OpenShift run cannot reach the kind run.
  • Documents the prerequisites, the OpenShift checks, and recovery after a failed run in docs/contributing/live-tests.md, including the chart's cluster-scoped ClusterRole and ClusterRoleBinding, and updates the matching sentence in docs/usage.md.

Validation

On OpenShift Local 2.64.0 (OpenShift 4.22.14, Kubernetes v1.35.6, one arm64 RHCOS node, Agent Sandbox v0.5.0), with a bundle from cargo ci bundle:

  • The gateway test with NEMOCLAW_TEST_KUBE_RUNTIME=openshift passed in 59.28 s.
    The gateway and development-issuer pods ran under restricted-v2 with UID and fsGroup 1000670000 in both cycles; afterwards no test namespace, volume, ClusterRole or ClusterRoleBinding remained.
  • The OpenShift-profile test failed at its guard in 0.02 s without deploying.

Locally: cargo fmt --check, cargo clippy --all-targets -- -D warnings for nemoclaw-e2e and nemoclaw-build, git diff --check, and cargo run -p nemoclaw-build -- fern check (0 errors).

Deferred to CI: Live / Kind, which runs the gateway and OpenShift-profile tests on kind and refuses non-Linux hosts, and the bundle and lifecycle checks that cargo ci selects for the changed e2e crate.

Not covered: sandbox pods on OpenShift (they need an agent image the cluster can pull), multi-node and amd64 OpenShift, and an existing OIDC issuer instead of the development one.
#13551 edits the same two files and renames the OpenShift-profile test; whichever merges second resolves the overlap.

🤖 Generated with Claude Code

The managed-gateway live test could run only on kind. It always deployed
runtime.provider kubernetes, whose chart UID and fsGroup 1000 restricted-v2
refuses on OpenShift, and it waited for volumes that a Retain StorageClass
keeps. The OpenShift-profile test writes the namespace's UID range itself,
which on an OpenShift cluster would replace the range the cluster assigns.

NEMOCLAW_TEST_KUBE_RUNTIME=openshift now deploys the gateway with the
openshift provider and requires every pod to be admitted under
restricted-v2, running as the namespace's first UID and group. Before
deleting the namespace, the test switches the volumes provisioned for its
claims to Delete, so that the provisioner removes their storage. The
OpenShift-profile test refuses a cluster that serves security.openshift.io,
and cargo ci live-kind pins the variable to kubernetes.

Passed on OpenShift Local 2.64.0 (OpenShift 4.22.14, one arm64 node) in
59.28 s, with both pods under restricted-v2 as UID 1000670000 and no test
namespace, volume or node-reader ClusterRole left afterwards; the guard
refused the same cluster before deploying. cargo fmt, clippy, git diff
--check and fern check pass; Live / Kind runs in CI.

Part of #12733.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@copy-pr-bot

copy-pr-bot Bot commented Oct 22, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@github-actions

Copy link
Copy Markdown
Contributor

@cuongdangn
cuongdangn marked this pull request as ready for review October 22, 2026 08:46
@wscurran wscurran added area: e2e End-to-end tests, nightly failures, or validation infrastructure area: security Security controls, permissions, secrets, or hardening chore Build, CI, dependency, or tooling maintenance platform: k8s Affects Kubernetes deployments labels Oct 22, 2026
@cv
cv enabled auto-merge (squash) October 26, 2026 08:38
@cv
cv merged commit 69e0eab into v1 Oct 26, 2026
52 checks passed
@cv
cv deleted the test-12733-openshift-gateway-live branch October 26, 2026 08:52
gaveezy added a commit that referenced this pull request Oct 26, 2026
Two files conflicted with #13627 (69e0eab), which runs the gateway
live test on OpenShift; #13704 (f2d92ad) switched the live agent to
OpenClaw without conflicts. Keep both sides:

- kubernetes_live.rs: this branch's `random_hex` and `create` helpers
  and #13627's `runtime_provider`. The OpenShift-profile test starts with
  #13627's refusal of a cluster that serves `security.openshift.io`,
  then deploys this branch's three agents.
- live-tests.md: this branch's description of the shared flow, with
  #13627's sentence about that refusal after the UID-range sentence.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
gaveezy added a commit that referenced this pull request Oct 26, 2026
Bring in #13551's merge of v1 at 69e0eab (15ce41e): the live agent is
now OpenClaw (#13704), and the OpenShift-profile test refuses OpenShift
clusters (#13627). No conflicts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@wscurran wscurran added the v1 NemoClaw v1 branch label Oct 27, 2026
@cv cv added this to the Roadmap: GTC DC 2026 milestone Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: e2e End-to-end tests, nightly failures, or validation infrastructure area: security Security controls, permissions, secrets, or hardening chore Build, CI, dependency, or tooling maintenance platform: k8s Affects Kubernetes deployments v1 NemoClaw v1 branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants