From fc4d244975febaf6b6e457e18358fb7063100bc9 Mon Sep 17 00:00:00 2001 From: Scot Wells Date: Fri, 14 Aug 2026 10:24:19 -0500 Subject: [PATCH] test(e2e): prove a network's presence reaches the cell serving a location A NetworkContext written on the Karmada hub in a project's downstream namespace must arrive on the POP cell for that location carrying the fields the cell acts on, and must go away again when it is withdrawn. infra keeps a hand-maintained fork of NSO's propagation policy rather than consuming NSO's copy, so a selector NSO adds on its side can be inert on ours with nothing to say so: the policy looks right, the CRD exists, and the object reaches nowhere. This suite is the regression guard for that class of silent failure. The environment applies NSO's real propagation policy from the module cache, so the selectors under test are the ones production runs. Delivery is asserted on spec.ipFamilies and spec.mtu by value rather than on the object's mere existence, because those are what a cell's claim reconciler reads; a copy without them is indistinguishable downstream from one that never arrived. The companion assertion that hub status does not cross is what keeps that honest, and is why both fields have to live in spec. The context is created directly on the hub rather than reconciled from a NetworkBinding, and claim readiness is left alone: no NSO controller-manager runs here, and that path belongs to NSO's own e2e against a real IPAM. Co-Authored-By: Claude Opus 5 --- .../chainsaw-test.yaml | 244 ++++++++++++++++++ 1 file changed, 244 insertions(+) create mode 100644 test/e2e/network-context-propagation/chainsaw-test.yaml diff --git a/test/e2e/network-context-propagation/chainsaw-test.yaml b/test/e2e/network-context-propagation/chainsaw-test.yaml new file mode 100644 index 00000000..565d4c7d --- /dev/null +++ b/test/e2e/network-context-propagation/chainsaw-test.yaml @@ -0,0 +1,244 @@ +apiVersion: chainsaw.kyverno.io/v1alpha1 +kind: Test +metadata: + name: network-context-propagation +spec: + description: | + A network's presence reaches the cell a workload runs in. + + A NetworkContext written on the Karmada hub, in a project's downstream + namespace, arrives on the POP cell serving that location carrying the fields + the cell needs to act on it. + + Why this suite exists + ───────────────────── + infra keeps a hand-maintained fork of NSO's propagation policy rather than + consuming NSO's copy. When NSO added the NetworkContext selector to its own + policy, the change was inert: nothing read that path, so nothing noticed. + This is the regression guard for exactly that class of silent failure — a + policy that looks right, a CRD that exists, and an object that reaches + nowhere. Every part is individually plausible, the whole delivers nothing, + and there is no error and no event to say so. + + The environment applies NSO's real config/federation/clusterpropagationpolicy.yaml + from the Go module cache rather than a compute-authored stand-in, so the + selectors under test are the ones production runs. + + What is deliberately NOT asserted + ───────────────────────────────── + No NSO controller-manager runs here. Nothing reconciles a NetworkBinding into + a NetworkContext, and nothing serves a NetworkInterfaceClaim. The context is + therefore written directly on the hub, and the suite stops at delivery. + Whether a cell can then satisfy a claim from it belongs to NSO's own e2e, + which runs against a real IPAM. + + Prerequisites: `task e2e:env:up`. The compute operators are not involved — + this is Karmada propagation end to end. + + template: true + + steps: + - name: setup-hub-namespace + description: | + Create the hub namespace the context lives in, carrying the identity labels + compute's federator stamps on the ns- namespaces it creates. NSO's + policy selects namespaces on upstream-namespace, so this one object is also + what causes the namespace to exist on the cell — a context cannot land in a + namespace that was never carried. + try: + - script: + content: | + kubectl get namespace "$NAMESPACE" \ + -o template='{{printf "ns-%s" .metadata.uid}}' + outputs: + - name: hubNS + value: ($stdout) + - script: + env: + - name: HUB_NS + value: ($hubNS) + content: | + kubectl --kubeconfig=../../../tmp/e2e/kubeconfigs/downstream.yaml apply -f - <