Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
connavar committed Jan 29, 2019
1 parent 3143cd5 commit cb2802e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion controller/pc-docker/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,10 @@ func TotalReplicas(services []swarm.Service, nodes []swarm.Node, tasks []swarm.T
for _, service := range services {
if service.Spec.Mode.Replicated != nil && service.Spec.Mode.Replicated.Replicas != nil {
//TODO Check if this is a valid way of getting the memory limits. Should probably be a pointer.
memLimit := int(service.Spec.TaskTemplate.Resources.Limits.MemoryBytes)
memLimit := 0
if service.Spec.TaskTemplate.Resources.Limits != nil {
memLimit = int(service.Spec.TaskTemplate.Resources.Limits.MemoryBytes)
}
replicaState[service.ID] = pcmodel.ServiceState{
ID: service.ID,
Name: service.Spec.Name,
Expand Down

0 comments on commit cb2802e

Please sign in to comment.