Skip to content
This repository was archived by the owner on Aug 2, 2019. It is now read-only.

Commit 2eee186

Browse files
committed
Ben's patch of istio to 1.0.7 to fix vulnerability
1 parent 79f0f94 commit 2eee186

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

etc/scripts/installation-functions.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ KNATIVE_SERVING_VERSION=v0.4.1
99
KNATIVE_BUILD_VERSION=v0.4.0
1010
KNATIVE_EVENTING_VERSION=v0.4.1
1111

12+
readonly ISTIO_IMAGE_REPO="docker.io/istio/"
13+
readonly ISTIO_PATCH_VERSION="1.0.7"
14+
1215
INSTALL_SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
1316

1417
CMD=kubectl
@@ -345,4 +348,31 @@ function patch_istio_for_knative() {
345348
$CMD delete pod -n istio-system -l istio=sidecar-injector
346349
wait_for_all_pods istio-system
347350
fi
351+
352+
# Patch the sidecar injector configmap up to $ISTIO_PATCH_VERSION
353+
oc get -n istio-system configmap/istio-sidecar-injector -o yaml | sed "s/:1.0.[[:digit:]]\+/:${ISTIO_PATCH_VERSION}/g" | oc replace -f -
354+
355+
# Ensure Istio $ISTIO_PATCH_VERSION is used everywhere
356+
echo "Patching Istio images up to $ISTIO_PATCH_VERSION"
357+
patch_istio_deployment istio-galley 0 galley || return 1
358+
patch_istio_deployment istio-egressgateway 0 proxyv2 || return 1
359+
patch_istio_deployment istio-ingressgateway 0 proxyv2 || return 1
360+
patch_istio_deployment istio-policy 0 mixer || return 1
361+
patch_istio_deployment istio-policy 1 proxyv2 || return 1
362+
patch_istio_deployment istio-telemetry 0 mixer || return 1
363+
patch_istio_deployment istio-telemetry 1 proxyv2 || return 1
364+
patch_istio_deployment istio-pilot 0 pilot || return 1
365+
patch_istio_deployment istio-pilot 1 proxyv2 || return 1
366+
patch_istio_deployment istio-citadel 0 citadel || return 1
367+
patch_istio_deployment istio-sidecar-injector 0 sidecar_injector || return 1
368+
369+
wait_for_deployment istio-system istio-galley
370+
wait_for_all_pods istio-system || return 1
371+
}
372+
373+
function patch_istio_deployment() {
374+
local deployment="$1"
375+
local containerIndex=$2
376+
local imageName=$3
377+
oc patch -n istio-system deployment/${deployment} --type json -p "[{\"op\": \"replace\", \"path\": \"/spec/template/spec/containers/${containerIndex}/image\", \"value\":\"${ISTIO_IMAGE_REPO}${imageName}:${ISTIO_PATCH_VERSION}\"}]"
348378
}

0 commit comments

Comments
 (0)