Skip to content

test: full-path go-inventory e2e in kind (ADR 0010) - #24

Merged
kfeofantov merged 1 commit into
mainfrom
feat/inventory-e2e
Aug 10, 2026
Merged

kfeofantov merged 1 commit into
mainfrom
feat/inventory-e2e

Conversation

@kfeofantov

Copy link
Copy Markdown
Contributor

What

Slice 4 (final): asserts the whole node→controller inventory path against a real kind cluster.

A known Go workload (a Deployment) runs → the node DaemonSet scans it and ships the fact to the controller over HTTP with a projected controller-audience token → the controller validates the token locally against the cluster JWKS → joins the fact against its workload inventory → writes a go_inventory payload to its spool. The test asserts on the spool contents — the payload the backend would receive, not logs (per development.md): the sample's module path, a go1.x version, a sha256: image digest, pgo=false, and the resolved container + workload (Deployment/goworkload).

Contents

  • deploy/controller.yaml — the controller's raw manifest for this path: read RBAC (security.md §4) + the read-only JWKS-discovery nonResourceURL grant (no TokenReview, no write verb), the node-intake Service, ConfigMap, and an emptyDir spool. Scoped to the inventory path; backend enrollment/identity is a later slice.
  • test/e2e/inventory_test.go — deploys sample + controller (with a busybox sidecar sharing the spool volume, since the agent image is distroless — no shell to cat with) + node DaemonSet pointed at the controller Service; reads the payload via exec in the sidecar. Cluster-scoped RBAC objects are per-run named and cleaned up.
  • deployNodeDaemonSet gains a controller-endpoint parameter; clusterClient refactored to expose the REST config for exec. New make inventory-e2e target (loads the busybox sidecar image). go.mod gains the remotecommand transitive deps, used only under the e2e build tag.

Verified locally against kind

  • make inventory-e2e → PASS (67s): full path, correct payload fields.
  • make node-e2e → PASS (refactor intact).
  • make e2e (pods/nodes/oom/usage/filter) → PASS (container-index change intact).

This completes the ADR 0010 feature: ADR (#20) → nodeauth (#21) → transport (#22) → join+payload (#23) → this e2e.

🤖 Generated with Claude Code

…pool (ADR 0010)

Asserts the whole node→controller inventory path against a real cluster: a known
Go workload (a Deployment) runs, the node DaemonSet scans it and ships the fact
to the controller over HTTP with a projected controller-audience token, the
controller validates the token locally against the cluster JWKS, joins the fact
against its workload inventory, and writes a go_inventory payload to its spool.
The test asserts on the spool contents — the payload the backend would receive,
not logs (docs/development.md): the sample's module path, a go1.x version, a
sha256 image digest, pgo=false, container and workload resolved.

- deploy/controller.yaml: the controller's raw manifest for this path — read
  RBAC (security.md §4) plus the read-only JWKS-discovery nonResourceURL grant
  (no TokenReview, no write verb), the node-intake Service, ConfigMap, and an
  emptyDir spool. Scoped to the inventory path; backend enrollment/identity is a
  later slice.
- test/e2e/inventory_test.go: deploys the sample, the controller (with a
  shell sidecar sharing the spool volume, since the agent image is distroless),
  and the node DaemonSet pointed at the controller Service; reads the payload
  via exec in the sidecar. Cluster-scoped RBAC objects are per-run named and
  cleaned up.
- deployNodeDaemonSet gains a controller-endpoint parameter; clusterClient is
  refactored to expose the REST config for exec. New `make inventory-e2e` target
  (loads a busybox sidecar image). go.mod gains the remotecommand transitive
  deps, used only under the e2e build tag.

Ran locally against kind: inventory-e2e, node-e2e, and the non-image e2e suite
all pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@kfeofantov
kfeofantov merged commit cb4d245 into main Aug 10, 2026
3 checks passed
@kfeofantov
kfeofantov deleted the feat/inventory-e2e branch August 10, 2026 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant