operator: Fix default API server addr in metrics subcommand #26132
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.
The operator API server has been modularized into its independent cell in a previous commit.
Doing that, the flag to specify a custom address for the server has been moved from the global operator config to the new cell config.
The
metrics list
subcommand needs to know the operator API server address to query the "/metrics" endpoint. Before the modularization, the subcommand was at least able to query the server if that was started at the default address.This commit adds a new flag to specify the address of the operator API server. Also, the default value for this flag is set to the same default used in the operator/api server cell. Doing that fixes the bug introduced in the modularization and also allows to specify another address if the operator API server is listening on a non-default one.
Fixes: 11d5856 ("operator/api: Modularize api server")