diff options
author | Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com> | 2018-07-11 17:32:44 +0100 |
---|---|---|
committer | Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com> | 2018-07-13 17:30:51 +0100 |
commit | 2429ef152b5503d939022fbfd145b88a1df5c23b (patch) | |
tree | 2096853bd15d7e7d347834e9e419030733cba1d7 /yardstick/orchestrator/kubernetes.py | |
parent | 0ca0696d0a22daca831daa8f9815bdeaea29aea1 (diff) |
Add interface and network information to Kubernetes context
Add to "Kubernetes" context the "interfaces" information when retrieving
a server. This information is needed for NSPerf test cases.
The interface information comes from the resource controller network list.
Each replication controller will have one port per network defined.
JIRA: YARDSTICK-1303
Change-Id: Ifb0e17df295c042a643128c705a93876af999bad
Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
Diffstat (limited to 'yardstick/orchestrator/kubernetes.py')
-rw-r--r-- | yardstick/orchestrator/kubernetes.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/yardstick/orchestrator/kubernetes.py b/yardstick/orchestrator/kubernetes.py index bb01b33fa..98832908c 100644 --- a/yardstick/orchestrator/kubernetes.py +++ b/yardstick/orchestrator/kubernetes.py @@ -146,6 +146,10 @@ class ReplicationControllerObject(object): self._add_networks() self._add_tolerations() + @property + def networks(self): + return self._networks + def get_template(self): return self.template @@ -423,7 +427,7 @@ class KubernetesTemplate(object): self.rcs = {self._get_rc_name(rc): cfg for rc, cfg in servers_cfg.items()} - self.k8s_objs = [ReplicationControllerObject( + self.rc_objs = [ReplicationControllerObject( rc, ssh_key=self.ssh_key, **cfg) for rc, cfg in self.rcs.items()] self.service_objs = [ServiceNodePortObject(rc, **cfg) for rc, cfg in self.rcs.items()] @@ -442,3 +446,8 @@ class KubernetesTemplate(object): if p.metadata.name.startswith(s)] return self.pods + + def get_rc_by_name(self, rc_name): + """Returns a ``ReplicationControllerObject``, searching by name""" + for rc in (rc for rc in self.rc_objs if rc.name == rc_name): + return rc |