|
|
|
|
@ -43,14 +43,15 @@ import (
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type statusWaiter struct {
|
|
|
|
|
client dynamic.Interface
|
|
|
|
|
restMapper meta.RESTMapper
|
|
|
|
|
ctx context.Context
|
|
|
|
|
watchUntilReadyCtx context.Context
|
|
|
|
|
waitCtx context.Context
|
|
|
|
|
waitWithJobsCtx context.Context
|
|
|
|
|
waitForDeleteCtx context.Context
|
|
|
|
|
readers []engine.StatusReader
|
|
|
|
|
client dynamic.Interface
|
|
|
|
|
restMapper meta.RESTMapper
|
|
|
|
|
ctx context.Context
|
|
|
|
|
watchUntilReadyCtx context.Context
|
|
|
|
|
waitCtx context.Context
|
|
|
|
|
waitWithJobsCtx context.Context
|
|
|
|
|
waitForDeleteCtx context.Context
|
|
|
|
|
readers []engine.StatusReader
|
|
|
|
|
statusComputeWorkers int
|
|
|
|
|
logging.LogHolder
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -76,6 +77,7 @@ func (w *statusWaiter) WatchUntilReady(resourceList ResourceList, timeout time.D
|
|
|
|
|
defer cancel()
|
|
|
|
|
w.Logger().Debug("waiting for resources", "count", len(resourceList), "timeout", timeout)
|
|
|
|
|
sw := watcher.NewDefaultStatusWatcher(w.client, w.restMapper)
|
|
|
|
|
sw.StatusComputeWorkers = w.statusComputeWorkers
|
|
|
|
|
jobSR := helmStatusReaders.NewCustomJobStatusReader(w.restMapper)
|
|
|
|
|
podSR := helmStatusReaders.NewCustomPodStatusReader(w.restMapper)
|
|
|
|
|
// We don't want to wait on any other resources as watchUntilReady is only for Helm hooks.
|
|
|
|
|
@ -98,6 +100,7 @@ func (w *statusWaiter) Wait(resourceList ResourceList, timeout time.Duration) er
|
|
|
|
|
defer cancel()
|
|
|
|
|
w.Logger().Debug("waiting for resources", "count", len(resourceList), "timeout", timeout)
|
|
|
|
|
sw := watcher.NewDefaultStatusWatcher(w.client, w.restMapper)
|
|
|
|
|
sw.StatusComputeWorkers = w.statusComputeWorkers
|
|
|
|
|
sw.StatusReader = statusreaders.NewStatusReader(w.restMapper, w.readers...)
|
|
|
|
|
return w.wait(ctx, resourceList, sw)
|
|
|
|
|
}
|
|
|
|
|
@ -110,6 +113,7 @@ func (w *statusWaiter) WaitWithJobs(resourceList ResourceList, timeout time.Dura
|
|
|
|
|
defer cancel()
|
|
|
|
|
w.Logger().Debug("waiting for resources", "count", len(resourceList), "timeout", timeout)
|
|
|
|
|
sw := watcher.NewDefaultStatusWatcher(w.client, w.restMapper)
|
|
|
|
|
sw.StatusComputeWorkers = w.statusComputeWorkers
|
|
|
|
|
newCustomJobStatusReader := helmStatusReaders.NewCustomJobStatusReader(w.restMapper)
|
|
|
|
|
readers := append([]engine.StatusReader(nil), w.readers...)
|
|
|
|
|
readers = append(readers, newCustomJobStatusReader)
|
|
|
|
|
|