Skip to content
This repository has been archived by the owner on Mar 31, 2023. It is now read-only.

kubectlWait function can loop forever #233

Open
bboreham opened this issue Jun 19, 2020 · 0 comments
Open

kubectlWait function can loop forever #233

bboreham opened this issue Jun 19, 2020 · 0 comments
Labels
chore Related to fix/refinement/improvement of end user or new/existing developer functionality

Comments

@bboreham
Copy link
Contributor

This loop:

for {
cmd := fmt.Sprintf("kubectl get %q %s%s", args.WaitType, waitOn(args), waitNamespace(args))
output, err := r.RunCommand(withoutProxy(cmd), nil)
if err != nil || strings.Contains(output, "No resources found") {
time.Sleep(500 * time.Millisecond)
} else {
break
}
}

will go forever if RunCommand() keeps erroring.

I think at least it should stop after the WaitTimeout, and probably return immediately on unexpected error.

@bboreham bboreham added the chore Related to fix/refinement/improvement of end user or new/existing developer functionality label Jun 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
chore Related to fix/refinement/improvement of end user or new/existing developer functionality
Projects
None yet
Development

No branches or pull requests

1 participant