@@ -48,16 +48,16 @@ const (
4848
4949type (
5050 DeployConfig struct {
51- kind string // KIND_CURVEFS / KIND_CUVREBS
52- id string // role_host_[name/hostSequence]_replicasSequence
53- parentId string // role_host_[name/hostSequence]_0
54- role string // etcd/mds/metaserevr/chunkserver
55- host string
56- hostname string
57- name string
58- replicas int
59- hostSequence int // start with 0
60- replicasSequence int // start with 0
51+ kind string // KIND_CURVEFS / KIND_CUVREBS
52+ id string // role_host_[name/hostSequence]_instancesSequence
53+ parentId string // role_host_[name/hostSequence]_0
54+ role string // etcd/mds/metaserevr/chunkserver
55+ host string
56+ hostname string
57+ name string
58+ instances int
59+ hostSequence int // start with 0
60+ instancesSequence int // start with 0
6161
6262 config map [string ]interface {}
6363 serviceConfig map [string ]string
7373)
7474
7575// etcd_hostname_0_0
76- func formatId (role , host , name string , replicasSequence int ) string {
77- return fmt .Sprintf ("%s_%s_%s_%d" , role , host , name , replicasSequence )
76+ func formatId (role , host , name string , instancesSequence int ) string {
77+ return fmt .Sprintf ("%s_%s_%s_%d" , role , host , name , instancesSequence )
7878}
7979
8080func formatName (name string , hostSequence int ) string {
@@ -104,8 +104,8 @@ func newVariables(m map[string]interface{}) (*variable.Variables, error) {
104104 return vars , nil
105105}
106106
107- func NewDeployConfig (ctx * Context , kind , role , host , name string , replicas int ,
108- hostSequence , replicasSequence int , config map [string ]interface {}) (* DeployConfig , error ) {
107+ func NewDeployConfig (ctx * Context , kind , role , host , name string , instances int ,
108+ hostSequence , instancesSequence int , config map [string ]interface {}) (* DeployConfig , error ) {
109109 // variable section
110110 v := config [CONFIG_VARIABLE .key ]
111111 if ! utils .IsStringAnyMap (v ) && v != nil {
@@ -137,19 +137,19 @@ func NewDeployConfig(ctx *Context, kind, role, host, name string, replicas int,
137137
138138 name = formatName (name , hostSequence )
139139 return & DeployConfig {
140- kind : kind ,
141- id : formatId (role , host , name , replicasSequence ),
142- parentId : formatId (role , host , name , 0 ),
143- role : role ,
144- host : host ,
145- name : name ,
146- replicas : replicas ,
147- hostSequence : hostSequence ,
148- replicasSequence : replicasSequence ,
149- config : config ,
150- serviceConfig : map [string ]string {},
151- variables : vars ,
152- ctx : ctx ,
140+ kind : kind ,
141+ id : formatId (role , host , name , instancesSequence ),
142+ parentId : formatId (role , host , name , 0 ),
143+ role : role ,
144+ host : host ,
145+ name : name ,
146+ instances : instances ,
147+ hostSequence : hostSequence ,
148+ instancesSequence : instancesSequence ,
149+ config : config ,
150+ serviceConfig : map [string ]string {},
151+ variables : vars ,
152+ ctx : ctx ,
153153 }, nil
154154}
155155
0 commit comments