From f2ea7a4cdddfc2f6c7b266c286d0664b7435a0d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9E=89=ED=93=A8?= Date: Sat, 5 Oct 2024 17:01:32 +0900 Subject: [PATCH] chore: code formatting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 잉퓨 --- chaoscenter/subscriber/pkg/k8s/client.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/chaoscenter/subscriber/pkg/k8s/client.go b/chaoscenter/subscriber/pkg/k8s/client.go index 020bf81fbc5..bd84e987ce7 100644 --- a/chaoscenter/subscriber/pkg/k8s/client.go +++ b/chaoscenter/subscriber/pkg/k8s/client.go @@ -16,11 +16,8 @@ var KubeConfig *string // getKubeConfig setup the config for access cluster resource func (k8s *k8sSubscriber) GetKubeConfig() (*rest.Config, error) { - if KubeConfig == nil { - return rest.InClusterConfig() - } - - if *KubeConfig == "" { + // Use in-cluster config if kubeconfig path is not specified + if *KubeConfig == "" || KubeConfig == nil { return rest.InClusterConfig() }