Fix air-gapped installation issues with containerd and OSM helm chart
[osm/devops.git] / installers / full_install_osm.sh
index 2f90bcf..6f80953 100755 (executable)
@@ -290,9 +290,17 @@ EOF"
     [ -n "${INSTALL_NGSA}" ] || OSM_HELM_OPTS="${OSM_HELM_OPTS} --set global.oldServiceAssurance=true"
     if [ -n "${OSM_BEHIND_PROXY}" ]; then
         OSM_HELM_OPTS="${OSM_HELM_OPTS} --set global.behindHttpProxy=true"
-        [ -n "${HTTP_PROXY}" ] && OSM_HELM_OPTS="${OSM_HELM_OPTS} --set global.httpProxy.HTTP_PROXY=${HTTP_PROXY}"
-        [ -n "${HTTPS_PROXY}" ] && OSM_HELM_OPTS="${OSM_HELM_OPTS} --set global.httpProxy.HTTPS_PROXY=${HTTPS_PROXY}"
-        [ -n "${NO_PROXY}" ] && OSM_HELM_OPTS="${OSM_HELM_OPTS} --set global.httpProxy.NO_PROXY=${NO_PROXY}"
+        [ -n "${HTTP_PROXY}" ] && OSM_HELM_OPTS="${OSM_HELM_OPTS} --set global.httpProxy.HTTP_PROXY=\"${HTTP_PROXY}\""
+        [ -n "${HTTPS_PROXY}" ] && OSM_HELM_OPTS="${OSM_HELM_OPTS} --set global.httpProxy.HTTPS_PROXY=\"${HTTPS_PROXY}\""
+        if [ -n "${NO_PROXY}" ]; then
+            if [[ ! "${NO_PROXY}" =~ .*".svc".* ]]; then
+                NO_PROXY="${NO_PROXY},.svc"
+            fi
+            if [[ ! "${NO_PROXY}" =~ .*".cluster.local".* ]]; then
+                NO_PROXY="${NO_PROXY},.cluster.local"
+            fi
+            OSM_HELM_OPTS="${OSM_HELM_OPTS} --set global.httpProxy.NO_PROXY=\"${NO_PROXY//,/\,}\""
+        fi
     fi
 
     if [ -n "${INSTALL_JUJU}" ]; then