Repository navigation
test(e2e): migrate the kind registry and OIDC happy paths to the kind HCL case - #14125
Merged
Merged
Conversation
…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.
|
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. |
Collaborator
Author
Authoring session — opening
|
This was referenced Nov 3, 2026
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
marked this pull request as ready for review
November 3, 2026 07:24
cv
enabled auto-merge (squash)
November 3, 2026 09:36
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Failure
Part of #14061. Follows #14119, now merged; the branch merges
v1at 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) andkubernetes_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, andregistry_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-agentscase instead of adding a second Kind case. A second case would not fit the 270 slive-kindbudget:tofu testruns files one after another, and the case already takes about 135 s.OIDC. The case switches from the
developmentprofile to theoidcprofile. The reduced Rust gateway test from #14119 still covers the development profile, including the foreign-token refusal.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 cibuilds 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). Thekindmodule runs it inrun "cluster"and releases the objects through its chart, with the issuer CA in the deployment's namespace.work/credentials/NEMOCLAW_TEST_OIDC_TOKEN(mode 0600). Thecliandverifiermodules 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-kindstarts a pinnedregistry:3that requires a login on the kind network. It pushes the agent image there withctrand 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 setsimagePullSecrets: [agent-registry]. Thekindchart creates that Secret fromTF_VAR_pull_credentialsin the pre-created namespace, as an operator would. The registry is removed afterward, unlessNEMOCLAW_KEEP_KIND_CLUSTERkeeps 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 theoidcprofile 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, whichhcl_live::probeuses, moves intokubernetes_live.rs),deploy_image_and_exportand its document, identity,Sandbox-object, and diagnostics helpers,state::agent_sandbox_id, the SDK issuer image test, itslive-dockerselector, and thelive-kindregistry override.Removed checks and their owners
retained); UID survival stays in the Rust gateway testoidcprofile runs no development issuerkubernetes_managed_compile::an_existing_oidc_issuer_replaces_the_development_issuer,kubernetes_operations::an_oidc_profile_writes_no_issuer_and_identifies_authentication_by_its_namespaceconfig_kubernetes::image_pull_references_accept_only_unique_kubernetes_secret_names, which also rejects a password field), and compile references them by namekubernetes_operations::an_operators_namespace_and_pull_secret_survive_apply_and_destroyissuer::objectstoken.envis not kept in connection statekubernetes_connect::an_oidc_connection_passes_the_variable_tokenenv_namesregistry:3. The anonymous 401 stays as the setup's readiness checkNeeds 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:
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.oidcdocument, two tokens, then search the state directory)Sandboxobject within 60 sissuer::objectsfor the whole scenarioNet (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, andcargo ci test(1,745 tests) passed on darwin_arm64. The new tests arekind_registry::tests::each_run_pushes_a_new_index_without_changing_image_contentsand the binding test against the real case template, which now checks the issuer URL, the audience, and the registry reference.tofu fmt -check -recursivepassed intests/e2e/hclwith the bundled OpenTofu 1.12.9.The
kindmodule initialized against the bundle's provider mirror.tofu consoleevaluated its registry, pull Secret, issuer, audience, and model locals for a bound case, withTF_VAR_pull_credentialsparsed from the environment.Ran
hcl_live::issuerfrom the built e2e binary. It wrote the six issuer objects and a 0600 token whoseissandaudmatch the case. The chart rendered offline with the bundled Helm provider'shelm_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
clusterrun block locally undertofu testwith the Helm provider mocked and the realhcl_live::issuerbinary. It passed and wrote the issuer objects and the token towork/credentials.Live / Kindat 0d4ad2b failed on both architectures before any deployment. The registry started and the image push succeeded. The other four tests passed.tofu testrejectedvar.pull_credentials: a test file'svarread fromTF_VAR_*is the raw string. 578f92b lets thekindmodule readTF_VAR_pull_credentialsitself, as it reads the context.After merging
v1(bc17ff7),cargo ci fmt,clippy, andtest(1,752 tests) andtofu fmt -checkpassed 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 / Kindat 578f92b passed on both architectures.hcl_live::caseran the whole scenario: apply with the private image and the OIDC token, both agents' replies, an unchanged plan, and destroy.hcl_live::casecargo ci live-kindstepThe 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.yamlunchanged, because one run is not enough to lower it.