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

Change config semantics to args and full key path #238

Merged
merged 1 commit into from
Aug 15, 2022

Conversation

feedmeapples
Copy link
Contributor

@feedmeapples feedmeapples commented Jul 28, 2022

What was changed

changes config feature semantics from flags to args

tctl config set --namespace accounting

to

tctl config set env.local.namespace accounting (or tctl config set namespace accounting for short in a new PR)

Why?

  • moving towards allowing to configure the default value for any flag and not just the ones whitelisted by tctl config set command
  • consistency with other tools such as git and kubectl

Checklist

  1. Closes

  2. How was this tested:

  1. Any docs updates needed?

@feedmeapples feedmeapples marked this pull request as draft July 28, 2022 01:24
@feedmeapples feedmeapples force-pushed the config-semantics branch 2 times, most recently from d16399b to 4f6d95a Compare August 2, 2022 20:37
@feedmeapples feedmeapples marked this pull request as ready for review August 2, 2022 20:37
fmt.Printf("%v: %v\n", color.Magenta(c, "%v", key), val)
key := c.Args().Get(0)

var val string
Copy link
Member

Choose a reason for hiding this comment

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

When is it valid to omit the value?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

was thinking of booleans such as tls-disable-host-verification

Copy link
Contributor Author

@feedmeapples feedmeapples Aug 4, 2022

Choose a reason for hiding this comment

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

so tctl config set tls-disable-host-verification would mean it being set as true. That's similar to when it is passed as a flag

Copy link
Member

@bergundy bergundy Aug 5, 2022

Choose a reason for hiding this comment

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

Hmm.. how do we deal with booleans and numbers in general?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

made them to work with the standard urfave/cli syntax #257

Copy link
Member

@bergundy bergundy left a comment

Choose a reason for hiding this comment

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

For someone like me who's not familiar with the codebase a PR description would go a long way.
Also it doesn't make sense to me not to have any test coverage for this.

@feedmeapples
Copy link
Contributor Author

For someone like me who's not familiar with the codebase a PR description would go a long way. Also it doesn't make sense to me not to have any test coverage for this.

right, missed adding description after removing the draft tag

@feedmeapples feedmeapples requested a review from bergundy August 2, 2022 22:55
@feedmeapples feedmeapples merged commit 6df1546 into main Aug 15, 2022
@feedmeapples feedmeapples deleted the config-semantics branch August 15, 2022 20:27
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.

3 participants