Skip to content

Commit

Permalink
START container ordering dependency: return true if dependsOn contain…
Browse files Browse the repository at this point in the history
…er's status >= RUNNING
  • Loading branch information
singholt committed Sep 26, 2023
1 parent c2993d9 commit 0b5b9f8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions agent/engine/dependencygraph/graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -426,11 +426,13 @@ func containerOrderingDependenciesIsResolved(target *apicontainer.Container,
case createCondition:
// The 'target' container desires to be moved to 'Created' or the 'steady' state.
// Allow this only if the known status of the dependency container state is already started
// i.e it's state is any of 'Created', 'steady state' or 'Stopped'
// i.e. it's state is any of 'Created', 'steady state' or 'Stopped'
return dependsOnContainerKnownStatus >= apicontainerstatus.ContainerCreated

case startCondition:
if targetDesiredStatus == apicontainerstatus.ContainerCreated {
if dependsOnContainerKnownStatus == apicontainerstatus.ContainerStopped {
return true
} else if targetDesiredStatus == apicontainerstatus.ContainerCreated {
// The 'target' container desires to be moved to 'Created' state.
// Allow this only if the known status of the linked container is
// 'Created' or if the dependency container is in 'steady state'
Expand Down

0 comments on commit 0b5b9f8

Please sign in to comment.