diff --git a/cli/pkg/kctrl/cmd/package/installed/create_or_update.go b/cli/pkg/kctrl/cmd/package/installed/create_or_update.go index 4eeabdf6b..831854df7 100644 --- a/cli/pkg/kctrl/cmd/package/installed/create_or_update.go +++ b/cli/pkg/kctrl/cmd/package/installed/create_or_update.go @@ -920,6 +920,9 @@ func (o *CreateOrUpdateOptions) unpauseReconciliation(client kcclient.Interface) // TODO: Have common place for waiting logic and refactor based on // https://github.com/carvel-dev/kapp-controller/issues/639 func (o *CreateOrUpdateOptions) waitForAppPause(client kcclient.Interface) error { + if !o.WaitFlags.Enabled { + return nil + } if err := wait.Poll(o.WaitFlags.CheckInterval, o.WaitFlags.Timeout, func() (done bool, err error) { appResource, err := client.KappctrlV1alpha1().Apps(o.NamespaceFlags.Name).Get(context.Background(), o.Name, metav1.GetOptions{}) if err != nil { diff --git a/cli/pkg/kctrl/cmd/package/installed/pause_or_kick.go b/cli/pkg/kctrl/cmd/package/installed/pause_or_kick.go index f42c83303..d7e8bf4bd 100644 --- a/cli/pkg/kctrl/cmd/package/installed/pause_or_kick.go +++ b/cli/pkg/kctrl/cmd/package/installed/pause_or_kick.go @@ -65,6 +65,12 @@ func NewPauseCmd(o *PauseOrKickOptions, flagsFactory cmdcore.FlagsFactory) *cobr cmd.Use = "pause INSTALLED_PACKAGE_NAME" } + o.WaitFlags.Set(cmd, flagsFactory, &cmdcore.WaitFlagsOpts{ + AllowDisableWait: true, + DefaultInterval: 2 * time.Second, + DefaultTimeout: 5 * time.Minute, + }) + return cmd } @@ -228,6 +234,9 @@ func (o *PauseOrKickOptions) unpause(client kcclient.Interface) error { } func (o *PauseOrKickOptions) waitForAppPause(client kcclient.Interface) error { + if !o.WaitFlags.Enabled { + return nil + } if err := wait.Poll(o.WaitFlags.CheckInterval, o.WaitFlags.Timeout, func() (done bool, err error) { appResource, err := client.KappctrlV1alpha1().Apps(o.NamespaceFlags.Name).Get(context.Background(), o.Name, metav1.GetOptions{}) if err != nil {