File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -68,29 +68,28 @@ merge_configs() {
68
68
update_config () {
69
69
echo " Updating configuration with environment variables"
70
70
local config_file=" ${WORK_DIR} /agent.config"
71
+ local missing_configuration_params=" "
71
72
72
73
if sed -n " s|com.lightrun.server=.*|com.lightrun.server=https://${LIGHTRUN_SERVER} |p" " ${config_file} " | grep -q . ; then
73
74
# Perform actual in-place change
74
75
sed -i " s|com.lightrun.server=.*|com.lightrun.server=https://${LIGHTRUN_SERVER} |" " ${config_file} "
75
- exit 0
76
76
else
77
- echo " No match found"
78
- exit 1
77
+ missing_configuration_params=" ${missing_configuration_params} com.lightrun.server"
79
78
fi
80
79
if sed -n " s|com.lightrun.secret=.*|com.lightrun.secret=${LIGHTRUN_KEY} |p" " ${config_file} " | grep -q . ; then
81
80
# Perform actual in-place change
82
81
sed -i " s|com.lightrun.secret=.*|com.lightrun.secret=${LIGHTRUN_KEY} |" " ${config_file} "
83
- exit 0
84
82
else
85
- echo " No match found"
86
- exit 1
83
+ missing_configuration_params=" ${missing_configuration_params} com.lightrun.secret"
87
84
fi
88
85
if sed -n " s|pinned_certs=.*|pinned_certs=${PINNED_CERT} |p" " ${config_file} " | grep -q . ; then
89
86
# Perform actual in-place change
90
87
sed -i " s|pinned_certs=.*|pinned_certs=${PINNED_CERT} |" " ${config_file} "
91
- exit 0
92
88
else
93
- echo " No match found"
89
+ missing_configuration_params=" ${missing_configuration_params} pinned_certs"
90
+ fi
91
+ if [ -n " ${missing_configuration_params} " ]; then
92
+ echo " Error: Missing configuration parameters:${missing_configuration_params} "
94
93
exit 1
95
94
fi
96
95
}
You can’t perform that action at this time.
0 commit comments