Merge pull request #6208 from adamreese/fix/job-wait

fix(pkg/kube): only wait for events from Jobs and Pods
pull/6207/head
Adam Reese 5 years ago committed by GitHub
commit 6ab25d2242
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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.

Loading…
Cancel
Save