未验证 提交 2d804f3b 编写于 作者: M Medya Gh

windows literal

上级 cba331b9
......@@ -208,12 +208,10 @@ jobs:
continue-on-error: true
shell: powershell
run: |
$ErrorActionPreference = "SilentlyContinue"
(New-Object Net.WebClient).DownloadFile("https://github.com/medyagh/gopogh/releases/download/v0.1.23/gopogh.exe", "C:\ProgramData\chocolatey\bin\gopogh.exe")
choco install -y kubernetes-cli
choco install -y jq
$DockerKubectl = "C:\Program Files\Docker\Docker\resources\bin\kubectl.exe"
if (Test-Path $DockerKubectl) { Remove-Item $DockerKubectl}
if (Test-Path 'C:\Program Files\Docker\Docker\resources\bin\kubectl.exe') { Remove-Item 'C:\Program Files\Docker\Docker\resources\bin\kubectl.exe'};
- name: Run Integration Test in powershell
continue-on-error: true
shell: powershell
......@@ -324,7 +322,7 @@ jobs:
(New-Object Net.WebClient).DownloadFile("https://github.com/medyagh/gopogh/releases/download/v0.1.23/gopogh.exe", "C:\ProgramData\chocolatey\bin\gopogh.exe")
choco install -y kubernetes-cli
choco install -y jq
Remove-Item "C:\Program Files\Docker\Docker\resources\bin\kubectl.exe"
if (Test-Path 'C:\Program Files\Docker\Docker\resources\bin\kubectl.exe') { Remove-Item 'C:\Program Files\Docker\Docker\resources\bin\kubectl.exe'};
- name: Run Integration Test in powershell
continue-on-error: true
shell: powershell
......
......@@ -152,8 +152,10 @@ func validateServiceStable(ctx context.Context, t *testing.T, profile string) {
// Wait until the nginx-svc has a loadbalancer ingress IP
err = wait.PollImmediate(3*time.Second, Minutes(4), func() (bool, error) {
cmd := exec.CommandContext(ctx, "kubectl", "--context", profile, "get", "svc", "nginx-svc", "-o", "jsonpath={.status.loadBalancer.ingress[0].ip}")
// https://kubernetes.io/docs/reference/kubectl/jsonpath/
// On Windows, you must use a single quote or escaped double quote around any literals in the template.
if runtime.GOOS == "windows" {
cmd = exec.CommandContext(ctx, "powershell.exe", "-NoProfile", "-NonInteractive", "kubectl --context "+profile+" get svc nginx-svc -o jsonpath={.status.loadBalancer.ingress[0].ip}")
cmd = exec.CommandContext(ctx, "powershell.exe", "-NoProfile", "-NonInteractive", "kubectl --context "+profile+" get svc nginx-svc -o jsonpath=\"{.status.loadBalancer.ingress[0].ip}\"")
}
rr, err := Run(t, cmd)
if err != nil {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册