Skip to content

Commit

Permalink
Avoid unbound variable error
Browse files Browse the repository at this point in the history
/opt/cni/bin/aws-cni-support.sh: line 35: KUBECONFIG: unbound variable
set -u will abort here so see if the parameter is set and non-empty using an empty default value.

Pull request aws#382

(cherry picked from commit a34eae1)
  • Loading branch information
StevenACoffman authored and Claes Mogren committed Apr 8, 2019
1 parent fb6daad commit 49181af
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/aws-cni-support.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ curl http://localhost:61678/v1/eni-configs > ${LOG_DIR}/eni-configs.out
curl http://localhost:61678/metrics 2>&1 > ${LOG_DIR}/metrics.out

# Collecting kubelet introspection data
if [[ -n "${KUBECONFIG}" ]]; then
if [[ -n "${KUBECONFIG:-}" ]]; then
command -v kubectl > /dev/null && kubectl get --kubeconfig=${KUBECONFIG} --raw=/api/v1/pods > ${LOG_DIR}/kubelet.out
elif [[ -f /etc/systemd/system/kubelet.service ]]; then
KUBECONFIG=`grep kubeconfig /etc/systemd/system/kubelet.service | awk '{print $2}'`
Expand Down

0 comments on commit 49181af

Please sign in to comment.