Skaffold ignores helm post renderer's errors and destroys deployment
Agalin opened this issue · comments
Expected behavior
When Skaffold is configured with Helm as a deployer and --post-renderer
is used in Helm, Skaffold should fail the deployment if configured post renderer exits with code other than 0
. It worked like that in Skaffold v1.
Actual behavior
Skaffold ignores post renderer's exit codes and deploys everything it gets from post renderer's output... even if there is no output. In this case it effectively removes everything already deployed.
For some reason I'm not able to reproduce it using a remote chart. Seems like post renderer isn't called in this case.
Information
- Skaffold version: 2.10.1
- Operating system: macOS 14.4
- Installed via: Homebrew
- Contents of skaffold.yaml:
apiVersion: skaffold/v4beta9
kind: Config
deploy:
helm:
releases:
- name: hello
chartPath: helm
flags:
install: &helmFlags
- --post-renderer=./error.sh
upgrade: *helmFlags
kubeContext: playground
Content of error.sh
:
#!/bin/sh
echo "failing" >> error.log
echo "failing" >&2
exit 1
Steps to reproduce the behavior
- Deploy anything through skaffold with post renderer disabled.
- Enable post renderer.
- Deploy again. <- Skaffold v1 throws an error here and prints post renderer's stderr.
- Observe deployment being removed.
Note: I'm aware of Skaffold-native renderer hooks and would gladly switch to those as not only are errors handled properly there but also output is much better. The problem is I'm not aware of any ways to keep deploying through Helm while using those hooks.