mirror of
https://github.com/containers/podman.git
synced 2025-06-10 17:48:29 +08:00
Ensure container dependencies are part of the same pod
Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #558 Approved by: rhatdan
This commit is contained in:
@ -413,6 +413,10 @@ func (s *BoltState) addContainer(ctr *Container, pod *Pod) error {
|
|||||||
if depCtrPod == nil {
|
if depCtrPod == nil {
|
||||||
return errors.Wrapf(ErrInvalidArg, "container %s depends on container %s which is not in pod %s", ctr.ID(), dependsCtr, pod.ID())
|
return errors.Wrapf(ErrInvalidArg, "container %s depends on container %s which is not in pod %s", ctr.ID(), dependsCtr, pod.ID())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if string(depCtrPod) != pod.ID() {
|
||||||
|
return errors.Wrapf(ErrInvalidArg, "container %s depends on container %s which is in a different pod (%s)", ctr.ID(), dependsCtr, string(depCtrPod))
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// If we're not part of a pod, we cannot depend on containets in a pod
|
// If we're not part of a pod, we cannot depend on containets in a pod
|
||||||
if depCtrPod != nil {
|
if depCtrPod != nil {
|
||||||
|
Reference in New Issue
Block a user