From 67138fbc5eaa560f8d42f615aa24f5715c92072c Mon Sep 17 00:00:00 2001 From: caoxianfei1 Date: Mon, 11 Dec 2023 10:16:52 +0800 Subject: [PATCH] Fix(deploy): sync version 2 tool config successed. Signed-off-by: caoxianfei1 --- internal/configure/topology/variables.go | 6 ++++++ internal/task/step/file.go | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/internal/configure/topology/variables.go b/internal/configure/topology/variables.go index 02cb4bb65..a2b246805 100644 --- a/internal/configure/topology/variables.go +++ b/internal/configure/topology/variables.go @@ -122,6 +122,8 @@ var ( {name: "cluster_snapshotclone_proxy_addr", kind: []string{KIND_CURVEBS}}, {name: "cluster_snapshotclone_dummy_port", kind: []string{KIND_CURVEBS}}, {name: "cluster_snapshotclone_nginx_upstream", kind: []string{KIND_CURVEBS}}, + {name: "cluster_snapshot_addr"}, // tools-v2: compatible with some old version image + {name: "cluster_snapshot_dummy_addr"}, // tools-v2 {name: "cluster_metaserver_addr", kind: []string{KIND_CURVEFS}}, } ) @@ -301,6 +303,10 @@ func getValue(name string, dcs []*DeployConfig, idx int) string { return joinDummyPort(dcs, ROLE_SNAPSHOTCLONE) case "cluster_snapshotclone_nginx_upstream": return joinNginxUpstreamServer(dcs) + case "cluster_snapshot_addr": + return joinPeer(dcs, ROLE_SNAPSHOTCLONE, SELECT_LISTEN_PORT) + case "cluster_snapshot_dummy_addr": + return joinPeer(dcs, ROLE_SNAPSHOTCLONE, SELECT_LISTEN_DUMMY_PORT) case "cluster_metaserver_addr": return joinPeer(dcs, ROLE_METASERVER, SELECT_LISTEN_PORT) } diff --git a/internal/task/step/file.go b/internal/task/step/file.go index cfd4fc575..8dc4afbc7 100644 --- a/internal/task/step/file.go +++ b/internal/task/step/file.go @@ -196,7 +196,7 @@ func (s *InstallFile) Execute(ctx *context.Context) error { } func (s *Filter) kvSplit(line string, key, value *string) error { - pattern := fmt.Sprintf(REGEX_KV_SPLIT, s.KVFieldSplit, s.KVFieldSplit) + pattern := fmt.Sprintf(REGEX_KV_SPLIT, strings.TrimSpace(s.KVFieldSplit), s.KVFieldSplit) regex, err := regexp.Compile(pattern) if err != nil { return errno.ERR_BUILD_REGEX_FAILED.E(err)