fabric8io-images / s2i

OpenShift S2I images for Java and Karaf applications
Apache License 2.0
70 stars 84 forks source link

Support command line arg values with spaces #211

Closed michael-wirth closed 5 years ago

michael-wirth commented 5 years ago

command line arg values with spaces will be splitt in 2 values, but the value should pass through as is to the java process.

for example: /usr/local/s2i/run --script="new String(payload)" --other=param

will pass 3 args ["new","String(payload)", "--other=param"] instead of two ["new String(payload)", "--other=param"]

the issue can be easily fixed by quoting the pass through args

if [ -f "${DEPLOYMENTS_DIR}/bin/run.sh" ]; then
    echo "Starting the application using the bundled ${DEPLOYMENTS_DIR}/bin/run.sh ..."
    exec ${DEPLOYMENTS_DIR}/bin/run.sh "$@" ${JAVA_ARGS} # change $args -> "$@"
else
    echo "Starting the Java application using /opt/run-java/run-java.sh ..."
    exec /opt/run-java/run-java.sh "$@" ${JAVA_ARGS} # change $args -> "$@"
fi

quoting the $args won't fix the issue because that would cause that all args ["--script="new String(payload)" --other=param"] will be passed as one to the java applicaton

the same bug must be fixed in run-java.sh. see https://github.com/fabric8io-images/run-java-sh/issues/75

java/fish-pepper.yml must be updated, once the new run-java.sh release is ready

rhuss commented 5 years ago

214 updates run-java.sh which the referenced fixed. As soon as this merged you can rebase this PR and we should be able to merge this soonish.

vorburger commented 5 years ago

As soon as this merged you can rebase this PR and we should be able to merge this soonish.

The PR was #212, this is the issue; but it's fixed now.