issue 9140: add NoExecute toleration for Windows

Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
This commit is contained in:
Lyndon-Li
2025-08-07 16:08:37 +08:00
parent 0c4055c2c0
commit 1e800906c2
5 changed files with 49 additions and 18 deletions

View File

@@ -626,12 +626,20 @@ func (e *csiSnapshotExposer) createBackupPod(
nodeSelector[kube.NodeOSLabel] = kube.NodeOSWindows
podOS.Name = kube.NodeOSWindows
toleration = append(toleration, corev1api.Toleration{
Key: "os",
Operator: "Equal",
Effect: "NoSchedule",
Value: "windows",
})
toleration = append(toleration, []corev1api.Toleration{
{
Key: "os",
Operator: "Equal",
Effect: "NoSchedule",
Value: "windows",
},
{
Key: "os",
Operator: "Equal",
Effect: "NoExecute",
Value: "windows",
},
}...)
} else {
userID := int64(0)
securityCtx = &corev1api.PodSecurityContext{

View File

@@ -501,12 +501,20 @@ func (e *genericRestoreExposer) createRestorePod(
nodeSelector[kube.NodeOSLabel] = kube.NodeOSWindows
podOS.Name = kube.NodeOSWindows
toleration = append(toleration, corev1api.Toleration{
Key: "os",
Operator: "Equal",
Effect: "NoSchedule",
Value: "windows",
})
toleration = append(toleration, []corev1api.Toleration{
{
Key: "os",
Operator: "Equal",
Effect: "NoSchedule",
Value: "windows",
},
{
Key: "os",
Operator: "Equal",
Effect: "NoExecute",
Value: "windows",
},
}...)
} else {
userID := int64(0)
securityCtx = &corev1api.PodSecurityContext{

View File

@@ -340,12 +340,20 @@ func (e *podVolumeExposer) createHostingPod(ctx context.Context, ownerObject cor
nodeSelector[kube.NodeOSLabel] = kube.NodeOSWindows
podOS.Name = kube.NodeOSWindows
toleration = append(toleration, corev1api.Toleration{
Key: "os",
Operator: "Equal",
Effect: "NoSchedule",
Value: "windows",
})
toleration = append(toleration, []corev1api.Toleration{
{
Key: "os",
Operator: "Equal",
Effect: "NoSchedule",
Value: "windows",
},
{
Key: "os",
Operator: "Equal",
Effect: "NoExecute",
Value: "windows",
},
}...)
} else {
userID := int64(0)
securityCtx = &corev1api.PodSecurityContext{

View File

@@ -244,6 +244,12 @@ func DaemonSet(namespace string, opts ...podTemplateOption) *appsv1api.DaemonSet
Effect: "NoSchedule",
Value: "windows",
},
{
Key: "os",
Operator: "Equal",
Effect: "NoExecute",
Value: "windows",
},
}
} else {
daemonSet.Spec.Template.Spec.NodeSelector = map[string]string{