Commit graph

3 commits

Author SHA1 Message Date
rohansood10
46ad3b2e7a Add --resolve-symlinks flag to build and push artifact commands
When building OCI artifacts from directories containing symlinks (e.g.,
symlink trees created by Nix), the symlinked files are silently skipped
because the underlying archive logic only handles regular files and
directories. This results in empty or incomplete artifacts.

This change adds a --resolve-symlinks flag to both 'flux build artifact'
and 'flux push artifact' commands. When set, symlinks are resolved by
copying their target contents into a temporary directory before building
the artifact. This approach:

- Preserves backward compatibility (default behavior unchanged)
- Works with symlinks pointing outside the source directory
- Handles symlinked files and directories
- Cleans up the temporary directory after the build completes

Fixes fluxcd/flux2#5055

Signed-off-by: rohansood10 <rohansood10@users.noreply.github.com>
2026-02-19 09:28:54 -08:00
Hidde Beydals
b263e14fa8 tests: only provide template values when used
As otherwise the `.golden` values can not be automatically updated using
`-update` as documented in `CONTRIBUTING.md`.

Also ensure we do not use `defer` but rather `t.Cleanup` in tests, as
this will always be called even if e.g. `t.Fatal` absruptly stops the
test.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-02-15 13:22:44 +01:00
Somtochi Onyekwere
d79e49f80b fix path on flux push
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-12-20 12:15:35 +01:00