feat(cli): add --rpc-url/--admin-url flags and fix --data-dir targeting#394
Open
ezeike wants to merge 3 commits into
Open
feat(cli): add --rpc-url/--admin-url flags and fix --data-dir targeting#394ezeike wants to merge 3 commits into
ezeike wants to merge 3 commits into
Conversation
InitializeDataDirectory was called in init() immediately after the cobra flag was registered, before cobra had parsed args. DataDir was always the default (~/.canopy) regardless of --data-dir value. Move initialization into PersistentPreRunE which runs after flag parsing but before any subcommand Run. Also adds toolchain directive so go1.25.3 is used consistently (required for cockroachdb/swiss dep).
Allows targeting any node directly without needing a matching data directory or config file swap. Flags override the URL loaded from config.json after InitializeDataDirectory runs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--data-dirflag being ignored: moved initialization frominit()toPersistentPreRunEso flags are parsed before config loads--rpc-urland--admin-urlflags to override node URLs from config at runtimeTest plan
canopy --data-dir /custom/path <cmd>uses the specified directorycanopy --rpc-url http://localhost:9000 <cmd>overrides config RPC URLcanopy --admin-url http://localhost:9001 <cmd>overrides config admin URL