Skip to content

Commit 985210a

Browse files
committed
Use get-istioctl action in the analyze workflow
Signed-off-by: Stefan Prodan <[email protected]>
1 parent 051c1d5 commit 985210a

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

.github/workflows/analyze-istio.yaml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,23 @@ jobs:
1111
steps:
1212
- name: Checkout
1313
uses: actions/checkout@v2
14-
- name: Get Istioctl
14+
- name: get istio version
15+
id: get-istio-version
1516
run: |
16-
ISTIO_VERSION=$(yq eval '. | select(.kind == "Deployment") | .spec.template.spec.containers[0].image | split(":") | .[1]' ./istio/operator/manifests.yaml)
17+
ISTIO_VERSION=$(yq eval '.data.version' ./clusters/my-cluster/istio-version.yaml)
1718
echo "ISTIO_VERSION=$ISTIO_VERSION" >> $GITHUB_ENV
18-
# downloadIstio will now retrieve the currently installed binary, instead of latest
19-
echo "Downloading Istio (v${ISTIO_VERSION})"
20-
curl -sL https://istio.io/downloadIstio | ISTIO_VERSION=$ISTIO_VERSION sh -
19+
- name: get istioctl uri
20+
id: get-istioctl
21+
uses: istio/get-istioctl@e9b2b82bc1cecf150ec6aee77ceee8c256f4faf4
22+
with:
23+
version: ${{ env.ISTIO_VERSION }}
24+
- name: Get Istioctl
25+
run: |
26+
curl -o istioctl.tar.gz -fsLO ${{ steps.get-istioctl.outputs.istioctl-url }}
27+
tar -xzf istioctl.tar.gz
28+
./istioctl version --remote=false
2129
- name: Istioctl Analyze
2230
run: |
23-
# this command will exit(1) if an error is found in any yaml
24-
# istio/operator/manifests.yaml contains an empty yaml doc, which
25-
# throws off analyze, so pass it in separately
26-
MANIFESTS=$(yq eval '. | select(. | has("kind"))' ./istio/operator/manifests.yaml)
27-
28-
ISTIO_VERSION=${{ env.ISTIO_VERSION }}
29-
30-
./istio-${ISTIO_VERSION}/bin/istioctl analyze -A --use-kube=false \
31-
--failure-threshold ERROR $(find . -not -path "*/istio-$ISTIO_VERSION/*" \
32-
-not -path "*/.git*/*" -not -path "*/clusters/*" -name "*.yaml" \
33-
-not -path "*/istio/operator/manifests.yaml" -type f) -<<<"$MANIFESTS"
31+
./istioctl analyze -A --use-kube=false \
32+
--failure-threshold ERROR \
33+
$(find . -not -path "*/.git*/*" -not -path "*/clusters/*" -name "*.yaml" -type f)

0 commit comments

Comments
 (0)