mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 14:07:14 +00:00
tests: Use Windows absolute path on Windows pods
The test "should fail substituting values in a volume subpath with absolute path" creates a pod with a variable expansion path which is set as an absolute path. However "/tmp" is not an absolute on Windows, it has to be prefixed with the drive letter (C:\tmp). But C:\tmp does not typically exist on Windows nodes, so we use C:\Users instead.
This commit is contained in:
parent
72a26aed7d
commit
8ca08f1ced
@ -181,11 +181,16 @@ var _ = framework.KubeDescribe("Variable Expansion", func() {
|
||||
Description: Make sure a container's subpath can not be set using an expansion of environment variables when absolute path is supplied.
|
||||
*/
|
||||
framework.ConformanceIt("should fail substituting values in a volume subpath with absolute path [sig-storage][Slow]", func() {
|
||||
absolutePath := "/tmp"
|
||||
if framework.NodeOSDistroIs("windows") {
|
||||
// Windows does not typically have a C:\tmp folder.
|
||||
absolutePath = "C:\\Users"
|
||||
}
|
||||
|
||||
envVars := []v1.EnvVar{
|
||||
{
|
||||
Name: "POD_NAME",
|
||||
Value: "/tmp",
|
||||
Value: absolutePath,
|
||||
},
|
||||
}
|
||||
mounts := []v1.VolumeMount{
|
||||
|
Loading…
Reference in New Issue
Block a user