@@ -28,15 +28,26 @@ jobs:
2828
2929 - name : Generate Diff
3030 run : |
31+ # Kustomize and Helm don't work by default with argocd-diff, so we need to amend argocd a bit
32+ kind create cluster
33+ helm repo add argo https://argoproj.github.io/argo-helm
34+ helm upgrade --install argocd argo/argo-cd --version 9.3.4 --create-namespace --namespace argocd-diff-preview \
35+ --set config.params."kustomize\.buildOptions"="--load-restrictor LoadRestrictionsNone --enable-alpha-plugins"
36+ kubectl apply -n argocd-diff-preview -f pull-request/kubernetes/gke-utility/argocd/clusters.yaml || true # ignore errors from missing ES
37+ kubectl apply -n argocd-diff-preview -f pull-request/kubernetes/gke-utility/argocd/clusters-diff.yaml # ES based clusters
38+
3139 docker run \
3240 --network=host \
41+ -v ~/.kube:/root/.kube \
3342 -v /var/run/docker.sock:/var/run/docker.sock \
3443 -v $(pwd)/main:/base-branch \
3544 -v $(pwd)/pull-request:/target-branch \
3645 -v $(pwd)/output:/output \
3746 -e TARGET_BRANCH=refs/pull/${{ github.event.number }}/merge \
3847 -e REPO=${{ github.repository }} \
39- dagandersen/argocd-diff-preview:v0.1.19
48+ dagandersen/argocd-diff-preview:v0.1.21 \
49+ --argocd-namespace=argocd-diff-preview \
50+ --create-cluster=false
4051
4152 - name : Upload artifact
4253 uses : actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
5768 env :
5869 GH_TOKEN : ${{ secrets.K8S_INFRA_CI_BOT_PR_TOKEN }}
5970 run : |
60- gh pr comment ${{ github.event.number }} --repo ${{ github.repository }} --body-file output/diff.md --edit-last || \
61- gh pr comment ${{ github.event.number }} --repo ${{ github.repository }} --body-file output/diff.md
71+ gh pr comment ${{ github.event.number }} --repo ${{ github.repository }} --body-file output/diff.md --edit-last --create-if-none
0 commit comments