Skip to content

Commit

Permalink
Fix(deploy): sync version 2 tool config successed.
Browse files Browse the repository at this point in the history
Signed-off-by: caoxianfei1 <[email protected]>
  • Loading branch information
caoxianfei1 committed Dec 11, 2023
1 parent e362387 commit 67138fb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions internal/configure/topology/variables.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}},
}
)
Expand Down Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion internal/task/step/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 67138fb

Please sign in to comment.