Skip to content

Commit

Permalink
add timeout awaitng for deleteion
Browse files Browse the repository at this point in the history
  • Loading branch information
kvaps committed Dec 24, 2020
1 parent 6e91017 commit c4ceba0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions internal/commands/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ func newApplyCommand(cp configProvider) *cobra.Command {
if err != nil {
return newUsageError(fmt.Sprintf("invalid wait timeout: %s, %v", waitTime, err))
}
config.syncOptions.WaitOptions.Timeout = config.waitTimeout
if config.syncOptions.DryRun {
config.wait = false
config.waitAll = false
Expand Down
7 changes: 6 additions & 1 deletion internal/remote/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -662,8 +662,13 @@ func (c *Client) doRecreate(obj model.K8sLocalObject, opts SyncOptions) (*update
return nil, err
}

waitTime := int64(opts.WaitOptions.Timeout.Seconds())
if waitTime == 0 {
waitTime = int64(2 * time.Minute)
}
watcher, err := ri.Watch(metav1.ListOptions{
FieldSelector: "metadata.name=" + obj.GetName(),
TimeoutSeconds: &waitTime,
FieldSelector: "metadata.name=" + obj.GetName(),
})
if err != nil {
return nil, err
Expand Down

0 comments on commit c4ceba0

Please sign in to comment.