X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=ric_robot_suite%2Fric-python-utils%2Fricutils%2FKubernetesEntity.py;h=ad34f17e762388453ada6afff76a1e828afc0229;hb=refs%2Fchanges%2F63%2F6163%2F1;hp=74bddb3820593f1dcf3936419b78b6e05fb7e283;hpb=ffca952d72f824ea3cda7e03ec7c14b2a12de3df;p=it%2Ftest.git diff --git a/ric_robot_suite/ric-python-utils/ricutils/KubernetesEntity.py b/ric_robot_suite/ric-python-utils/ricutils/KubernetesEntity.py index 74bddb3..ad34f17 100644 --- a/ric_robot_suite/ric-python-utils/ricutils/KubernetesEntity.py +++ b/ric_robot_suite/ric-python-utils/ricutils/KubernetesEntity.py @@ -53,7 +53,7 @@ class KubernetesEntity(object): # that the typical check here sfst.replicas == sfst.ready_replicas return self._k8sApp.read_namespaced_stateful_set(namespace = namespace or self._ns, name=name) - + def Service(self, name, namespace=None): # as above, we'll rely on this to throw if the svc dne. @@ -98,7 +98,7 @@ class KubernetesEntity(object): d = self.Deployment(name, namespace or self._ns) labels = d.spec.selector.match_labels pods = self._k8sCore.list_namespaced_pod(namespace or self._ns, - label_selector=",".join(map(lambda k: k + "=" + labels[k], + label_selector=",".join(map(lambda k: k + "=" + labels[k], labels))) return list(map(lambda i: i.metadata.name, pods.items)) @@ -122,7 +122,7 @@ class KubernetesEntity(object): # after performance here. ctx=ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) c = client.Configuration() - + async def ExecCoroutine(): # base64.channel.k8s.io is also a valid subprotocol, but i don't see any # reason to support it. @@ -136,12 +136,12 @@ class KubernetesEntity(object): # i really don't want to be bothered with asyncio exception handling # for that vanishingly improbable case. output[channels[message[0]]].extend(message[1:-1].decode('utf-8').split('\n')) - + ctx.load_verify_locations(c.ssl_ca_cert) if(c.cert_file and c.key_file): ctx.load_cert_chain(c.cert_file, c.key_file) uri = 'wss://%s%s' % (c.host.lstrip('https://'), path) asyncio.get_event_loop().run_until_complete(ExecCoroutine()) - + return(output)