Enable parameterized kubelet mount path during node-agent installation (#9074)

Enable parameterized kubelet mount path during node-agent installation

Signed-off-by: longyuxiang <longyuxiang@kylinos.cn>
This commit is contained in:
longxiucai
2025-07-23 14:50:16 +08:00
committed by GitHub
parent 232bc90796
commit 8ce513ca07
8 changed files with 33 additions and 3 deletions

View File

@@ -63,6 +63,10 @@ func TestDaemonSet(t *testing.T) {
ds = DaemonSet("velero", WithServiceAccountName("test-sa"))
assert.Equal(t, "test-sa", ds.Spec.Template.Spec.ServiceAccountName)
ds = DaemonSet("velero", WithKubeletRootDir("/data/test/kubelet"))
assert.Equal(t, "/data/test/kubelet/pods", ds.Spec.Template.Spec.Volumes[0].HostPath.Path)
assert.Equal(t, "/data/test/kubelet/plugins", ds.Spec.Template.Spec.Volumes[1].HostPath.Path)
ds = DaemonSet("velero", WithNodeAgentDisableHostPath(true))
assert.Len(t, ds.Spec.Template.Spec.Volumes, 1)
assert.Len(t, ds.Spec.Template.Spec.Containers[0].VolumeMounts, 1)