From 2f25f49dce3a648e1451f23f89fd73a2e1085123 Mon Sep 17 00:00:00 2001 From: Koushik Dey <57134947+koushdey@users.noreply.github.com> Date: Tue, 17 Aug 2021 16:39:17 +0530 Subject: [PATCH] Sending a warning instead of throwing error when KUBECONFIG is missing. (#145) --- lib/run.js | 2 +- src/run.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/run.js b/lib/run.js index a4053ed46..73d333114 100644 --- a/lib/run.js +++ b/lib/run.js @@ -53,7 +53,7 @@ function installKubectl(version) { } function checkClusterContext() { if (!process.env["KUBECONFIG"]) { - throw new Error('Cluster context not set. Use k8ssetcontext action to set cluster context'); + core.warning('KUBECONFIG env is not explicitly set. Ensure cluster context is set by using k8s-set-context / aks-set-context action.'); } } function run() { diff --git a/src/run.ts b/src/run.ts index 840cf202d..7afdb0ed7 100644 --- a/src/run.ts +++ b/src/run.ts @@ -42,7 +42,7 @@ async function installKubectl(version: string) { function checkClusterContext() { if (!process.env["KUBECONFIG"]) { - throw new Error('Cluster context not set. Use k8ssetcontext action to set cluster context'); + core.warning('KUBECONFIG env is not explicitly set. Ensure cluster context is set by using k8s-set-context / aks-set-context action.'); } }