Refactoring of k8s manager and tests
Changes:
- Official kubernetes python lib
- Rewrite k8s api wrapper in OOP manner
- Use api where its possible instead of cli
- Remove virtlet code because its can be replaced with pod api
- Remove unused/oudated manager code
- Remove bug workaround in k8s upgrade template
- Remove netchecker obsolete code
- Remove unfinished test_rbd_flexvolume_driver
Change-Id: I446a240123282196a6ba54f588aea84791f175ba
Related-PROD: PROD-21700
diff --git a/tcp_tests/managers/k8s/componentstatuses.py b/tcp_tests/managers/k8s/componentstatuses.py
index a991576..7a9c27a 100644
--- a/tcp_tests/managers/k8s/componentstatuses.py
+++ b/tcp_tests/managers/k8s/componentstatuses.py
@@ -17,23 +17,21 @@
class K8sComponentStatus(K8sBaseResource):
- """docstring for K8sComponentStatus"""
+ resource_type = 'componentstatus'
- def __repr__(self):
- return "<K8sComponentStatus: %s>" % self.name
-
- @property
- def name(self):
- return self.metadata.name
+ def _read(self, **kwargs):
+ return self._manager.api.read_component_status(self.name, **kwargs)
class K8sComponentStatusManager(K8sBaseManager):
- """docstring for ClassName"""
-
resource_class = K8sComponentStatus
- def _get(self, name, **kwargs):
- return self.api.read_namespaced_component_status(name=name, **kwargs)
+ @property
+ def api(self):
+ return self._cluster.api_core
- def _list(self, **kwargs):
- return self.api.list_namespaced_component_status(**kwargs)
+ def _list(self, namespace, **kwargs):
+ return self.api.list_component_status(**kwargs)
+
+ def _list_all(self, **kwargs):
+ return self._list(None, **kwargs)