Skip to content

test(e2e): migrate the kind registry and OIDC happy paths to the kind HCL case - #14125

Merged
cv merged 5 commits into
v1from
test/14061-kind-registry-oidc
Nov 3, 2026
Merged

cv merged 5 commits into
v1from
test/14061-kind-registry-oidc

Conversation

@sandl99

@sandl99 sandl99 commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Failure

Part of #14061. Follows #14119, now merged; the branch merges v1 at 429db11.

Two Kind happy paths were still Rust live tests: kubernetes_live::registry (an agent image pulled from a private registry with the cluster's pull Secret) and kubernetes_live::oidc (a managed gateway that accepts an existing OIDC issuer's tokens). Both used the shared Rust Kind deploy flow (deploy_image_and_export), its stub model and request helpers, and registry_fixture.rs. That code and the SDK's separate issuer image test (live-docker) had no other callers.

Decision

Fold both paths into the existing kind-openshift-agents case instead of adding a second Kind case. A second case would not fit the 270 s live-kind budget: tofu test runs files one after another, and the case already takes about 135 s.

OIDC. The case switches from the development profile to the oidc profile. The reduced Rust gateway test from #14119 still covers the development profile, including the foreign-token refusal.

  • The issuer is the SDK's own development issuer (issuer::objects, the pinned issuer image) in its own namespace, standing in for an identity provider. Its NetworkPolicy is left out because it admits only a gateway in the issuer's namespace.
  • cargo ci builds without the SDK, and the bundle has no TLS provider. OpenTofu also cannot sign a token. So a small probe, hcl_live::issuer, creates the issuer's key material, its objects, and one token for the case's audience (the deployment UID). The kind module runs it in run "cluster" and releases the objects through its chart, with the issuer CA in the deployment's namespace.
  • The token is written only to work/credentials/NEMOCLAW_TEST_OIDC_TOKEN (mode 0600). The cli and verifier modules export each file in that directory as the variable it names. The token never becomes an OpenTofu value, output, report, or log line. It is valid for one hour.

Registry. cargo ci live-kind starts a pinned registry:3 that requires a login on the kind network. It pushes the agent image there with ctr and uploads a new index digest, so the node must fetch the index from the registry. The node's CRI host configuration for that registry allows HTTP pulls and holds no credentials. The case names the image by its registry reference and sets imagePullSecrets: [agent-registry]. The kind chart creates that Secret from TF_VAR_pull_credentials in the pre-created namespace, as an operator would. The registry is removed afterward, unless NEMOCLAW_KEEP_KIND_CLUSTER keeps the cluster.

The case's assertions are unchanged: apply succeeds, each agent answers from its recorded runtime with the stub's reply, a plan has no changes, and destroy keeps only openshell_kubernetes_storage.runtime. With the oidc profile and the private image, apply and the replies also show that the gateway accepts the issuer's token and that the pods pulled their image with the Secret.

Deleted. kubernetes_registry.rs, kubernetes_oidc.rs, registry_fixture.rs, kubernetes_requests.rs (gateway, which hcl_live::probe uses, moves into kubernetes_live.rs), deploy_image_and_export and its document, identity, Sandbox-object, and diagnostics helpers, state::agent_sandbox_id, the SDK issuer image test, its live-docker selector, and the live-kind registry override.

Removed checks and their owners

Removed check Owner
A private agent image pulled with the cluster's pull Secret; the agent answers This case
The gateway accepts an existing issuer's token; the agent answers This case (apply, and the probe through the gateway)
Destroy keeps the gateway's storage This case (retained); UID survival stays in the Rust gateway test
The oidc profile runs no development issuer Contract: kubernetes_managed_compile::an_existing_oidc_issuer_replaces_the_development_issuer, kubernetes_operations::an_oidc_profile_writes_no_issuer_and_identifies_authentication_by_its_namespace
OpenTofu state holds no registry credentials Contract: the schema accepts only Secret names (config_kubernetes::image_pull_references_accept_only_unique_kubernetes_secret_names, which also rejects a password field), and compile references them by name
Destroy keeps the operator's namespace (UID, labels) and pull Secret Contract: kubernetes_operations::an_operators_namespace_and_pull_secret_survive_apply_and_destroy
The issuer image serves both documents over HTTPS This case: the gateway fetches discovery and JWKS from the image, run from issuer::objects
Unchanged apply and the export's apply keep identities and state; export reproduces the document, including image and Secret references; each sandbox has its own ID with its agent bound to it #14060 (existing Kubernetes item)
A token read from token.env is not kept in connection state Contract: kubernetes_connect::an_oidc_connection_passes_the_variable_tokenenv_names
Registry rejects a wrong password Dropped: it tests registry:3. The anonymous 401 stays as the setup's readiness check
Failure diagnostics (pod states, events, Fabric messages) and their unit test Dropped: test-helper output, not a check

Needs a maintainer decision. These checks have no other owner, and this PR deletes them. Before approving, please accept or reject each proposal; I will restore any check you want kept:

Check Proposal
A token for another audience is refused; the refused plan leaves the state directory byte-identical and echoes no token Drop from E2E: audience validation is OpenShell's, and the authored table reaching the chart is covered by kubernetes_managed_compile::authored_tables_reach_the_chart_gateway_config. Add "a plan refused by gateway authentication leaves state unchanged and echoes no token" to #14060. Alternative: keep one narrow Rust security check.
No regular file in the whole state directory holds a token; a renewed token plans with no changes and exports the document #14060 (fixture gateway, oidc document, two tokens, then search the state directory)
Destroy removes every Sandbox object within 60 s Drop: OpenShell deletes the objects; the case's destroy covers NemoClaw's part
The issuer image returns 404 for other paths and stays within its memory limit for 10 s Drop: the case runs issuer::objects for the whole scenario

Net (Rust / HCL / chart and case YAML / docs / CI config): −1,959 / +86 / +46 / −18 / −11 lines; 542 added and 2,398 deleted. Of the Rust added, 269 lines are the registry setup and its unit test in run_ci/kind_registry.rs, moved from the deleted test fixture.

Validation

  • cargo ci fmt, cargo ci clippy, and cargo ci test (1,745 tests) passed on darwin_arm64. The new tests are kind_registry::tests::each_run_pushes_a_new_index_without_changing_image_contents and the binding test against the real case template, which now checks the issuer URL, the audience, and the registry reference.

  • tofu fmt -check -recursive passed in tests/e2e/hcl with the bundled OpenTofu 1.12.9.

  • The kind module initialized against the bundle's provider mirror. tofu console evaluated its registry, pull Secret, issuer, audience, and model locals for a bound case, with TF_VAR_pull_credentials parsed from the environment.

  • Ran hcl_live::issuer from the built e2e binary. It wrote the six issuer objects and a 0600 token whose iss and aud match the case. The chart rendered offline with the bundled Helm provider's helm_template: pull Secret and CA ConfigMap in the deployment namespace, and issuer objects without the NetworkPolicy in the issuer namespace.

  • After the first Live / Kind run failed, I ran the case's cluster run block locally under tofu test with the Helm provider mocked and the real hcl_live::issuer binary. It passed and wrote the issuer objects and the token to work/credentials.

  • Live / Kind at 0d4ad2b failed on both architectures before any deployment. The registry started and the image push succeeded. The other four tests passed. tofu test rejected var.pull_credentials: a test file's var read from TF_VAR_* is the raw string. 578f92b lets the kind module read TF_VAR_pull_credentials itself, as it reads the context.

  • After merging v1 (bc17ff7), cargo ci fmt, clippy, and test (1,752 tests) and tofu fmt -check passed again; CI reruns on that commit. The merge keeps test(e2e): report how long each run of a live HCL case takes #14124's per-run timing report and ci: raise the Live / Kind time limits while #14087 is investigated #14126's raised Live / Kind limits.

  • Live / Kind at 578f92b passed on both architectures. hcl_live::case ran the whole scenario: apply with the private image and the OIDC token, both agents' replies, an unchanged plan, and destroy.

    Platform hcl_live::case nextest suite cargo ci live-kind step
    linux_amd64 110.2 s 110.2 s 249 s
    linux_arm64 109.9 s 109.9 s 199 s

    The limits are 150 s per test and 270 s for the suite. The case took 133 s and 138 s with three agents in test(e2e): migrate the kind OpenShift agents happy path to HCL E2E #14097. The suite now ends with the case, so it is about 140 s under its budget. I left .config/test-budgets.yaml unchanged, because one run is not enough to lower it.

…io covers

The kind-openshift-agents scenario installs the managed gateway through
the CLI and the bundled Helm provider, reaches it with the development
token, plans no changes, and destroys it keeping storage, which is the
Rust gateway test's successful path. Delete that test and the runtime
graph, Helm release, and OpenShift admission helpers only it used.

Cut the scenario to two agents; separate identities across several agents
are an integration check now. Bind the docker and kind case templates
through one placeholder helper.

Refs #14061
Restore the Rust Kind gateway test, reduced to what the HCL scenario
cannot show: the development gateway refuses a token signed by another
key, and removing and reinstalling it keeps the namespace, encryption key,
and PVCs with their UIDs, with OpenTofu run on an empty PATH. The
OpenShift admission branch, which only ran by hand, and the volume
reclaim-policy cleanup for clusters other than kind are gone.

Refs #14061
… HCL case

kind-openshift-agents now pulls its agent image from a registry the run
owns, with the operator's pull Secret, and its gateway uses the oidc
profile with an existing issuer: the SDK's development issuer objects,
released by the kind chart in their own namespace. hcl_live::issuer
creates the issuer's key material and one token, which the cli and
verifier modules export as the case's token.env from a private file.

cargo ci live-kind starts the registry on the kind network, pushes the
agent image under a new index digest, and passes the fixture login as
TF_VAR_pull_credentials.

Remove the Rust registry and OIDC tests, the shared Kind deploy flow,
its stub and request helpers, the registry fixture, and the SDK's
issuer image test, which the case now covers.

Part of #14061.
@copy-pr-bot

copy-pr-bot Bot commented Nov 3, 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.

@sandl99

sandl99 commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator Author
Authoring session — opening
Field Status Value Evidence or limit
Harness partial Pi 1.2.0 (session format 3) Session header gives the format; the version comes from the harness install path in the startup instructions, not from session metadata
Skills recorded nemoclaw-contributor-create-pr (complete read) Tool reads to cutoff; no skill was injected
Instruction files recorded AGENTS.md of the main checkout (injected); v1 AGENTS.md (complete read); WRITING.md (complete read); .github/PULL_REQUEST_TEMPLATE.md (complete read); .github/SESSION_REPORT_TEMPLATE.md (complete read) Startup injection and tool reads to cutoff; v1 AGENTS.md and WRITING.md were read after the change was written, before the PR text was final
Tool calls partial typescript: 103 Wrapper calls to cutoff, including failed and timed-out ones; the nested host calls inside each wrapper (shell, file, git, GitHub, UI) are not counted
Session window recorded 2026-11-03T04:33:57Z to 2026-11-03T05:46:25Z; 72 min First event to cutoff, including idle time; the whole session is this task
Compactions recorded 0 Complete record to cutoff; two context edits elided absorbed tool results, which is not a compaction
Models recorded claude-opus-5-5 Model change event and assistant turns; no changes
Reasoning levels recorded medium; high Thinking-level change events, in order

tofu test passes a test file's TF_VAR value to a run's variables as the raw
string, so var.pull_credentials failed the kind module's object type. The
module now reads TF_VAR_pull_credentials itself, as it reads the context.
@sandl99
sandl99 marked this pull request as ready for review November 3, 2026 07:24
@sandl99
sandl99 requested a review from cv November 3, 2026 08:14
@sandl99 sandl99 added the v1 NemoClaw v1 branch label Nov 3, 2026
Base automatically changed from test/14061-kind-shrink to v1 November 3, 2026 09:03
@cv
cv enabled auto-merge (squash) November 3, 2026 09:36
Keep the kind case's registry and OIDC migration over v1's Rust registry
and OIDC tests and their helpers, keep #14124's per-run timing report
beside the issuer probe in hcl_live.rs, keep #14126's raised Live / Kind
limits, and state them in the testing guide's budget table.
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

@cv
cv merged commit b7d25f0 into v1 Nov 3, 2026
95 of 97 checks passed
@cv
cv deleted the test/14061-kind-registry-oidc branch November 3, 2026 11:26
@wscurran wscurran added area: ci CI workflows, checks, release automation, or GitHub Actions area: docs Documentation, examples, guides, or docs build 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 Nov 3, 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: ci CI workflows, checks, release automation, or GitHub Actions area: docs Documentation, examples, guides, or docs build 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