mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +00:00
Fix CreateSecPodWithNodeName to properly set node to be deployed
This commit is contained in:
parent
3bcbc5da79
commit
6a94656d0e
@ -880,12 +880,13 @@ func CreateSecPod(client clientset.Interface, namespace string, pvclaims []*v1.P
|
|||||||
// create security pod with given claims
|
// create security pod with given claims
|
||||||
func CreateSecPodWithNodeName(client clientset.Interface, namespace string, pvclaims []*v1.PersistentVolumeClaim, isPrivileged bool, command string, hostIPC bool, hostPID bool, seLinuxLabel *v1.SELinuxOptions, fsGroup *int64, nodeName string, timeout time.Duration) (*v1.Pod, error) {
|
func CreateSecPodWithNodeName(client clientset.Interface, namespace string, pvclaims []*v1.PersistentVolumeClaim, isPrivileged bool, command string, hostIPC bool, hostPID bool, seLinuxLabel *v1.SELinuxOptions, fsGroup *int64, nodeName string, timeout time.Duration) (*v1.Pod, error) {
|
||||||
pod := MakeSecPod(namespace, pvclaims, isPrivileged, command, hostIPC, hostPID, seLinuxLabel, fsGroup)
|
pod := MakeSecPod(namespace, pvclaims, isPrivileged, command, hostIPC, hostPID, seLinuxLabel, fsGroup)
|
||||||
|
// Setting nodeName
|
||||||
|
pod.Spec.NodeName = nodeName
|
||||||
|
|
||||||
pod, err := client.CoreV1().Pods(namespace).Create(pod)
|
pod, err := client.CoreV1().Pods(namespace).Create(pod)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("pod Create API error: %v", err)
|
return nil, fmt.Errorf("pod Create API error: %v", err)
|
||||||
}
|
}
|
||||||
// Setting nodeName
|
|
||||||
pod.Spec.NodeName = nodeName
|
|
||||||
|
|
||||||
// Waiting for pod to be running
|
// Waiting for pod to be running
|
||||||
err = WaitTimeoutForPodRunningInNamespace(client, pod.Name, namespace, timeout)
|
err = WaitTimeoutForPodRunningInNamespace(client, pod.Name, namespace, timeout)
|
||||||
|
@ -342,7 +342,7 @@ func testVolumeModeSuccessForDynamicPV(input *volumeModeTestInput) {
|
|||||||
var err error
|
var err error
|
||||||
|
|
||||||
// TODO: This skip should be removed once #70760 is fixed
|
// TODO: This skip should be removed once #70760 is fixed
|
||||||
skipTestUntilBugfix("70760", input.driverName, []string{"csi-hostpath", "com.google.csi.gcepd"})
|
skipTestUntilBugfix("70760", input.driverName, []string{"com.google.csi.gcepd"})
|
||||||
|
|
||||||
By("Creating sc")
|
By("Creating sc")
|
||||||
input.sc, err = cs.StorageV1().StorageClasses().Create(input.sc)
|
input.sc, err = cs.StorageV1().StorageClasses().Create(input.sc)
|
||||||
|
Loading…
Reference in New Issue
Block a user