Add -u to anchor scripts

This adds "set -u" (in addition to the existing -x) to the anchor
scripts. This should fix an issue seen occasionally in the haproxy
chart which is only explainable by the IDENTIFIER variable failing
to get set correctly.

All variables used in the anchor scripts ought to be defined, and
there's no need to rely on blank strings as defaults.

"set -e" was considered for this, but may have unintended side-effects:
-u should be safe and avoid the issue we've seen.

Change-Id: Idbc2f9f77d4754874999d5d83d322a17076c7392
This commit is contained in:
Matt McEuen 2020-02-03 13:57:23 -06:00
parent 6db4c70e9e
commit 1d0a4619b4
5 changed files with 5 additions and 5 deletions

View File

@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
set -x
set -xu
snapshot_files() {
SNAPSHOT_DIR=${1}

View File

@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
set -x
set -xu
compare_copy_files() {

View File

@ -12,7 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -x
set -xu
TEMP_MANIFEST=/tmp/etcd.yaml
sync_file () {

View File

@ -17,7 +17,7 @@ limitations under the License.
{{- $envAll := . }}
set -x
set -xu
compare_copy_files() {
{{- range .Values.conf.anchor.files_to_copy }}

View File

@ -15,7 +15,7 @@
# limitations under the License.
*/}}
set -x
set -xu
compare_copy_files() {
{{- range .Values.anchor.files_to_copy }}