limited-rainbow-51650
06/12/2020, 2:57 PMcommand:
- bash
- -ec
- |
# Execute entrypoint as usual after obtaining ZOO_SERVER_ID based on POD hostname
HOSTNAME=`hostname -s`
if [[ $HOSTNAME =~ (.*)-([0-9]+)$ ]]; then
ORD=${BASH_REMATCH[2]}
export ZOO_SERVER_ID=$((ORD+1))
else
echo "Failed to get index from hostname $HOST"
exit 1
fi
exec /entrypoint.sh /run.sh
gorgeous-egg-16927
06/12/2020, 4:13 PMcommand
takes list of strings, so you should be able to do something like this:
command: [
"bash",
"-ec",
`|
#Execute entrypooint...
`]
limited-rainbow-51650
06/12/2020, 4:20 PM- |-
|
# Execute entrypoint as usual after obtaining ZOO_SERVER_ID based on POD hostname
Where does the first pipe character come from?
Here is my code:
const command =
`|
# Execute entrypoint as usual after obtaining ZOO_SERVER_ID based on POD hostname
HOSTNAME=\`hostname -s\`
if [[ $HOSTNAME =~ (.*)-([0-9]+)$ ]]; then
ORD=\${BASH_REMATCH[2]}
export ZOO_SERVER_ID=$((ORD+1))
else
echo "Failed to get index from hostname $HOST"
exit 1
fi
exec /entrypoint.sh /run.sh`
...
command: [
'bash',
'-ec',
command
],
gorgeous-egg-16927
06/12/2020, 4:24 PMhostname -s
. Not sure where the extra pipe is coming fromlimited-rainbow-51650
06/12/2020, 4:25 PM|-
) put there by Pulumi?gorgeous-egg-16927
06/12/2020, 4:26 PM