diff --git a/internal/plugin/plugin.go b/internal/plugin/plugin.go index 9dc7e0e..00d2842 100644 --- a/internal/plugin/plugin.go +++ b/internal/plugin/plugin.go @@ -296,8 +296,11 @@ func (o *SyncOptions) Run() error { return nil } + ctx, cancel = context.WithTimeout(context.Background(), o.userSpecifiedTimeout) + defer cancel() + watch, err := batchClient.Watch( - context.TODO(), + ctx, metav1.ListOptions{ LabelSelector: fmt.Sprintf("job=%s,jobSuffix=%s", job.Name, suffix), },