Closed jmreicha closed 5 years ago
Good catch. Actually the fix might be as simple as removing the colon. So it would become
SUMO_COLLECTOR_NAME=${SUMO_COLLECTOR_NAME_PREFIX='collector_container-'}${SUMO_COLLECTOR_NAME:=`cat /etc/hostname`}
see https://stackoverflow.com/a/26899206 specifically this case:
EGGS=
: ${EGGS=spam}
echo 3 $EGGS # 3 (set, but blank -> leaves alone)
EGGS=
: ${EGGS:=spam}
echo 4 $EGGS # 4 spam
@maimaisie ah thank you, I was thinking there was an easier way to do it, just couldn't see it. I will update the PR.
Thanks for fixing! We will run some tests before releasing new builds.
Fixes https://github.com/SumoLogic/sumologic-collector-docker/issues/70 by adding logic for handling an empty environment variable, in order to create custom collector name with no prefix.