Skip to content

Commit

Permalink
Do not wait for App pause on package install pause if wait is disable…
Browse files Browse the repository at this point in the history
…d. Add wait flags to pkg i pause.

Signed-off-by: Soumik Majumder <soumikm@vmware.com>
  • Loading branch information
100mik committed Feb 7, 2024
1 parent c4a9f9d commit 690d65d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
9 changes: 6 additions & 3 deletions cli/pkg/kctrl/cmd/package/installed/create_or_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -388,9 +388,12 @@ func (o CreateOrUpdateOptions) update(client kubernetes.Interface, kcClient kccl
if err != nil {
return err
}
err = o.waitForAppPause(kcClient)
if err != nil {
return err

if o.WaitFlags.Enabled {
err = o.waitForAppPause(kcClient)
if err != nil {
return err
}
}
reconciliationPaused = true

Expand Down
14 changes: 11 additions & 3 deletions cli/pkg/kctrl/cmd/package/installed/pause_or_kick.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -165,9 +171,11 @@ func (o *PauseOrKickOptions) Kick(args []string) error {
return err
}

err = o.waitForAppPause(client)
if err != nil {
return err
if o.WaitFlags.Enabled {
err = o.waitForAppPause(client)
if err != nil {
return err
}
}

err = o.unpause(client)
Expand Down

0 comments on commit 690d65d

Please sign in to comment.