forked from wurstmeister/kafka-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BUG] Evaluate each env var as a single value (wurstmeister#316)
* [BUG] Evaluate each env var as a single value currently we keep the standard IFS, which means we can split on spaces + carriage returns, This is mainly problematic for any env var that has a reference to <space>KAFKA as this will get interpreted as it's own new env var. Fixes wurstmeister#313 Allows work-around for wurstmeister#312
- Loading branch information
Showing
3 changed files
with
63 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash -e | ||
|
||
source test.functions | ||
|
||
testKafkaOpts() { | ||
# Given required settings are provided | ||
export KAFKA_ADVERTISED_LISTENERS="PLAINTEXT://:9092" | ||
export KAFKA_LISTENERS="PLAINTEXT://:9092" | ||
# .. and a CUSTOM_INIT_SCRIPT with spaces | ||
export CUSTOM_INIT_SCRIPT="export KAFKA_OPTS=-Djava.security.auth.login.config=/kafka_server_jaas.conf" | ||
|
||
# When the script is invoked | ||
source "$START_KAFKA" | ||
|
||
# Then the custom init script should be evaluated | ||
if [[ ! "$KAFKA_OPTS" == "-Djava.security.auth.login.config=/kafka_server_jaas.conf" ]]; then | ||
echo "KAFKA_OPTS not set to expected value. $KAFKA_OPTS" | ||
exit 1 | ||
fi | ||
|
||
echo " > Set KAFKA_OPTS=$KAFKA_OPTS" | ||
} | ||
|
||
testKafkaOpts |