def run( dry_run, thread_pool_size=10, internal=None, use_jump_host=True, cluster_name=None, namespace_name=None, defer=None, ): providers = ["resource", "resource-template"] orb.QONTRACT_INTEGRATION = QONTRACT_INTEGRATION orb.QONTRACT_INTEGRATION_VERSION = QONTRACT_INTEGRATION_VERSION ri = orb.run( dry_run=dry_run, thread_pool_size=thread_pool_size, internal=internal, use_jump_host=use_jump_host, providers=providers, cluster_name=cluster_name, namespace_name=namespace_name, init_api_resources=True, ) # check for unused resources types # listed under `managedResourceTypes` ob.check_unused_resource_types(ri)
def run(dry_run, thread_pool_size=10, internal=None, use_jump_host=True, defer=None): providers = ['resource', 'resource-template'] orb.QONTRACT_INTEGRATION = QONTRACT_INTEGRATION orb.QONTRACT_INTEGRATION_VERSION = QONTRACT_INTEGRATION_VERSION ri = orb.run(dry_run=dry_run, thread_pool_size=thread_pool_size, internal=internal, use_jump_host=use_jump_host, providers=providers) # check for unused resources types # listed under `managedResourceTypes` ob.check_unused_resource_types(ri)
def run(dry_run=False, thread_pool_size=10, internal=None, use_jump_host=True, defer=None): gqlapi = gql.get_api() namespaces = gqlapi.query(NAMESPACES_QUERY)['namespaces'] oc_map, ri = \ fetch_data(namespaces, thread_pool_size, internal, use_jump_host) defer(lambda: oc_map.cleanup()) # check for unused resources types # listed under `managedResourceTypes` # only applicable for openshift-resources ob.check_unused_resource_types(ri) enable_deletion = False if ri.has_error_registered() else True ob.realize_data(dry_run, oc_map, ri, enable_deletion=enable_deletion) if ri.has_error_registered(): sys.exit(1)