From cc98242febe33ddb1b0b128bca1df20a61389821 Mon Sep 17 00:00:00 2001 From: Adam Reese Date: Mon, 12 Aug 2019 11:26:12 -0700 Subject: [PATCH] fix(pkg/kube): only wait for events from Jobs and Pods Fixes issue of waiting for events from hook objects that are not Jobs or Pods. Signed-off-by: Adam Reese --- pkg/kube/client.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pkg/kube/client.go b/pkg/kube/client.go index aadbc933f..dbe5e2dae 100644 --- a/pkg/kube/client.go +++ b/pkg/kube/client.go @@ -368,14 +368,20 @@ func updateResource(c *Client, target *resource.Info, currentObj runtime.Object, } func (c *Client) watchUntilReady(timeout time.Duration, info *resource.Info) error { + kind := info.Mapping.GroupVersionKind.Kind + switch kind { + case "Job", "Pod": + default: + return nil + } + + c.Log("Watching for changes to %s %s with timeout of %v", kind, info.Name, timeout) + w, err := resource.NewHelper(info.Client, info.Mapping).WatchSingle(info.Namespace, info.Name, info.ResourceVersion) if err != nil { return err } - kind := info.Mapping.GroupVersionKind.Kind - c.Log("Watching for changes to %s %s with timeout of %v", kind, info.Name, timeout) - // What we watch for depends on the Kind. // - For a Job, we watch for completion. // - For all else, we watch until Ready.