allenporter / flux-local

flux-local is a set of tools and libraries for managing a local flux gitops repository focused on validation steps to help improve quality of commits, PRs, and general local testing.
https://allenporter.github.io/flux-local/
Apache License 2.0
156 stars 22 forks source link

No diff when comparing two versions of helm charts #648

Closed tropnikovvl closed 7 months ago

tropnikovvl commented 7 months ago

I use this workflow

      - name: Setup Flux CLI
        uses: fluxcd/flux2/action@main

      - uses: allenporter/flux-local/action/diff@5.0.1
        id: diff
        with:
          live-branch: develop
          path: clusters/${{ matrix.cluster_path }}
          resource: helmrelease
          debug: true

      - name: PR Comments
        uses: mshick/add-pr-comment@v2
        if: ${{ steps.diff.outputs.diff != '' }}
        with:
          message-id: ${{ github.ref }}/flux-diff
          message-failure: Unable to post HelmRelease diff
          message: |
            `````diff
            ${{ steps.diff.outputs.diff }}


But for some reason I get the diff on some helm releases and not on others.
I couldn't find a direct relationship.
As an example, I can give the helm release for [kube-prometheus-stack](https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack).

When updating from version `58.2.1` to version `58.2.2`, the diff is not generated for me, although according to the logs it should be and in the changes itself I also see what is [changing](https://github.com/prometheus-community/helm-charts/compare/kube-prometheus-stack-58.2.1...kube-prometheus-stack-58.2.2#diff-c0fdbc5c26d2f602485f168b5a55814cd73bd3347907c5097395120d64c2f445R2630).

![Screenshot 2024-04-26 at 17 52 36](https://github.com/allenporter/flux-local/assets/76093012/5568d955-7efa-4c50-a12c-e6ab67b69561)
allenporter commented 7 months ago

Can you give me some additional details about how the repo is setup? Ideally a link to a github pr for this happening would help, though if you have a private cluster then updating the demo repo to reproduce this would help.

tropnikovvl commented 7 months ago

Hi @allenporter

I've created an example PR https://github.com/tropnikovvl/flux-local-test/pull/1

allenporter commented 7 months ago

What are the differences you expect?

Keep in mind the default diff will strip these attributes and labels by default:

--strip-attrs "helm.sh/chart,checksum/config,app.kubernetes.io/version,chart"
tropnikovvl commented 7 months ago

I guess I didn't pay attention to that, thanks for the help!