Skip to content

--outdir . flag value makes furyctl not working correctly #508

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
alessiodionisi opened this issue Apr 24, 2024 · 2 comments · May be fixed by #608
Open

--outdir . flag value makes furyctl not working correctly #508

alessiodionisi opened this issue Apr 24, 2024 · 2 comments · May be fixed by #608
Assignees
Labels
bug Something isn't working

Comments

@alessiodionisi
Copy link
Contributor

alessiodionisi commented Apr 24, 2024

When --outdir value is . furyctl cannot find binaries.

$ furyctl apply --debug --outdir . --distro-location ../../fury-distribution --dry-run
DEBU logging to: .furyctl/furyctl.1713949596-73917.log
DEBU Getting Home Directory Path...
INFO Dry run mode enabled, no changes will be applied
INFO Downloading distribution...
DEBU Downloading '/Users/alessiodionisi/Projects/sighupio/fury-distribution' in '/var/folders/qt/7dtl66_55rdc5dpfg3q04jjr0000gn/T/furyctl-4096927723/data'
INFO Validating configuration file...
INFO Downloading dependencies...
DEBU Cleaning vendor folder
INFO Validating dependencies...
INFO Running preflight checks
INFO Checking that the cluster is reachable...
ERRO error while creating cluster: error while executing preflight phase: cluster is unreachable, make sure you have access to the cluster: error getting kubectl version: .furyctl/bin/kubectl/1.28.7/kubectl .furyctl/bin/kubectl/1.28.7/kubectl version -o json: command failed - fork/exec .furyctl/bin/kubectl/1.28.7/kubectl: no such file or directory
out:
err:

Temporary fix: --outdir $PWD

@ralgozino
Copy link
Member

ralgozino commented Feb 24, 2025

May be related to #434

@ralgozino
Copy link
Member

ralgozino commented May 7, 2025

May be related to #434

Kinda related but not, they not share the same root cause.

The issue is that furyctl when launches the tools, sometimes changes the working directory from where it launches them. So the relative path set in the outdir does not point to the right place anymore.

This issue is even more evident if you launch furyctl using the --workdir flag, then, the relative paths get completely broken.

Passing $PWD instead of . works because it is an absolute path so the paths are not relative anymore and always work.

We need to convert the outDir to an absolute path early to fix this issue.

Exactly the same issue is present with the --bin-path, because when it is not set it is calculated starting from --outdir. You can verify this by setting --outdir to an absolute path like $PWD and --bin-path to a relative path, you will get the same error as OP; and viceversa: you can set outdir to a relative path and bin-path to an absolute path and you won't get the error from OP.

@ralgozino ralgozino self-assigned this May 9, 2025
ralgozino added a commit that referenced this issue May 12, 2025
- Improve management of relative paths, calculating them once.
- Set outdir globally and reuse.
- Reduce code duplication (still lots to improve)
- Move flags processing to helper func when present
- Improve UX on some error messages, help messages and debug messages
- Normalize words in help messages
Fixes #508
@ralgozino ralgozino linked a pull request May 12, 2025 that will close this issue
14 tasks
ralgozino added a commit that referenced this issue May 22, 2025
- Improve management of relative paths, calculating them once.
- Set outdir globally and reuse.
- Reduce code duplication (still lots to improve)
- Move flags processing to helper func when present
- Improve UX on some error messages, help messages and debug messages
- Normalize words in help messages
Fixes #508
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants