mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-11 06:02:18 +00:00
e2e: avoid setting NodeName for CSI driver deployments
We don't want to set the name directly because then starting the pod can fail when the node is temporarily out of resources (https://github.com/kubernetes/kubernetes/issues/87855). For CSI driver deployments, we have three options: - modify the pod spec with custom code, similar to how the NodeSelection utility code does it - add variants of SetNodeSelection and SetNodeAffinity which work with a pod spec instead of a pod - change their parameter from pod to pod spec and then use them also when patching a pod spec The last approach is used here because it seems more general. There might be other cases in the future where there's only a pod spec that needs to be modified.
This commit is contained in:
@@ -215,7 +215,7 @@ func (t *volumeModeTestSuite) DefineTests(driver TestDriver, pattern testpattern
|
||||
ginkgo.By("Creating pod")
|
||||
pod := e2epod.MakeSecPod(l.ns.Name, []*v1.PersistentVolumeClaim{l.Pvc}, nil, false, "", false, false, e2epv.SELinuxLabel, nil)
|
||||
// Setting node
|
||||
e2epod.SetNodeSelection(pod, l.config.ClientNodeSelection)
|
||||
e2epod.SetNodeSelection(&pod.Spec, l.config.ClientNodeSelection)
|
||||
pod, err = l.cs.CoreV1().Pods(l.ns.Name).Create(context.TODO(), pod, metav1.CreateOptions{})
|
||||
framework.ExpectNoError(err, "Failed to create pod")
|
||||
defer func() {
|
||||
|
Reference in New Issue
Block a user