allenporter/flux-local

Running with relative path outside of git repo fails

allenporter opened this issue · 0 comments

https://github.com/onedr0p/home-ops/actions/runs/7304107954/job/19905782487?pr=6596

Given a rep at /github/workspace/pull/ running the following command from /github/workspace will fail

$ flux-local --log-level DEBUG diff kustomization --unified 6 --path-orig default/kubernetes/main --path pull/kubernetes/main --strip-attrs "helm.sh/chart,checksum/config,app.kubernetes.io/version,chart" --limit-bytes 10000 --all-namespaces --sources "home-kubernetes" --output-file diff.patch
...
FileNotFoundError: [Errno 2] No such file or directory: PosixPath('/github/workspace/pull/pull/kubernetes/main')

This is likely because of the relative path logic here

def relative_path(self) -> Path:
which does not rewrite a relative path to be relative within the git root.

Workarounds are:

  • run from within the repo directory
  • run with absolute paths