Skip to content

fix: add --set and --set-value-file flag support to delete command and unit tests#10054

Merged
Darien-Lin merged 2 commits intoGoogleContainerTools:mainfrom
unburdenedio:fix/delete-set-flag
Apr 22, 2026
Merged

fix: add --set and --set-value-file flag support to delete command and unit tests#10054
Darien-Lin merged 2 commits intoGoogleContainerTools:mainfrom
unburdenedio:fix/delete-set-flag

Conversation

@bogdannazarenko
Copy link
Copy Markdown
Contributor

@bogdannazarenko bogdannazarenko commented Apr 18, 2026

Description
This PR adds support for the --set and --set-value-file flag to the skaffold delete command, allowing users to override templated manifest fields with key-value pairs during deletion operations.

Fixes #10053

Changes made:

  1. Updated cmd/skaffold/app/cmd/flags.go line 764 to include "delete" in the DefinedOn list for the "set" and "set-value-file" flags
  2. Created cmd/skaffold/app/cmd/delete_test.go with unit tests to verify that the delete command accepts --set, --set-value-file and --dry-run flags
  3. Verified the built skaffold binary correctly accepts the --set and --set-value-file flag for the delete command

User facing changes
Users can now use the --set and --set-value-file flags with skaffold delete to override templated manifest fields:

Before: skaffold delete did not accept --set or --set-value-file flags
After: skaffold delete --set key=value --set set-value-file=file is now supported

This allows for more flexible deletion operations when working with templated manifests.

Testing

  • Added unit test TestNewCmdDelete in delete_test.go that verifies both --set, --set-value-file and --dry-run flags are available
  • All existing tests pass
  • All linters pass

@bogdannazarenko bogdannazarenko requested a review from a team as a code owner April 18, 2026 00:42
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request enables the --set flag for the skaffold delete command and introduces a unit test to verify the presence of the --set and --dry-run flags. Feedback suggests enhancing the test to verify flag binding and ensuring isolation by overriding package-level variables. Additionally, it is recommended to enable the --set-value-file flag for the delete command to maintain consistency with other commands that support manifest overrides.

Comment thread cmd/skaffold/app/cmd/delete_test.go
Comment thread cmd/skaffold/app/cmd/flags.go
@bogdannazarenko bogdannazarenko force-pushed the fix/delete-set-flag branch 2 times, most recently from 0291ecc to 4ffd77a Compare April 18, 2026 00:56
…nd unit tests

Signed-off-by: Bogdan Nazarenko <bogdan.nazarenko@outlook.com>
@bogdannazarenko bogdannazarenko changed the title fix: add --set flag support to delete command and unit tests fix: add --set and --set-value-file flag support to delete command and unit tests Apr 18, 2026
@Darien-Lin
Copy link
Copy Markdown
Contributor

Seems that the unit test require you to run: ./hack/generate-man.sh

Signed-off-by: Bogdan Nazarenko <bogdan.nazarenko@outlook.com>
@bogdannazarenko
Copy link
Copy Markdown
Contributor Author

@Darien-Lin Darien-Lin merged commit 644127e into GoogleContainerTools:main Apr 22, 2026
7 of 11 checks passed
@bogdannazarenko bogdannazarenko deleted the fix/delete-set-flag branch April 22, 2026 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

skaffold delete does not support --set flag for manifest overrides from Google Cloud Deploy deploy parameters

2 participants