flux-local
flux-local copied to clipboard
Running with relative path outside of git repo fails
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 https://github.com/allenporter/flux-local/blob/c570d5c04078c46864bfafa292c40b4ccf9df713/flux_local/git_repo.py#L182 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