Fix and run chainsaw restricted-fields test
What does this MR do and why?
Fix the the chainsaw Job suite for restricted-fields, as it was not loaded from what we can see in https://sylva-projects.gitlab.io/-/sylva-core/-/jobs/16657407069/artifacts/management-cluster-dump/chainsaw-test/run-chainsaw-tests-78cvh/logs.txt
Loading tests...
- avoid-delete-mgmt-cluster (/tests/avoid-delete-mgmt-cluster)
- avoid-delete-mgmt-cluster (/tests/avoid-delete-mgmt-cluster/..2026_09_22_16_08_42.3228598667)
- deny-cabundle-changes (/tests/deny-cabundle-changes)
- deny-cabundle-changes (/tests/deny-cabundle-changes/..2026_09_22_16_08_42.3650095086)
- disallow-default-namespace (/tests/disallow-default-namespace)
- disallow-default-namespace (/tests/disallow-default-namespace/..2026_09_22_16_08_42.330301456)
- disallow-latest-tag (/tests/disallow-latest-tag)
- disallow-latest-tag (/tests/disallow-latest-tag/..2026_09_22_16_08_42.3417010731)
- ensure-force-cluster-policy (/tests/ensure-force-cluster-policy)
- ensure-force-cluster-policy (/tests/ensure-force-cluster-policy/..2026_09_22_16_08_42.1979507470)
Loading values...
Running tests...
=== RUN chainsawdue to patch in kustomize-units/chainsaw-tests/components/restricted-fields/kustomization.yaml targeting the the Job by name:
- target:
kind: Job
name: run-chainsaw-testswhile the Job is actually named run-chainsaw-tests${CHAINSAW_SUFFIX}.
Dropping the name match criteria as other components like disallow-latest-tag target only kind: Job and don't have this problem.
Once loaded, there were problems with the test itself:
- Step 0 was denied by RBAC. The runner's ClusterRole couldn't read
ValidatingAdmissionPolicies, so we needed to introduce a patch granting get/list/watch onvalidatingadmissionpoliciesandvalidatingadmissionpolicybindings. - Since pods without a namespace in their manifest went to
chainsaw-test, which Flux labelssylva.org/sylva-managed: "true"andVAP/restrict-node-selection-bindingskips namespaces with that label, the policy was never checked in the test namespace, so the "must be denied" pod was admitted.
We force the pods in a dedicated namespace viaTest.spec.namespace: chainsaw-restricted-fieldssetting, for which chainsaw suite creates the ns, i.e. dedicated namespace without that label where the policy applies. We make use of !9276 (merged) mechanism to havetest_sylva_namespaces_are_labeledtest skip any label that hassylva.org/test-namespace: "true"label. - Pod Security rejected the test pods in RKE2 cluster so we added
securityContextblock the other chainsaw suites use. - Step 2's delete timed out. The
kube-systempod is bound to a node that doesn't exist, so no kubelet confirms its deletion. The garbage collector removes it only after about 40–60s, longer than chainsaw's default 20s. We encreased the delete timeout to 90s.
Related reference(s)
Test coverage
CI configuration
Below you can choose test deployment variants to run in this MR's CI.
Click to open to CI configuration
Legend:
| Icon | Meaning | Available values |
|---|---|---|
| Infra Provider | capd, capo, capm3 |
|
| Bootstrap Provider | kubeadm (alias kadm), rke2, okd, ck8s |
|
| Node OS | ubuntu, suse, na, leapmicro |
|
| Deployment Options | Deployment option list and description | |
| Pipeline Scenarios | Available scenario list and description | |
| Enabled units | Any available units name, by default apply to management and workload cluster. Can be prefixed by mgmt: or wkld: to be applied only to a specific cluster type |
|
| Disabled units | Any available units name, by default apply to management and workload cluster. Can be prefixed by mgmt: or wkld: to be applied only to a specific cluster type |
|
| Target platform | Can be used to select specific deployment environment Available platform list and description | |
| Pipeline control | autorun, manual or blocking. Can be used to override global config and start a deployment pipeline the required way |
-
🎬 preview☁️ capd🚀 kadm🐧 ubuntu -
🎬 preview☁️ capo🚀 rke2🐧 suse -
🎬 preview☁️ capm3🚀 rke2🐧 ubuntu -
☁️ capd🚀 kadm🛠️ light-deploy🐧 ubuntu -
☁️ capd🚀 rke2🛠️ light-deploy🐧 suse -
☁️ capo🚀 rke2🐧 suse -
☁️ capo🚀 rke2🐧 leapmicro -
☁️ capo🚀 kadm🐧 ubuntu -
☁️ capo🚀 kadm🐧 ubuntu🟢 neuvector,mgmt:harbor -
☁️ capo🚀 rke2🎬 rolling-update🛠️ ha🐧 ubuntu -
☁️ capo🚀 kadm🎬 wkld-k8s-upgrade🐧 ubuntu -
☁️ capo🚀 rke2🎬 rolling-update-no-wkld🛠️ ha🐧 suse -
☁️ capo🚀 rke2🎬 sylva-upgrade🛠️ ha🐧 ubuntu -
☁️ capo🚀 rke2🎬 sylva-upgrade-from-1.6.x🛠️ ha,misc🐧 ubuntu -
☁️ capo🚀 rke2🛠️ ha,misc🐧 ubuntu -
☁️ capo🚀 rke2🛠️ misc🐧 ubuntu🟢 mgmt:harbor🔴 neuvector -
☁️ capo🚀 rke2🛠️ ha,misc,openbao🐧 suse -
☁️ capo🚀 rke2🐧 suse🎬 upgrade-from-prev-tag -
☁️ capm3🚀 rke2🐧 suse -
☁️ capm3🚀 kadm🐧 ubuntu -
☁️ capm3🚀 ck8s🐧 ubuntu -
☁️ capm3🚀 kadm🎬 rolling-update-no-wkld🛠️ ha,misc🐧 ubuntu -
☁️ capm3🚀 rke2🎬 wkld-k8s-upgrade🛠️ ha🐧 suse -
☁️ capm3🚀 kadm🎬 rolling-update🛠️ ha🐧 ubuntu -
☁️ capm3🚀 rke2🎬 upgrade-from-prev-release-branch🛠️ ha🐧 suse -
☁️ capm3🚀 rke2🛠️ misc,ha🐧 suse -
☁️ capm3🚀 rke2🎬 sylva-upgrade🛠️ ha,misc🐧 suse -
☁️ capm3🚀 kadm🎬 rolling-update🛠️ ha🐧 suse -
☁️ capm3🚀 ck8s🎬 rolling-update🛠️ ha🐧 ubuntu -
☁️ capm3🚀 rke2|okd🎬 no-update🐧 ubuntu|na -
☁️ capm3🚀 rke2🐧 suse🎬 upgrade-from-release-1.5 -
☁️ capm3🚀 rke2🐧 suse🎬 upgrade-to-main
Global config for deployment pipelines
- autorun pipelines
- allow failure on pipelines
- record sylvactl events
Notes:
- Enabling
autorunwill make deployment pipelines to be run automatically without human interaction - Disabling
allow failurewill make deployment pipelines mandatory for pipeline success. - if both
autorunandallow failureare disabled, deployment pipelines will need manual triggering but will be blocking the pipeline
Be aware: after configuration change, pipeline is not triggered automatically.
Please run it manually (by clicking the run pipeline button in Pipelines tab) or push new code.