fix runtime panic (#335)

This commit is contained in:
n1xx1
2024-10-18 14:51:19 +02:00
committed by GitHub
parent 8ab6e4875c
commit 9e194d5dc8
+1 -1
View File
@@ -160,7 +160,7 @@ func (w *dockerSwarmWatcherImpl) listServices(ctx context.Context) ([]*routableS
var result []*routableService
for _, service := range services {
if service.Spec.EndpointSpec.Mode != swarmtypes.ResolutionModeVIP {
if service.Spec.EndpointSpec == nil || service.Spec.EndpointSpec.Mode != swarmtypes.ResolutionModeVIP {
continue
}
if len(service.Endpoint.VirtualIPs) == 0 {