mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Merge pull request #100377 from mauriciopoppe/storage-windows-e2e-tests
Fix "Pod Disks schedule pods each with a PD" test in windows
This commit is contained in:
commit
97bdd7b9eb
@ -142,6 +142,10 @@ func (tk *TestKubeconfig) WriteFileViaContainer(podName, containerName string, p
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
command := fmt.Sprintf("echo '%s' > '%s'; sync", contents, path)
|
command := fmt.Sprintf("echo '%s' > '%s'; sync", contents, path)
|
||||||
|
// TODO(mauriciopoppe): remove this statement once we add `sync` to the test image, ref #101172
|
||||||
|
if e2epod.NodeOSDistroIs("windows") {
|
||||||
|
command = fmt.Sprintf("echo '%s' > '%s';", contents, path)
|
||||||
|
}
|
||||||
stdout, stderr, err := tk.kubectlExecWithRetry(tk.Namespace, podName, containerName, "--", "/bin/sh", "-c", command)
|
stdout, stderr, err := tk.kubectlExecWithRetry(tk.Namespace, podName, containerName, "--", "/bin/sh", "-c", command)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
e2elog.Logf("error running kubectl exec to write file: %v\nstdout=%v\nstderr=%v)", err, string(stdout), string(stderr))
|
e2elog.Logf("error running kubectl exec to write file: %v\nstdout=%v\nstderr=%v)", err, string(stdout), string(stderr))
|
||||||
|
@ -596,7 +596,7 @@ func testPDPod(diskNames []string, targetNode types.NodeName, readOnly bool, num
|
|||||||
if numContainers > 1 {
|
if numContainers > 1 {
|
||||||
containers[i].Name = fmt.Sprintf("mycontainer%v", i+1)
|
containers[i].Name = fmt.Sprintf("mycontainer%v", i+1)
|
||||||
}
|
}
|
||||||
containers[i].Image = imageutils.GetE2EImage(imageutils.BusyBox)
|
containers[i].Image = e2epod.GetTestImage(imageutils.BusyBox)
|
||||||
containers[i].Command = []string{"sleep", "6000"}
|
containers[i].Command = []string{"sleep", "6000"}
|
||||||
containers[i].VolumeMounts = make([]v1.VolumeMount, len(diskNames))
|
containers[i].VolumeMounts = make([]v1.VolumeMount, len(diskNames))
|
||||||
for k := range diskNames {
|
for k := range diskNames {
|
||||||
@ -636,7 +636,7 @@ func testPDPod(diskNames []string, targetNode types.NodeName, readOnly bool, num
|
|||||||
pod.Spec.Volumes[k].VolumeSource = v1.VolumeSource{
|
pod.Spec.Volumes[k].VolumeSource = v1.VolumeSource{
|
||||||
GCEPersistentDisk: &v1.GCEPersistentDiskVolumeSource{
|
GCEPersistentDisk: &v1.GCEPersistentDiskVolumeSource{
|
||||||
PDName: diskName,
|
PDName: diskName,
|
||||||
FSType: "ext4",
|
FSType: e2epv.GetDefaultFSType(),
|
||||||
ReadOnly: readOnly,
|
ReadOnly: readOnly,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user