flux2 icon indicating copy to clipboard operation
flux2 copied to clipboard

flux diff kustomization doesn't seem to ignore files correctly

Open ryanobjc opened this issue 1 year ago • 5 comments

Describe the bug

While using this command:

flux diff kustomization apps --path apps/dev

I get this error:

✗ failed to generate kustomization.yaml: failed to decode Kubernetes YAML from $HOME/$REPO/apps/dev/.sops.yaml: missing Resource metadata <nil> <nil>

I tried to use --ignore-paths with various patterns including: .sops.yaml **/.sops.yaml $PWD/apps/dev/.sops.yaml

But none of those worked. I was able to accomplish my task by deleting the .sops.yaml file then restoring it via git afterwards.

Steps to reproduce

Create a kustomization in a standard format, and include a .sops.yaml which should be normally ignored, and it doesn't.

Expected behavior

The file should be ignored and the diff should work.

Screenshots and recordings

No response

OS / Distro

macOS 14.4.1

Flux version

2.2.3, 2.3

Flux check

N/a

Git provider

No response

Container Registry provider

No response

Additional context

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

ryanobjc avatar Aug 08 '24 23:08 ryanobjc

I have exactly the same problem. No matter how I exclude the files that I want excluded, they are not ignored.

steinwelberg avatar Nov 13 '24 18:11 steinwelberg

Hey @matheuscscp could you please look into this? Thanks

stefanprodan avatar Nov 14 '24 09:11 stefanprodan

Just ran into this. Any update?

vvarga007 avatar Feb 26 '25 14:02 vvarga007

Not yet, sorry!

matheuscscp avatar Feb 26 '25 14:02 matheuscscp

also run into this issue

(fikrimi) [fikrimi@crimson:flux|main *+%]$ cat .sourceignore 
.gitlab
(fikrimi) [fikrimi@crimson:flux|main *+%]$ flux diff kustomization flux-system --path ./
✓  Kustomization diffing...
✗ failed to generate kustomization.yaml: failed to decode Kubernetes YAML from /--REDACTED--/flux/.gitlab/agents/prod/config.yaml: missing Resource metadata <nil> <nil>

fmiqbal avatar Apr 14 '25 03:04 fmiqbal

Same here with a .gitlab-ci.yml file, tried:

  • full local path
  • **/.gitlab-ci.yml
  • **/*.yml nothing is actually ignored, only deleting/commenting out code inside of the .gitlab-ci.yml file allows flux diff kustomization command to work

Tomasz-Kluczkowski avatar Jun 19 '25 09:06 Tomasz-Kluczkowski

@dgunzy If you have the time and interest, could you please work on this one too?

matheuscscp avatar Jun 29 '25 15:06 matheuscscp

@dgunzy If you have the time and interest, could you please work on this one too?

Yes! I can look at this in a couple days.

dgunzy avatar Jun 29 '25 15:06 dgunzy