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

Fix CLI flag naming #2070

Merged
merged 9 commits into from
Jan 16, 2025
Merged

Fix CLI flag naming #2070

merged 9 commits into from
Jan 16, 2025

Conversation

hariso
Copy link
Contributor

@hariso hariso commented Jan 15, 2025

Description

Fixes #2062.

There were two issues:

  1. With boolean flags, e.g. api.enabled, the "issue" was in the usage. Sometimes we use --api.enabled true, but pflag doesn't like that (link, pflag is used by Viper that our CLI uses)
  2. With other flags, the issue was with naming. When unmarshalling the input map (that contains flag names and values) into Conduit's configuration structs, certain fields were skipped because of name mismatches. mapstructure, used by viper, assumes default key names for Go struct fields, but we were using non-default in certain cases.

As part of above changes, http.address and grpc.address were renamed to api.http.address and api.grpc.address respectively.

Quick checks

  • I have followed the Code Guidelines.
  • There is no other pull request for the same update/change.
  • I have written unit tests.
  • I have made sure that the PR is of reasonable size and can be easily reviewed.

@hariso hariso changed the title [WIP] Fix CLI flag naming Fix CLI flag naming Jan 15, 2025
@hariso hariso marked this pull request as ready for review January 15, 2025 12:32
@hariso hariso requested a review from a team as a code owner January 15, 2025 12:32
@hariso hariso enabled auto-merge (squash) January 16, 2025 12:16
Copy link
Member

@raulb raulb left a comment

Choose a reason for hiding this comment

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

Thank you @hariso !!

@hariso hariso merged commit 2515cf5 into main Jan 16, 2025
4 checks passed
@hariso hariso deleted the fix-api-flags-again branch January 16, 2025 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Not all configuration is correctly parsed
2 participants