From 83e520784bf5455e658bd514b3a0e29750d203a1 Mon Sep 17 00:00:00 2001 From: corneredrat Date: Sat, 4 Feb 2023 22:48:49 +0530 Subject: [PATCH] use consts --- pkg/healthchecker/types/types.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pkg/healthchecker/types/types.go b/pkg/healthchecker/types/types.go index a59ae08f..38f4536a 100644 --- a/pkg/healthchecker/types/types.go +++ b/pkg/healthchecker/types/types.go @@ -44,6 +44,10 @@ const ( nodeEnvKey = "HOST_IP" kubeletPortKey = "KUBELET_PORT" kubeProxyPortKey = "KUBEPROXY_PORT" + + defaultHostIP = "127.0.0.1" + defaultKubeletPort = "10248" + defaultKubeproxyPort = "10256" ) var ( @@ -58,9 +62,9 @@ func init() { func setKubeEndpoints() { var o string - hostIP := "127.0.0.1" - kubeletPort := "10248" - kubeProxyPort := "10256" + hostIP := defaultHostIP + kubeletPort := defaultKubeletPort + kubeProxyPort := defaultKubeproxyPort o = os.Getenv(nodeEnvKey) if o != "" {