# Ignore here to make self.available() fail with a proper error message
pass
+ assert isinstance(self.storage_class_name, str)
+
self._rook_cluster = RookCluster(
self._k8s_CoreV1_api,
self._k8s_BatchV1_api,
self._k8s_CustomObjects_api,
- self._rook_env)
+ self._k8s_StorageV1_api,
+ self._rook_env,
+ self.storage_class_name)
self._initialized.set()
class RookCluster(object):
# import of client.CoreV1Api must be optional at import time.
# Instead allow mgr/rook to be imported anyway.
- def __init__(self, coreV1_api: 'client.CoreV1Api', batchV1_api: 'client.BatchV1Api', customObjects_api: 'client.CustomObjectsApi', rook_env: 'RookEnv'):
+ def __init__(self, coreV1_api: 'client.CoreV1Api', batchV1_api: 'client.BatchV1Api', customObjects_api: 'client.CustomObjectsApi', storageV1_api: 'client.StorageV1Api', rook_env: 'RookEnv', storage_class_name: 'str'):
self.rook_env = rook_env # type: RookEnv
self.coreV1_api = coreV1_api # client.CoreV1Api
self.batchV1_api = batchV1_api
self.customObjects_api = customObjects_api
+ self.storageV1_api = storageV1_api # client.StorageV1Api
+ self.storage_class_name = storage_class_name # type: str
# TODO: replace direct k8s calls with Rook API calls
# when they're implemented