docs: use pipefail option in shell commands to prevent accidental deletions #597
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
When using a pipe in shell commands (
|
) it is critical that the pipefail option is used, otherwise the second command in the pipeline silently overwrites any errors from the first command.Argo CD will then treat the
stdout
output as valid (even if it is empty), which can have catastrophic effects: deleting all resources belonging to the Application/ApplicationSet.Several users have already been hit by this: #533
Therefore I believe it is very important that the correct commands are shown in the documentation.
Fixes: #533
Checklist
Please make sure that your PR fulfills the following requirements:
go mod tidy -compat=1.21
to ensure only the minimum is pulled in.Type of Change