Skip to content

Commit 44150de

Browse files
committed
[.dingoadm] set .dingoadm as the default command home directory
1 parent a6c467a commit 44150de

File tree

14 files changed

+164
-25
lines changed

14 files changed

+164
-25
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@ License
3131

3232
CurveAdm is under the Apache 2.0 license. See the [LICENSE](LICENSE) file for details.
3333

34-
[docs]: https://github.com/dingodb/curveadm/wiki
35-
[contributing]: https://github.com/dingodb/curveadm/wiki/others#参与-curveadm-的开发
34+
[docs]: https://github.com/dingodb/dingoadm/wiki
35+
[contributing]: https://github.com/dingodb/dingoadm/wiki/others#参与-dingoadm-的开发

cli/cli/cli.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@ type CurveAdm struct {
7373
}
7474

7575
/*
76-
* $HOME/.curveadm
77-
* - curveadm.cfg
76+
* $HOME/.dingoadm
77+
* - dingoadm.cfg
7878
* - /bin/dingoadm
79-
* - /data/curveadm.db
79+
* - /data/dingoadm.db
8080
* - /plugins/{shell,file,polarfs}
8181
* - /logs/2006-01-02_15-04-05.log
8282
* - /temp/
@@ -87,7 +87,7 @@ func NewCurveAdm() (*CurveAdm, error) {
8787
return nil, errno.ERR_GET_USER_HOME_DIR_FAILED.E(err)
8888
}
8989

90-
rootDir := fmt.Sprintf("%s/.curveadm", home)
90+
rootDir := fmt.Sprintf("%s/.dingoadm", home)
9191
curveadm := &CurveAdm{
9292
rootDir: rootDir,
9393
dataDir: path.Join(rootDir, "data"),
@@ -120,8 +120,8 @@ func (curveadm *CurveAdm) init() error {
120120
}
121121
}
122122

123-
// (2) Parse curveadm.cfg
124-
confpath := fmt.Sprintf("%s/curveadm.cfg", curveadm.rootDir)
123+
// (2) Parse dingoadm.cfg
124+
confpath := fmt.Sprintf("%s/dingoadm.cfg", curveadm.rootDir)
125125
config, err := configure.ParseCurveAdmConfig(confpath)
126126
if err != nil {
127127
return err
@@ -130,7 +130,7 @@ func (curveadm *CurveAdm) init() error {
130130

131131
// (3) Init logger
132132
now := time.Now().Format("2006-01-02_15-04-05")
133-
logpath := fmt.Sprintf("%s/curveadm-%s.log", curveadm.logDir, now)
133+
logpath := fmt.Sprintf("%s/dingoadm-%s.log", curveadm.logDir, now)
134134
if err := log.Init(config.GetLogLevel(), logpath); err != nil {
135135
return errno.ERR_INIT_LOGGER_FAILED.E(err)
136136
} else {
@@ -422,7 +422,7 @@ func (curveadm *CurveAdm) CheckRole(role string) error {
422422

423423
kind := dcs[0].GetKind()
424424
roles := topology.CURVEBS_ROLES
425-
if kind == topology.KIND_CURVEFS {
425+
if kind == topology.KIND_CURVEFS || kind == topology.KIND_DINGOFS {
426426
roles = topology.CURVEFS_ROLES
427427
}
428428
supported := utils.Slice2Map(roles)

cli/command/client/enter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func runEnter(curveadm *cli.CurveAdm, options enterOptions) error {
6464
// 2) attch remote container
6565
client := clients[0]
6666
home := "/curvebs/nebd"
67-
if client.Kind == topology.KIND_CURVEFS {
67+
if client.Kind == topology.KIND_CURVEFS || client.Kind == topology.KIND_DINGOFS {
6868
home = "/curvefs/client"
6969
}
7070
return tools.AttachRemoteContainer(curveadm, client.Host, client.ContainerId, home)

cli/command/client/install.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ type installOptions struct {
5050

5151
func checkInstallOptions(curveadm *cli.CurveAdm, options installOptions) error {
5252
kind := options.kind
53-
if kind != topology.KIND_CURVEBS && kind != topology.KIND_CURVEFS {
53+
if kind != topology.KIND_CURVEBS && kind != topology.KIND_CURVEFS && kind != topology.KIND_DINGOFS {
5454
return errno.ERR_UNSUPPORT_CLIENT_KIND.F("kind: %s", kind)
5555
} else if !utils.PathExist(options.filename) {
5656
return errno.ERR_CLIENT_CONFIGURE_FILE_NOT_EXIST.

cli/command/client/uninstall.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ type uninstallOptions struct {
4747

4848
func checkUninstallOptions(curveadm *cli.CurveAdm, options uninstallOptions) error {
4949
kind := options.kind
50-
if kind != topology.KIND_CURVEBS && kind != topology.KIND_CURVEFS {
50+
if kind != topology.KIND_CURVEBS && kind != topology.KIND_CURVEFS && kind != topology.KIND_DINGOFS {
5151
return errno.ERR_UNSUPPORT_CLIENT_KIND.
5252
F("kind: %s", kind)
5353
}

internal/configure/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ func NewClientConfig(config map[string]interface{}) (*ClientConfig, error) {
122122
kind := cc.GetKind()
123123
field := utils.Choose(kind == topology.KIND_CURVEBS,
124124
KEY_CURVEBS_LISTEN_MDS_ADDRS, KEY_CURVEFS_LISTEN_MDS_ADDRS)
125-
if cc.GetKind() != topology.KIND_CURVEBS && kind != topology.KIND_CURVEFS {
125+
if cc.GetKind() != topology.KIND_CURVEBS && kind != topology.KIND_CURVEFS && kind != topology.KIND_DINGOFS {
126126
return nil, errno.ERR_UNSUPPORT_CLIENT_CONFIGURE_KIND.
127127
F("kind: %s", kind)
128128
} else if len(cc.GetClusterMDSAddr()) == 0 {

internal/configure/pool.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import (
3232
const (
3333
KIND_CURVEBS = topology.KIND_CURVEBS
3434
KIND_CURVEFS = topology.KIND_CURVEFS
35+
KIND_DINGOFS = topology.KIND_DINGOFS
3536
ROLE_CHUNKSERVER = topology.ROLE_CHUNKSERVER
3637
ROLE_METASERVER = topology.ROLE_METASERVER
3738

@@ -163,7 +164,8 @@ func createLogicalPool(dcs []*topology.DeployConfig, logicalPool, poolset string
163164
for _, dc := range dcs {
164165
role := dc.GetRole()
165166
if (role == ROLE_CHUNKSERVER && kind == KIND_CURVEBS) ||
166-
(role == ROLE_METASERVER && kind == KIND_CURVEFS) {
167+
(role == ROLE_METASERVER && kind == KIND_CURVEFS) ||
168+
(role == ROLE_METASERVER && kind == KIND_DINGOFS) {
167169
if dc.GetParentId() == dc.GetId() {
168170
zone = nextZone()
169171
}

internal/configure/topology/topology.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,12 @@ func ParseTopology(data string, ctx *Context) ([]*DeployConfig, error) {
115115
// check topology kind
116116
kind := topology.Kind
117117
roles := []string{}
118-
if kind == KIND_CURVEBS {
118+
switch kind {
119+
case KIND_CURVEBS:
119120
roles = append(roles, CURVEBS_ROLES...)
120-
} else if kind == KIND_CURVEFS {
121+
case KIND_CURVEFS, KIND_DINGOFS:
121122
roles = append(roles, CURVEFS_ROLES...)
122-
} else {
123+
default:
123124
return nil, errno.ERR_UNSUPPORT_CLUSTER_KIND
124125
}
125126

internal/configure/topology/variables.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ var (
122122
{name: "cluster_snapshotclone_proxy_addr", kind: []string{KIND_CURVEBS}},
123123
{name: "cluster_snapshotclone_dummy_port", kind: []string{KIND_CURVEBS}},
124124
{name: "cluster_snapshotclone_nginx_upstream", kind: []string{KIND_CURVEBS}},
125-
{name: "cluster_metaserver_addr", kind: []string{KIND_CURVEFS}},
125+
{name: "cluster_metaserver_addr", kind: []string{KIND_CURVEFS, KIND_DINGOFS}},
126126
}
127127
)
128128

internal/task/task/checker/topology.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ func (s *step2CheckServices) getHostNum(dcs []*topology.DeployConfig) int {
181181
func (s *step2CheckServices) skip(role string) bool {
182182
kind := s.dcs[0].GetKind()
183183
// KIND_CURVEFS
184-
if kind == topology.KIND_CURVEFS {
184+
if kind == topology.KIND_CURVEFS || kind == topology.KIND_DINGOFS {
185185
if role == ROLE_CHUNKSERVER || role == ROLE_SNAPSHOTCLONE {
186186
return true
187187
}

0 commit comments

Comments
 (0)