Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 39c1aaa

Browse files
authored
Merge pull request kubernetes#35383 from bprashanth/gcloud_regex_1.3
Manual cherry-pick of kubernetes#35346
2 parents b10a49a + 1a48382 commit 39c1aaa

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

test/e2e/ingress.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -451,17 +451,22 @@ func gcloudList(resource, regex, project string, out interface{}) {
451451
// so we only look at stdout.
452452
command := []string{
453453
"compute", resource, "list",
454-
fmt.Sprintf("--regex=%v", regex),
454+
fmt.Sprintf("--regexp=%v", regex),
455455
fmt.Sprintf("--project=%v", project),
456456
"-q", "--format=json",
457457
}
458458
output, err := exec.Command("gcloud", command...).Output()
459459
if err != nil {
460460
errCode := -1
461+
errMsg := ""
461462
if exitErr, ok := err.(utilexec.ExitError); ok {
462463
errCode = exitErr.ExitStatus()
464+
errMsg = exitErr.Error()
465+
if osExitErr, ok := err.(*exec.ExitError); ok {
466+
errMsg = fmt.Sprintf("%v, stderr %v", errMsg, string(osExitErr.Stderr))
467+
}
463468
}
464-
framework.Logf("Error running gcloud command 'gcloud %s': err: %v, output: %v, status: %d", strings.Join(command, " "), err, string(output), errCode)
469+
framework.Logf("Error running gcloud command 'gcloud %s': err: %v, output: %v, status: %d, msg: %v", strings.Join(command, " "), err, string(output), errCode, errMsg)
465470
}
466471
if err := json.Unmarshal([]byte(output), out); err != nil {
467472
framework.Logf("Error unmarshalling gcloud output for %v: %v, output: %v", resource, err, string(output))

0 commit comments

Comments
 (0)