fabric8io-images / s2i

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

Add wildcard into nonProxyHosts #163

Closed matleclaire closed 6 years ago

matleclaire commented 6 years ago

https://github.com/fabric8io-images/s2i/blob/c8452f3ada82bae6b162cd2fc87198e703e38c9d/karaf/images/rhel/run-java.sh#L465

Hi,

nonProxyHosts allows to use * for pattern matching. For example -Dhttp.nonProxyHosts=” *.foo.com|localhost”

But Openshift doesn't accept does not accept * attached to a domain suffix.

Your script can be improved to prefix .foo.com with a *. I've got this need on a professional and private project and we solve it with this script :

# Replace separator "," by "|"
JAVA_NO_PROXY=$(echo $no_proxy |  sed -e 's/,[[:space:]]*/|/g')
# Prefix hosts with a wildcard '*' (ex: '.svc' -> '*.svc') because OpenShift doesn't allow wildcards in  $no_proxy
JAVA_NO_PROXY=$(echo $JAVA_NO_PROXY | sed -e 's/^\./*./g'  | sed -e 's/|\./|*./g')

I hope it will help.

Kind regards,

Mathieu

references :

vorburger commented 6 years ago

@matleclaire would you be willing to turn what you describe above in text into an actual PR ?

matleclaire commented 6 years ago

Sure ! #164 has been created.

I'm closing this issue.