Exemplo n.º 1
0
def create_storage_class(config=None, name=None):
    if config is None:
        config = create_config()
    obj = K8sStorageClass(
        config=config,
        name=name
    )
    return obj
Exemplo n.º 2
0
def cleanup_storage_class():
    ref = create_storage_class(name="throwaway")
    if is_reachable(ref.config.api_host):
        _list = ref.list()
        while len(_list) > 0:
            for p in _list:
                try:
                    sc = K8sStorageClass(config=ref.config, name=p['metadata']['name']).get()
                    sc.delete()
                except NotFoundException:
                    continue
            _list = ref.list()