def main() -> None: args = parse_args() soa_dir = args.soa_dir if args.verbose: logging.basicConfig(level=logging.DEBUG) else: logging.basicConfig(level=logging.INFO) kube_client: Any = KubeClient() if args.dry_run: kube_client = StdoutKubeClient(kube_client) system_paasta_config = load_system_paasta_config() cluster = args.cluster or system_paasta_config.get_cluster() custom_resource_definitions = load_custom_resource_definitions( system_paasta_config) setup_kube_succeeded = setup_all_custom_resources( kube_client=kube_client, soa_dir=soa_dir, cluster=cluster, custom_resource_definitions=custom_resource_definitions, service=args.service, instance=args.instance, ) sys.exit(0 if setup_kube_succeeded else 1)
def main() -> None: args = parse_args() soa_dir = args.soa_dir if args.verbose: logging.basicConfig(level=logging.DEBUG) else: logging.basicConfig(level=logging.INFO) kube_client = KubeClient() system_paasta_config = load_system_paasta_config() cluster = args.cluster or system_paasta_config.get_cluster() custom_resource_definitions = load_custom_resource_definitions( system_paasta_config) cleanup_kube_succeeded = cleanup_all_custom_resources( kube_client=kube_client, soa_dir=soa_dir, cluster=cluster, custom_resource_definitions=custom_resource_definitions, ) sys.exit(0 if cleanup_kube_succeeded else 1)