mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Merge pull request #36864 from dims/fix-path-to-kubectl-in-gke-test
Fix path to kubectl on host in kubectl-in-pod
This commit is contained in:
commit
01897bb3c0
@ -566,8 +566,15 @@ var _ = framework.KubeDescribe("Kubectl client", func() {
|
|||||||
framework.SkipUnlessProviderIs("gke")
|
framework.SkipUnlessProviderIs("gke")
|
||||||
nsFlag := fmt.Sprintf("--namespace=%v", ns)
|
nsFlag := fmt.Sprintf("--namespace=%v", ns)
|
||||||
podJson := readTestFileOrDie(kubectlInPodFilename)
|
podJson := readTestFileOrDie(kubectlInPodFilename)
|
||||||
|
|
||||||
|
// Replace the host path to kubectl in json
|
||||||
|
podString := strings.Replace(string(podJson),
|
||||||
|
"$KUBECTL_PATH",
|
||||||
|
framework.TestContext.KubectlPath,
|
||||||
|
1)
|
||||||
|
|
||||||
By("validating api verions")
|
By("validating api verions")
|
||||||
framework.RunKubectlOrDieInput(string(podJson), "create", "-f", "-", nsFlag)
|
framework.RunKubectlOrDieInput(podString, "create", "-f", "-", nsFlag)
|
||||||
err := wait.PollImmediate(time.Second, time.Minute, func() (bool, error) {
|
err := wait.PollImmediate(time.Second, time.Minute, func() (bool, error) {
|
||||||
output := framework.RunKubectlOrDie("get", "pods/kubectl-in-pod", nsFlag)
|
output := framework.RunKubectlOrDie("get", "pods/kubectl-in-pod", nsFlag)
|
||||||
if strings.Contains(output, "Running") {
|
if strings.Contains(output, "Running") {
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
],
|
],
|
||||||
"volumes": [{
|
"volumes": [{
|
||||||
"name":"kubectl",
|
"name":"kubectl",
|
||||||
"hostPath":{"path": "/usr/bin/kubectl"}
|
"hostPath":{"path": "$KUBECTL_PATH"}
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user