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

Support unsetting string-based flags by passing empty string ("") #447

Open
heyjcollins opened this issue Jan 10, 2023 · 0 comments
Open
Labels
enhancement New feature or request MIGRATED-MIGRATED Migrated to private repo needs-triage

Comments

@heyjcollins
Copy link
Contributor

heyjcollins commented Jan 10, 2023

Description of problem

workload create/apply supports setting a handful of string-based workload object values via flags.
Once any of those flag/values have been set, the only way to unset them today is to pass a --file workload.yaml with those properties/values removed and use --update-strategy replace.

For someone who prefers to manage/configure their workload via apps commands/flags or someone unfamiliar with the workload object and/or yaml, this is inconvenient toil.

Proposed solution

Enable unsetting of string-based flags by passing an empty string.

Given I've created a workload via command such as `tanzu apps workload create my-app --git-repo github.com/foo/bar --git-branch main --limit-cpu 500m`
When I run an update command such as `tanzu apps workload create my-app --git-repo github.com/foo/bar --git-branch main --limit-cpu ""`
Then limit-cpu and it's value are unset in my workload
Given I'm looking at the output for  `tanzu apps workload create/apply --help`
When I view any help line for a flag in the list of flags to be updated as per this issue
Then I see `(to unset, pass empty string "")` appended to the flag description

List of flags to update

  1. --app
  2. --image (not sure if this one belongs in the list - let's discuss)
  3. --limit-cpu
  4. --limit-memory
  5. --maven-type
  6. --request-cpu
  7. --request-memory

And these already have this feature enabled:

  1. --service-account
  2. --sub-path
  3. --git*
@heyjcollins heyjcollins added enhancement New feature or request needs-triage labels Jan 10, 2023
@heyjcollins heyjcollins added the MIGRATED-MIGRATED Migrated to private repo label Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request MIGRATED-MIGRATED Migrated to private repo needs-triage
Projects
None yet
Development

No branches or pull requests

1 participant