Skip to content

Commit c4ceba0

Browse files
committed
add timeout awaitng for deleteion
1 parent 6e91017 commit c4ceba0

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

internal/commands/apply.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ func newApplyCommand(cp configProvider) *cobra.Command {
295295
if err != nil {
296296
return newUsageError(fmt.Sprintf("invalid wait timeout: %s, %v", waitTime, err))
297297
}
298+
config.syncOptions.WaitOptions.Timeout = config.waitTimeout
298299
if config.syncOptions.DryRun {
299300
config.wait = false
300301
config.waitAll = false

internal/remote/client.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -662,8 +662,13 @@ func (c *Client) doRecreate(obj model.K8sLocalObject, opts SyncOptions) (*update
662662
return nil, err
663663
}
664664

665+
waitTime := int64(opts.WaitOptions.Timeout.Seconds())
666+
if waitTime == 0 {
667+
waitTime = int64(2 * time.Minute)
668+
}
665669
watcher, err := ri.Watch(metav1.ListOptions{
666-
FieldSelector: "metadata.name=" + obj.GetName(),
670+
TimeoutSeconds: &waitTime,
671+
FieldSelector: "metadata.name=" + obj.GetName(),
667672
})
668673
if err != nil {
669674
return nil, err

0 commit comments

Comments
 (0)