mirror of
https://github.com/psviderski/uncloud.git
synced 2026-10-06 13:18:58 +00:00
chore: compare container ports to spec in assertContainerMatchesSpec
This commit is contained in:
1 parent
3910101a88
commit
2d923380a3
2 files changed
+39
-2
No files matched your search
@@ -24,8 +24,16 @@ func CompareContainerToSpec(ctr api.Container, spec api.ServiceSpec) (ContainerS
|
||||
}
|
||||
|
||||
// TODO: compare mutable properties such as memory or CPU limits when they are implemented.
|
||||
|
||||
// TODO: compare ports
|
||||
|
||||
// TODO: remove ports check when ports are stored in the local machine store instead of as labels.
|
||||
ports, err := ctr.ServicePorts()
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("get service ports: %w", err)
|
||||
}
|
||||
|
||||
if !api.PortsEqual(ports, spec.Ports) {
|
||||
return ContainerNeedsRecreate, nil
|
||||
}
|
||||
|
||||
return ContainerUpToDate, nil
|
||||
}
|
||||
Reference in new issue
Block a user