File tree 3 files changed +21
-5
lines changed
3 files changed +21
-5
lines changed Original file line number Diff line number Diff line change @@ -75,10 +75,6 @@ func NewGenerateCommand() *cobra.Command {
75
75
return err
76
76
}
77
77
78
- if len (manifests ) == 0 {
79
- return fmt .Errorf ("No manifests" )
80
- }
81
-
82
78
for _ , manifest := range manifests {
83
79
84
80
template , err := kube .NewTemplate (manifest , cmdConfig .Backend )
Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ func TestMain(t *testing.T) {
80
80
t .Fatal (err )
81
81
}
82
82
83
- expected := "No manifests "
83
+ expected := ""
84
84
if ! strings .Contains (string (out ), expected ) {
85
85
t .Fatalf ("expected to contain: %s but got %s" , expected , out )
86
86
}
Original file line number Diff line number Diff line change @@ -337,3 +337,23 @@ spec:
337
337
annotations:
338
338
checksum/secret: <path:secrets/data/db#certs | sha256sum>
339
339
` ` `
340
+
341
+ # ## Error Handling
342
+
343
+ # ### Detecting errors in chained commands
344
+
345
+ By default argocd-vault-plugin will read valid kubernetes YAMLs and replace variables with values from Vault.
346
+ If a previous command failed and outputs nothing to stdout and AVP reads the input from stdin with
347
+ the `-` argument, AVP will forward an empty YAML output downstream. To catch and prevent accientental errors
348
+ in chained commands, please use the `-o pipefail` bash option like so :
349
+
350
+ ` ` ` bash
351
+ $ sh -c '((>&2 echo "some error" && exit 1) | argocd-vault-plugin generate - | kubectl diff -f -); echo $?;'
352
+ some error
353
+ 0
354
+
355
+ $ set -o pipefail
356
+ $ sh -c '((>&2 echo "some error" && exit 1) | argocd-vault-plugin generate - | kubectl diff -f -); echo $?;'
357
+ some error
358
+ 1
359
+ ` ` `
You can’t perform that action at this time.
0 commit comments