diff --git a/pkg/exposer/csi_snapshot.go b/pkg/exposer/csi_snapshot.go index b4543ee530..cfc34cc926 100644 --- a/pkg/exposer/csi_snapshot.go +++ b/pkg/exposer/csi_snapshot.go @@ -586,6 +586,7 @@ func (e *csiSnapshotExposer) createBackupPod( var securityCtx *corev1.PodSecurityContext nodeSelector := map[string]string{} podOS := corev1.PodOS{} + toleration := []corev1.Toleration{} if nodeOS == kube.NodeOSWindows { userID := "ContainerAdministrator" securityCtx = &corev1.PodSecurityContext{ @@ -596,6 +597,13 @@ func (e *csiSnapshotExposer) createBackupPod( nodeSelector[kube.NodeOSLabel] = kube.NodeOSWindows podOS.Name = kube.NodeOSWindows + + toleration = append(toleration, corev1.Toleration{ + Key: "os", + Operator: "Equal", + Effect: "NoSchedule", + Value: "windows", + }) } else { userID := int64(0) securityCtx = &corev1.PodSecurityContext{ @@ -666,6 +674,7 @@ func (e *csiSnapshotExposer) createBackupPod( Volumes: volumes, RestartPolicy: corev1.RestartPolicyNever, SecurityContext: securityCtx, + Tolerations: toleration, }, } diff --git a/pkg/exposer/generic_restore.go b/pkg/exposer/generic_restore.go index b332c611a3..5dc39e5a90 100644 --- a/pkg/exposer/generic_restore.go +++ b/pkg/exposer/generic_restore.go @@ -418,6 +418,7 @@ func (e *genericRestoreExposer) createRestorePod(ctx context.Context, ownerObjec var securityCtx *corev1.PodSecurityContext nodeSelector := map[string]string{} podOS := corev1.PodOS{} + toleration := []corev1.Toleration{} if nodeType == kube.NodeOSWindows { userID := "ContainerAdministrator" securityCtx = &corev1.PodSecurityContext{ @@ -428,6 +429,13 @@ func (e *genericRestoreExposer) createRestorePod(ctx context.Context, ownerObjec nodeSelector[kube.NodeOSLabel] = kube.NodeOSWindows podOS.Name = kube.NodeOSWindows + + toleration = append(toleration, corev1.Toleration{ + Key: "os", + Operator: "Equal", + Effect: "NoSchedule", + Value: "windows", + }) } else { userID := int64(0) securityCtx = &corev1.PodSecurityContext{ @@ -480,6 +488,7 @@ func (e *genericRestoreExposer) createRestorePod(ctx context.Context, ownerObjec NodeName: selectedNode, RestartPolicy: corev1.RestartPolicyNever, SecurityContext: securityCtx, + Tolerations: toleration, }, }