File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ var mergeYamlCmd = &cobra.Command{
46
46
if outFile == "" {
47
47
fmt .Println (string (config ))
48
48
} else {
49
- if err := os .WriteFile (outFile , config , 0644 ); err != nil {
49
+ if err := os .WriteFile (outFile , config , 0o644 ); err != nil {
50
50
cmd .Annotations ["error" ] = err .Error ()
51
51
return
52
52
}
@@ -56,6 +56,7 @@ var mergeYamlCmd = &cobra.Command{
56
56
// Wait for a second to allow for any pending log messages to be flushed
57
57
time .Sleep (1 * time .Second )
58
58
if cmd .Annotations ["error" ] != "" {
59
+ fmt .Printf ("Error: %s\n " , cmd .Annotations ["error" ])
59
60
os .Exit (1 )
60
61
}
61
62
},
Original file line number Diff line number Diff line change 3
3
# check if /config.yaml exists
4
4
if [ ! -f /config.yaml ]; then
5
5
/docker-sync mergeYaml -o /config.yaml -f /config_map.yaml -f /secret.yaml
6
+ if [ $? -ne 0 ]; then
7
+ echo " Error merging YAML files. Exiting."
8
+ exit 1
9
+ fi
6
10
fi
7
11
8
12
/docker-sync " $@ "
You can’t perform that action at this time.
0 commit comments