From f44b2d8e710cf1d0f5dc48727f0d13de9ceb5622 Mon Sep 17 00:00:00 2001 From: allencloud Date: Thu, 1 Sep 2016 13:30:00 +0800 Subject: [PATCH] fix panic in portallocator Signed-off-by: allencloud --- manager/allocator/networkallocator/portallocator.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manager/allocator/networkallocator/portallocator.go b/manager/allocator/networkallocator/portallocator.go index 10843b73e4..49dcbf6c57 100644 --- a/manager/allocator/networkallocator/portallocator.go +++ b/manager/allocator/networkallocator/portallocator.go @@ -155,7 +155,7 @@ func (pa *portAllocator) serviceDeallocatePorts(s *api.Service) { } func (pa *portAllocator) isPortsAllocated(s *api.Service) bool { - if s.Endpoint == nil { + if s.Endpoint == nil || s.Spec.Endpoint == nil { return false }