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 - <