From 37bdf5d4b3c67401c5e1df77ac5839299c62518d Mon Sep 17 00:00:00 2001 From: Rene Zbinden Date: Mon, 4 May 2020 13:10:23 +0200 Subject: [PATCH] plugin: fix context --- internal/plugin/plugin.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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), },