dependencygraph: Verify steady state can resolve
@@ -73,7 +73,8 @@ func dependenciesCanBeResolved(target *api.Container, by []*api.Container) bool
}
return verifyStatusResolvable(target, nameMap, neededVolumeContainers, volumeCanResolve) &&
- verifyStatusResolvable(target, nameMap, linksToContainerNames(target.Links), linkCanResolve)
+ verifyStatusResolvable(target, nameMap, linksToContainerNames(target.Links), linkCanResolve) &&
+ verifyStatusResolvable(target, nameMap, target.SteadyStateDependencies, onSteadyStateCanResolve)
}
// DependenciesAreResolved validates that the `target` container can be
@@ -201,6 +202,11 @@ func volumeIsResolved(target *api.Container, volume *api.Container) bool {
knownStatus == api.ContainerStopped
}
+func onSteadyStateCanResolve(target *api.Container, run *api.Container) bool {
+ return target.GetDesiredStatus() >= api.ContainerCreated &&
+ run.GetDesiredStatus() >= run.GetSteadyStateStatus()
+}
+
// onSteadyStateIsResolved defines a relationship where a target cannot be
// created until 'dependency' has reached the steady state. Transitions include pulling.
func onSteadyStateIsResolved(target *api.Container, run *api.Container) bool {
