engine: resources: Container stopped should be valid for no container
This commit is contained in:
@@ -296,7 +296,9 @@ func (obj *DockerContainerRes) CheckApply(ctx context.Context, apply bool) (bool
|
|||||||
if len(containerList) > 1 {
|
if len(containerList) > 1 {
|
||||||
return false, fmt.Errorf("more than one container named %s", obj.Name())
|
return false, fmt.Errorf("more than one container named %s", obj.Name())
|
||||||
}
|
}
|
||||||
if len(containerList) == 0 && obj.State == ContainerRemoved {
|
// NOTE: If container doesn't exist, we might as well accept "stopped"
|
||||||
|
// as valid for now, at least until we rewrite this horrible code.
|
||||||
|
if len(containerList) == 0 && (obj.State == ContainerRemoved || obj.State == ContainerStopped) {
|
||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
if len(containerList) == 1 {
|
if len(containerList) == 1 {
|
||||||
|
|||||||
Reference in New Issue
Block a user