Skip to content

Instantly share code, notes, and snippets.

@mandarjog
Created November 6, 2019 21:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mandarjog/c5fd7201e0d0618d562d0b18cbeebfd8 to your computer and use it in GitHub Desktop.
Save mandarjog/c5fd7201e0d0618d562d0b18cbeebfd8 to your computer and use it in GitHub Desktop.
Pilot Script config map
apiVersion: v1
kind: ConfigMap
metadata:
name: script
data:
run.sh: |
#!/bin/bash
set -ex
WD=$(dirname $0)
WD=$(cd $WD;pwd)
EXEC=/usr/local/bin/pilot-discovery
# set or unset any env vars here
unset PILOT_DISABLE_XDS_MARSHALING_TO_ANY
# cannot just pass "$@" since empty args are not treated correctly.
# arrange args
EARGS=""
for arg in "$@";
do
if [[ "${arg}" == --* && "${arg}" != *=* ]];then
EARGS+="$arg="
else
EARGS+="$arg "
fi
done
# delegate to the pilot
"${EXEC}" ${EARGS}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment