GoogleContainerTools / GoogleContainerTools/skaffold
Output of `render` is corrupted with error messages
- Dominant language
- Go
- Stars
- 15.9k
- Forks
- 1.7k
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 10
Description
### Expected behavior
If something goes wrong during `skaffold render`, it should print a message to stderr/stdout and exit with a non-zero status code if the problem is fatal.
### Actual behavior
Error messages are included in the actual output file and `render` returns a zero exit code.
### Information
- Skaffold version: v1.25.0
- Operating system: Linux
- Installed via: skaffold.dev
The error in this case looks like this:
```
kubectl client version: unknown
couldn't get kubectl minor version: strconv.Atoi: parsing "unknown": invalid syntax
```
See cl/377891886 internally.
Skaffold is being run as `skaffold render --digest-source=local --loud --output=release.yaml`.
Standard output includes these warnings:
```
time="2021-06-07T12:19:02Z" level=warning msg="unable to get kubectl client version: starting command kubectl version --client -ojson: exec: \"kubectl\": executable file not found in $PATH"
time="2021-06-07T12:19:02Z" level=warning msg="k8s/*.yaml did not match any file"
time="2021-06-07T12:19:02Z" level=warning msg="unable to get kubectl client version: starting command kubectl version --client -ojson: exec: \"kubectl\": executable file not found in $PATH"
```
So the underlying issue here is probably that kubectl isn't installed in my build environment. But the rendered manifest is otherwise fine, so ideally this should just be a warning that doesn't mess up the output. At worse this should cause skaffold to fail with an error so that the output isn't silently corrupted.
Contributor guide
Assessment
This issue has not been assessed yet.