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