Skip to content
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

add flux --root option #6557

Merged
merged 6 commits into from
Jan 17, 2025
Merged

add flux --root option #6557

merged 6 commits into from
Jan 17, 2025

Conversation

grondo
Copy link
Contributor

@grondo grondo commented Jan 17, 2025

Since flux --parent [--parent] COMMAND ARGS... is supported to connect to parent (grandparent, etc.), it seems neglectful that a method to connect to the top-level or root instance is not also provided. Instead, users have to supply the --parent option at least instance-level times: an admittedly awkward interface.

This PR adds a --root option to flux(1) that behaves exactly as if --parent had been specified instance-level times. If instance-level is 0, this option has no effect (same as --parent).

Problem: A few lines in `src/cmd/flux.c` do not conform to modern
project style. Long parameter lists are not split into one parameter
per line.

Fix the formatting.
Problem: There's an unused `uri` parameter passed to
flux_open_internal() in src/cmd/flux.c. This could confuse callers
that the function accepts an alternate uri when it always passes NULL
as the URI parameter to flux_open(3).

Remove the unused parameter to avoid the confusion.
Problem: push_parent_environment() in `src/cmd/flux.c` calls
`flux_open_internal()` after pushing the parent environment, but this
is a no-op because the environment has not yet been applied.

Drop the useless `flux_open_internal()` call.
Problem: While the `flux(1)` command supports operating on parent
URIs by specifying one or more `--parent` options on the command line,
there is no way to easily specify the top-level or root parent.

Add a `--root` option which acts if `instance-level` number of
`--parent` options were supplied to the command.
Problem: The `--root` option to `flux(1)` is undocumented.

Document it.
Problem: There are no tests of the `flux --root` option.

Add some tests to t3100-flux-in-flux.t.
Copy link
Member

@chu11 chu11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a good option to have, LGTM!

@grondo
Copy link
Contributor Author

grondo commented Jan 17, 2025

Thanks!

@mergify mergify bot merged commit 8259a8f into flux-framework:master Jan 17, 2025
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants