-
Bug
-
Resolution: Done
-
Major
-
1.4.1.Final
-
None
-
False
-
False
-
Undefined
-
-
Linux has patchy support for hyphen-containing ENV vars. Docker and most of this image does support them.
Unfortunately in one place it does not and this prevents configuring the image correctly for Apicurio correctly.
e.g.
CONNECT_KEY_CONVERTER_APICURIO_REGISTRY_GLOBAL-ID: io.apicurio.registry.utils.serde.strategy.CachedSchemaIdStrategy
The script in question within the connect-base image: /kafka/bin/docker-entrypoint.sh
It contains an indirect variable reference using a ENV var as the lookup. This works fine until there is a hyphen in the ENV var name in which case it very helpfully sets the correct variable to 'empty' without informing you.
An example of the offending in the script:
prop_name=`echo "$VAR" | sed -r "s/^CONNECT_(.*)=.*/\1/g" | tr '[:upper:]' '[:lower:]' | tr _ .` [...] echo "$prop_name=${!env_var}" >> $KAFKA_HOME/config/connect-distributed.properties
The fix I have used for my situation is below.
It may work in all cases unless there is a requirement I am not aware of that requires that indirect reference:
prop_name=`echo "$VAR" | sed -r "s/^CONNECT_(.*)=.*/\1/g" | tr '[:upper:]' '[:lower:]' | tr _ .` prop_value=`echo "$VAR" | sed -r "s/^CONNECT_.*=(.*)/\1/g"` [...] echo "$prop_name=${prop_value}" >> $KAFKA_HOME/config/connect-distributed.properties