in agent/api/testutils/container_equal.go [30:90]
func ContainersEqual(lhs, rhs *apicontainer.Container) bool {
if lhs == rhs {
return true
}
if lhs.Name != rhs.Name || lhs.Image != rhs.Image {
return false
}
if !utils.StrSliceEqual(lhs.Command, rhs.Command) {
return false
}
if lhs.CPU != rhs.CPU || lhs.Memory != rhs.Memory {
return false
}
// Order doesn't matter
if !utils.SlicesDeepEqual(lhs.Links, rhs.Links) {
return false
}
if !utils.SlicesDeepEqual(lhs.VolumesFrom, rhs.VolumesFrom) {
return false
}
if !utils.SlicesDeepEqual(lhs.MountPoints, rhs.MountPoints) {
return false
}
if !utils.SlicesDeepEqual(lhs.Ports, rhs.Ports) {
return false
}
if !utils.SlicesDeepEqual(lhs.KnownPortBindingsUnsafe, rhs.KnownPortBindingsUnsafe) {
return false
}
if lhs.Essential != rhs.Essential {
return false
}
if lhs.EntryPoint == nil || rhs.EntryPoint == nil {
if lhs.EntryPoint != rhs.EntryPoint {
return false
}
// both nil
} else {
if !utils.StrSliceEqual(*lhs.EntryPoint, *rhs.EntryPoint) {
return false
}
}
if !reflect.DeepEqual(lhs.Environment, rhs.Environment) {
return false
}
if !ContainerOverridesEqual(lhs.Overrides, rhs.Overrides) {
return false
}
if lhs.DesiredStatusUnsafe != rhs.DesiredStatusUnsafe || lhs.KnownStatusUnsafe != rhs.KnownStatusUnsafe {
return false
}
if lhs.AppliedStatus != rhs.AppliedStatus {
return false
}
if !reflect.DeepEqual(lhs.GetKnownExitCode(), rhs.GetKnownExitCode()) {
return false
}
return true
}