From a4266581625db0a6658d69b862602e6b317aeb82 Mon Sep 17 00:00:00 2001 From: wangfei Date: Tue, 27 Dec 2022 11:11:37 +0800 Subject: [PATCH] modify lvscare name --- common/common.go | 1 + pkg/registry/local.go | 2 +- pkg/runtime/kubernetes/utils.go | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/common/common.go b/common/common.go index 6b890c76b78..8f3f4444806 100644 --- a/common/common.go +++ b/common/common.go @@ -40,6 +40,7 @@ const ( KubeLvsCareStaticPodName = "kube-lvscare" RegLvsCareStaticPodName = "reg-lvscare" StaticPodDir = "/etc/kubernetes/manifests" + LvsCareRepoAndTag = "sealerio/lvscare:v1.1.3-beta.8" ) // API diff --git a/pkg/registry/local.go b/pkg/registry/local.go index 27ae2a723a9..e9022af5735 100644 --- a/pkg/registry/local.go +++ b/pkg/registry/local.go @@ -162,7 +162,7 @@ func (c *localConfigurator) configureLvs(registryHosts, clientHosts []net.IP) er } //todo should make lvs image name as const value in sealer repo. - lvsImageURL := fmt.Sprintf("%s/sealer/lvscare:v1.1.3-beta.8", net.JoinHostPort(c.Domain, strconv.Itoa(c.Port))) + lvsImageURL := filepath.Join(net.JoinHostPort(c.Domain, strconv.Itoa(c.Port)), common.LvsCareRepoAndTag) vip := common.DefaultVIP if hosts := c.infraDriver.GetHostIPList(); len(hosts) > 0 && k8snet.IsIPv6(hosts[0]) { diff --git a/pkg/runtime/kubernetes/utils.go b/pkg/runtime/kubernetes/utils.go index 9cf5408a31e..8e98d6a4a28 100644 --- a/pkg/runtime/kubernetes/utils.go +++ b/pkg/runtime/kubernetes/utils.go @@ -18,6 +18,7 @@ import ( "context" "fmt" "net" + "path/filepath" "sort" "strconv" "strings" @@ -177,7 +178,7 @@ func GetClientFromConfig(adminConfPath string) (runtimeClient.Client, error) { } func (k *Runtime) configureLvs(masterHosts, clientHosts []net.IP) error { - lvsImageURL := fmt.Sprintf("%s/sealer/lvscare:v1.1.3-beta.8", k.Config.RegistryInfo.URL) + lvsImageURL := filepath.Join(k.Config.RegistryInfo.URL, common.LvsCareRepoAndTag) var rs []string var realEndpoints []string