Skip to content

Add possibility to skip waiting in kpt live apply#4599

Closed
mozesl-nokia wants to merge 1 commit into
kptdev:mainfrom
nokia:live-apply-nowait
Closed

Add possibility to skip waiting in kpt live apply#4599
mozesl-nokia wants to merge 1 commit into
kptdev:mainfrom
nokia:live-apply-nowait

Conversation

@mozesl-nokia

Copy link
Copy Markdown
Contributor

Added a --wait flag so that it is possible to not wait for resources to be ready. Useful when wait conditions are not always as simple as Ready=True. The default is still true.

Further improvements: Add support for kubectl wait --for=... style wait conditions, or possibility to define such conditions in the Kptfile or resource metadata.

Signed-off-by: Mózes László Máté <laszlo.mozes@nokia.com>
@mozesl-nokia mozesl-nokia added the enhancement New feature or request label Jun 23, 2026
Copilot AI review requested due to automatic review settings June 23, 2026 12:42
@mozesl-nokia mozesl-nokia requested a review from liamfallon as a code owner June 23, 2026 12:42
@mozesl-nokia mozesl-nokia added area/rollout go Pull requests that update Go code labels Jun 23, 2026
@netlify

netlify Bot commented Jun 23, 2026

Copy link
Copy Markdown

Deploy Preview for kptdocs ready!

Name Link
🔨 Latest commit 2cfdaf3
🔍 Latest deploy log https://app.netlify.com/projects/kptdocs/deploys/6a3a7f2055d9050008da45b0
😎 Deploy Preview https://deploy-preview-4599--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.

@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Jun 23, 2026

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.

Pull request overview

This PR introduces a new --wait flag to kpt live apply intended to allow exiting without waiting for resources to become ready/reconciled, and adds an e2e test case plus supporting test resources.

Changes:

  • Added a --wait boolean flag (default true) to kpt live apply.
  • Added a new live-apply/no-wait e2e test case and package resources.
  • Adjusted apply execution to short-circuit output/printing when --wait=false.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
commands/live/apply/cmdapply.go Adds --wait flag and changes apply execution flow based on it.
e2e/testdata/live-apply/no-wait/config.yaml New e2e scenario invoking kpt live apply --wait=false and asserting stdout.
e2e/testdata/live-apply/no-wait/resources/Kptfile Test package metadata for the new e2e scenario.
e2e/testdata/live-apply/no-wait/resources/cm.yaml A simple ConfigMap resource used by the no-wait e2e scenario.
e2e/testdata/live-apply/no-wait/resources/resourcegroup.yaml ResourceGroup inventory manifest used by the no-wait e2e scenario.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +283 to +286
if !r.wait {
_, _ = fmt.Fprintf(r.ioStreams.Out, "Apply started in the background")
return nil
}
Comment on lines +93 to +94
c.Flags().BoolVar(&r.wait, "wait", true,
"Whether or not to wait for the resources to be ready")
Comment on lines +15 to +20
parallel: true
kptArgs:
- "live"
- "apply"
- "--wait=false"
stdOut: Apply started in the background
}

if !r.wait {
_, _ = fmt.Fprintf(r.ioStreams.Out, "Apply started in the background")
@mozesl-nokia mozesl-nokia marked this pull request as draft June 23, 2026 12:49
@mozesl-nokia

Copy link
Copy Markdown
Contributor Author

This needs to go much further into the depth of cliutils to be possible, we can revisit this later.

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

Labels

area/live area/rollout enhancement New feature or request go Pull requests that update Go code size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants