Windows tests: Makes gMSA test more nanoserver friendly

Nanoserver does not have powershell. This commit will replace the powershell
command with its cmd equivalent.
This commit is contained in:
Claudiu Belu 2020-04-13 08:04:28 -07:00
parent 2624a4ad46
commit 335dc6e2ee

View File

@ -208,9 +208,7 @@ func retrieveCRDManifestFileContents(f *framework.Framework, node v1.Node) strin
}
f.PodClient().CreateSync(pod)
// using powershell and using forward slashes avoids the nightmare of having to properly
// escape quotes and backward slashes
output, err := runKubectlExecInNamespace(f.Namespace.Name, podName, "powershell", "Get-Content", strings.ReplaceAll(gmsaCrdManifestPath, `\`, "/"))
output, err := runKubectlExecInNamespace(f.Namespace.Name, podName, "cmd", "/S", "/C", fmt.Sprintf("type %s", gmsaCrdManifestPath))
if err != nil {
framework.Failf("failed to retrieve the contents of %q on node %q: %v", gmsaCrdManifestPath, node.Name, err)
}