diff --git a/src/common/kube-helpers.ts b/src/common/kube-helpers.ts index 1387d1aa1b..0826edf843 100644 --- a/src/common/kube-helpers.ts +++ b/src/common/kube-helpers.ts @@ -160,11 +160,11 @@ export function getNodeWarningConditions(node: V1Node) { * Validates Context, User and Cluster sructs in given kubeconfig. Additionally this will validate * the command passed to the exec substructure. */ -export function validateKubeConfig (config: KubeConfig, contextName: string, validationOpts?: KubeConfigValidationOpts) { +export function validateKubeConfig (config: KubeConfig, contextName: string, validationOpts: KubeConfigValidationOpts = {}) { // we only receive a single context, cluster & user object here so lets validate them as this // will be called when we add a new cluster to Lens - const { validateUser = true, validateCluster = true, validateExec = true } = validationOpts || {}; + const { validateUser = true, validateCluster = true, validateExec = true } = validationOpts; const contextObject = config.getContextObject(contextName);