mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-05 04:55:22 +00:00
Merge pull request #9165 from Lyndon-Li/issue-fix-9140
Issue 9140: add NoExecute toleration for Windows
This commit is contained in:
1
changelogs/unreleased/9165-Lyndon-Li
Normal file
1
changelogs/unreleased/9165-Lyndon-Li
Normal file
@@ -0,0 +1 @@
|
||||
Fix issue #9140, add os=windows:NoSchedule toleration for Windows pods
|
||||
@@ -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{
|
||||
|
||||
@@ -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{
|
||||
|
||||
@@ -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{
|
||||
|
||||
@@ -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{
|
||||
|
||||
Reference in New Issue
Block a user