|
|
|
@ -421,7 +421,13 @@ func (c *Client) watchUntilReady(timeout time.Duration, info *resource.Info) err
|
|
|
|
|
|
|
|
|
|
c.Log("Watching for changes to %s %s with timeout of %v", kind, info.Name, timeout)
|
|
|
|
|
|
|
|
|
|
lw := cachetools.NewListWatchFromClient(info.Client, info.Mapping.Resource.Resource, info.Namespace, fields.Everything())
|
|
|
|
|
// Use a selector on the name of the resource. This should be unique for the
|
|
|
|
|
// given version and kind
|
|
|
|
|
selector, err := fields.ParseSelector(fmt.Sprintf("metadata.name=%s", info.Name))
|
|
|
|
|
if err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
lw := cachetools.NewListWatchFromClient(info.Client, info.Mapping.Resource.Resource, info.Namespace, selector)
|
|
|
|
|
|
|
|
|
|
// What we watch for depends on the Kind.
|
|
|
|
|
// - For a Job, we watch for completion.
|
|
|
|
@ -431,7 +437,7 @@ func (c *Client) watchUntilReady(timeout time.Duration, info *resource.Info) err
|
|
|
|
|
|
|
|
|
|
ctx, cancel := watchtools.ContextWithOptionalTimeout(context.Background(), timeout)
|
|
|
|
|
defer cancel()
|
|
|
|
|
_, err := watchtools.ListWatchUntil(ctx, lw, func(e watch.Event) (bool, error) {
|
|
|
|
|
_, err = watchtools.ListWatchUntil(ctx, lw, func(e watch.Event) (bool, error) {
|
|
|
|
|
// Make sure the incoming object is versioned as we use unstructured
|
|
|
|
|
// objects when we build manifests
|
|
|
|
|
obj := convertWithMapper(e.Object, info.Mapping)
|
|
|
|
|