Really ignore unsupported service types

Due to how Kuryr implements service networking, NodePort services are
not supported and nobody brought up a good case for their support.
Without this fix, we'd not generate a proper spec but we'd try to
process them ending up in failure.

Change-Id: I1e02a7a7fdfd2a49b0759f959adedf038bf1ca6e
Closes-Bug: #1774634
Signed-off-by: Antoni Segura Puimedon <antonisp@celebdor.com>
This commit is contained in:
Antoni Segura Puimedon
2018-06-01 15:05:49 +02:00
parent ab18b43c85
commit 71864e8cdd

View File

@@ -50,8 +50,9 @@ class LBaaSSpecHandler(k8s_base.ResourceEventHandler):
lbaas_spec = self._get_lbaas_spec(service)
if self._should_ignore(service):
LOG.debug("Skiping Kubernetes service without a selector as "
"Kubernetes does not create an endpoint object for it.")
LOG.debug("Skiping Kubernetes service of an unsupported kind or"
"without a selector as Kubernetes does not create an "
"endpoint object for it.")
return
if self._has_lbaas_spec_changes(service, lbaas_spec):
@@ -69,7 +70,8 @@ class LBaaSSpecHandler(k8s_base.ResourceEventHandler):
def _should_ignore(self, service):
return (not(self._has_selector(service)) or
not(self._has_clusterip(service)))
not(self._has_clusterip(service)) or
not(self._is_supported_type(service)))
def _has_selector(self, service):
return service['spec'].get('selector')