Skip to content

Remove unused flags when --json is force and force json for budget-policy #2682

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

andrewnester
Copy link
Contributor

@andrewnester andrewnester commented Apr 8, 2025

Changes

Remove unused flags when --json is force and force json for budget-policy

Why

Some update commands which have complex request body (like budget-policy) needs to be used with a JSON input and not command line flags because it can lead to the errors when user unintentionally forget to specify some body input and the resources gets update to empty values (see all policy related commands for example)

Tests

Manually verified

@@ -262,7 +263,7 @@ func new{{.PascalName}}() *cobra.Command {
return err
}
}
}{{end}}{{ if .MustUseJson }}else {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we remove .MustUseJson now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We still use it above to define jsonOnly variable

@andrewnester andrewnester changed the title Force to use --json input for update commands with request body Remove unused flags when --json is force and force json for budget-policy Apr 22, 2025
@andrewnester andrewnester requested a review from pietern April 22, 2025 14:56
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.

2 participants