Skip to content

Commit 3ede9e6

Browse files
make injection use helm
1 parent 866d8d4 commit 3ede9e6

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

.github/workflows/analyze.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,5 @@ jobs:
3030
run: |
3131
istioctl analyze -A --use-kube=false \
3232
--failure-threshold ERROR \
33-
$(find . -not -path "*/.git*/*" -not -path "*/clusters/*" -name "*.yaml" -type f)
33+
$(find . -not -path "*/.git*/*" -not -path "*/clusters/*" \
34+
-not -name "*.patch.yaml" -not -name "kustomization.yaml" -name "*.yaml" -type f)

.github/workflows/inject-sidecar.yaml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ jobs:
2525
uses: istio/[email protected]
2626
with:
2727
version: ${{ env.ISTIO_VERSION }}
28+
- uses: azure/setup-helm@v1
29+
id: install
2830
- name: Get Istioctl
2931
run: |
3032
istioctl version --remote=false
@@ -36,14 +38,14 @@ jobs:
3638
id: inject
3739
run: |
3840
# hydrate isto manifest into configmap files
39-
istioctl manifest generate \
40-
-f istio/system/profile.yaml > manifests.yaml
41-
echo "first yq"
42-
cat manifests.yaml | yq e '. | select(.kind == "ConfigMap" and .metadata.name =="istio-sidecar-injector") | .data.config' - > injector.yaml
43-
echo "second yq"
44-
cat manifests.yaml | yq e '. | select(.kind == "ConfigMap" and .metadata.name =="istio-sidecar-injector") | .data.values' - > values.yaml
45-
echo "third yq"
46-
cat manifests.yaml | yq e '. | select(.kind == "ConfigMap" and .metadata.name =="istio") | .data.mesh' - > mesh.yaml
41+
42+
URI=$(cat istio/system/istio.yaml | yq e '. | select(.kind == "HelmRepository" and .metadata.name =="istio") | .spec.url' -)
43+
cat istio/system/istio.yaml | yq e '. | select(.kind == "HelmRelease" and .metadata.name =="istiod") | .spec.values' - > values.yaml
44+
VERSION=$(cat clusters/my-cluster/istio-version.yaml | yq e '.data.version' -)
45+
helm repo add istio $URI
46+
helm template -f values.yaml --version $VERSION istiod istio/istiod | yq e '.| select(.kind == "ConfigMap" and .metadata.name == "istio-sidecar-injector") | .data.config' - > injector.yaml
47+
helm template -f values.yaml --version $VERSION istiod istio/istiod | yq e '.| select(.kind == "ConfigMap" and .metadata.name == "istio") | .data.mesh' - > mesh.yaml
48+
helm template -f values.yaml --version $VERSION istiod istio/istiod | yq e '.| select(.kind == "ConfigMap" and .metadata.name == "istio-sidecar-injector") | .data.values' - > inj-values.yaml
4749
4850
python -m pip install jsonpatch
4951
@@ -55,7 +57,7 @@ jobs:
5557
istioctl kube-inject \
5658
--injectConfigFile injector.yaml \
5759
--meshConfigFile mesh.yaml \
58-
--valuesFile values.yaml \
60+
--valuesFile inj-values.yaml \
5961
-f $1 -o $NAME.gen.$EXTENSION
6062
6163
# injected yaml ends with '---', so remove before converting to json

0 commit comments

Comments
 (0)