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 the idea of "env-flags" #886

Merged
merged 2 commits into from
Jun 13, 2024
Merged

Conversation

thockin
Copy link
Member

@thockin thockin commented Jun 9, 2024

Env-flags are flags that can only be set by env var. All of the real
flags have a corresponding env-flag, kind of. The real goal was to
deprecate --password but keep the env var as a documented interface.

This does that (though --password still works) and updates the usage and
manual.

This allows some future work to follow the pattern.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: thockin

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 9, 2024
@thockin thockin mentioned this pull request Jun 9, 2024
6 tasks
@thockin thockin force-pushed the add-env-params branch 2 times, most recently from 62bf93a to 96ff5c1 Compare June 9, 2024 17:51
@thockin thockin added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 9, 2024
@thockin thockin self-assigned this Jun 9, 2024
@thockin thockin force-pushed the add-env-params branch 3 times, most recently from 86372ad to d61932f Compare June 13, 2024 03:08
@thockin thockin force-pushed the add-env-params branch 6 times, most recently from a5b4076 to 4597da9 Compare June 13, 2024 21:29
Env-flags are "flags" that can only be set by env var (see caveat below).
All of the real flags have a corresponding env-flag (kind of, but not
really).  The real goal was to deprecate `--password` but keep the env
var as a documented interface.

This does that (though --password still works) and updates the usage and
manual.

This allows some future work to follow the pattern.  We do not register
every CLI flag as an env-flag because the help text would be
duplicative.  This probably wants a wrapper API that allows declaring of
abstract flags, with CLI, env, or both sources.

Caveat:

ACTUALLY, these still have a flag, but the flag is specially named and
hidden.  This makes testing a little easier where passing flags is
handled well but env vars is not.
@thockin thockin merged commit 189a690 into kubernetes:master Jun 13, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants