Skip to content

Add --delete-propagation-policy and --delete-timeout flags to kpt live destroy - #4665

Open
aravindtga wants to merge 2 commits into
kptdev:mainfrom
Nordix:destroy-delete-propagation-timeout-flags
Open

Add --delete-propagation-policy and --delete-timeout flags to kpt live destroy#4665
aravindtga wants to merge 2 commits into
kptdev:mainfrom
Nordix:destroy-delete-propagation-timeout-flags

Conversation

@aravindtga

Copy link
Copy Markdown
Contributor

Description

  • Add --delete-propagation-policy and --delete-timeout flags to kpt live destroy, bringing it to parity with kpt live apply which already has --prune-propagation-policy and --prune-timeout.
  • The underlying cli-utils DestroyerOptions has supported DeletePropagationPolicy and DeleteTimeout since Refactor destroyer to use tasks kubernetes-sigs/cli-utils#366, but kpt was not exposing them as CLI flags.
    • --delete-propagation-policy: Controls how dependents are handled during deletion (Background, Foreground, Orphan). Default: Background.
    • --delete-timeout: How long to wait for resources to be fully deleted. Default: 0 (wait indefinitely).

Fixes #1461

Type of Change

  • Bug fix
  • Tests
  • Documentation

Checklist

  • Code follows project style guidelines
  • Self-reviewed changes
  • Tests added/updated
  • Documentation added/updated
  • All tests and gating checks pass

AI Disclosure

  • I have used AI in the creation of this PR.

If so, please describe how:

  • Kiro to investigate the issue, verify upstream support in cli-utils, generate unit tests and generate PR message.

@netlify

netlify Bot commented Jul 24, 2026

Copy link
Copy Markdown

Deploy Preview for kptdocs ready!

Name Link
🔨 Latest commit 72bb6fd
🔍 Latest deploy log https://app.netlify.com/projects/kptdocs/deploys/6a6b0cd566d91d00087872e4
😎 Deploy Preview https://deploy-preview-4665--kptdocs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@aravindtga aravindtga self-assigned this Jul 24, 2026
@aravindtga
aravindtga force-pushed the destroy-delete-propagation-timeout-flags branch 4 times, most recently from 2c67291 to 59bff78 Compare July 24, 2026 15:10
…e destroy

Signed-off-by: Aravindhan Ayyanathan <aravindhan.a@est.tech>
@aravindtga
aravindtga force-pushed the destroy-delete-propagation-timeout-flags branch from 59bff78 to 51d62ec Compare July 24, 2026 16:35
@aravindtga
aravindtga marked this pull request as ready for review July 24, 2026 16:42
@aravindtga
aravindtga requested review from a team July 24, 2026 16:42
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. area/live enhancement New feature or request labels Jul 24, 2026
@dosubot dosubot Bot added the lgtm label Jul 27, 2026
@aravindtga
aravindtga requested a review from a team July 29, 2026 06:51
@liamfallon
liamfallon requested a review from Copilot July 29, 2026 07:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Not ready to approve

The current invalid-value error path for --delete-propagation-policy returns a confusing message referencing “prune propagation policy,” which should be corrected to match the destroy flag.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.

Pull request overview

This PR exposes cli-utils destroy deletion controls through kpt live destroy, adding user-facing flags for deletion propagation policy and deletion timeout, and updates docs/tests accordingly to match the new CLI surface.

Changes:

  • Add --delete-propagation-policy and --delete-timeout flags to kpt live destroy and wire them into apply.DestroyerOptions.
  • Update generated/live docs and reference docs to document the new flags.
  • Extend destroy command unit tests to cover flag validation and parsing for the new flags.
File summaries
File Description
internal/docs/generated/livedocs/docs.go Adds generated help text entries for the new destroy flags.
documentation/content/en/reference/cli/live/destroy/_index.md Updates CLI reference docs to include the new destroy flags.
commands/live/destroy/cmddestroy.go Introduces new CLI flags, parses them, and passes values into destroy options.
commands/live/destroy/cmddestroy_test.go Adds/updates tests to validate new flag parsing and invalid-value handling.
Review details
  • Files reviewed: 3/4 changed files
  • Comments generated: 1
  • Review effort level: Low

We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.

Comment thread commands/live/destroy/cmddestroy.go
Signed-off-by: Aravindhan Ayyanathan <aravindhan.a@est.tech>
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/live enhancement New feature or request lgtm size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

kpt live destroy command should be able to wait for resources to be removed

3 participants