diff --git a/run_kraken.py b/run_kraken.py index 71d1c47b0..e0e9a4931 100644 --- a/run_kraken.py +++ b/run_kraken.py @@ -223,13 +223,16 @@ def main(options, command: Optional[str]) -> int: safe_logger = SafeLogger(filename=telemetry_log_file) try: - kubeconfig_path os.environ["KUBECONFIG"] = str(kubeconfig_path) # krkn-lib-kubernetes init kubecli = KrknKubernetes(kubeconfig_path=kubeconfig_path) ocpcli = KrknOpenshift(kubeconfig_path=kubeconfig_path) - except: - kubecli.initialize_clients(None) + except Exception: + logging.exception( + "Failed to initialize Kubernetes client with kubeconfig %s, exiting with code 1", + kubeconfig_path, + ) + return 1 distribution = "kubernetes" if ocpcli.is_openshift():