Skip to content

Commit 22a9329

Browse files
author
Michel Jansen
committed
test(kubernetes): verify user namespace rollout references
Changing only a bootstrap template body does not roll existing Machines. Guard the changed MachineDeployment reference and matching Job permissions, including restoration of the default reference when the opt-in is removed. Assisted-by: LLM Signed-off-by: Michel Jansen <[email protected]>
1 parent 1085260 commit 22a9329

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

‎hack/check-talosconfigtemplate-name-agreement.bats‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,3 +167,18 @@ assert_agreement() {
167167
fi
168168
rm -rf "$TMP"
169169
}
170+
171+
@test "user namespace opt-in changes the bootstrap reference and zero restores it" {
172+
TMP=$(mktemp -d)
173+
render_pool "$TMP/plain.yaml"
174+
render_pool "$TMP/r.yaml" --set talos.userNamespacesLimit=11255
175+
assert_agreement "$TMP" "user namespaces"
176+
plain=$(md_config_ref_name "$TMP/plain.yaml")
177+
enabled=$(md_config_ref_name "$TMP/r.yaml")
178+
[ "$plain" != "$enabled" ]
179+
render_pool "$TMP/r.yaml" --set talos.userNamespacesLimit=0
180+
assert_agreement "$TMP" "user namespaces disabled"
181+
disabled=$(md_config_ref_name "$TMP/r.yaml")
182+
[ "$plain" = "$disabled" ]
183+
rm -rf "$TMP"
184+
}

0 commit comments

Comments
 (0)