Skip to content

Commit

Permalink
fix5
Browse files Browse the repository at this point in the history
  • Loading branch information
confoc committed May 24, 2024
1 parent 0c268a5 commit e605f7c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions pkg/cluster/baremetal/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type Cluster struct {
config *config.BareMetalClusterConfig
createNoDirs bool
enableCache bool
Metastore bool
metastore bool

am artifacts.Manager
mm metadata.Manager
Expand All @@ -55,9 +55,9 @@ type ClusterComponents struct {
}

func NewClusterComponents(config *config.BareMetalClusterComponentsConfig, workingDirs components.WorkingDirs,
wg *sync.WaitGroup, logger logger.Logger, Metastore bool) *ClusterComponents {
wg *sync.WaitGroup, logger logger.Logger, metastore bool) *ClusterComponents {
return &ClusterComponents{
MetaSrv: components.NewMetaSrv(config.MetaSrv, workingDirs, wg, logger, Metastore),
MetaSrv: components.NewMetaSrv(config.MetaSrv, workingDirs, wg, logger, metastore),
Datanode: components.NewDataNode(config.Datanode, config.MetaSrv.ServerAddr, workingDirs, wg, logger),
Frontend: components.NewFrontend(config.Frontend, config.MetaSrv.ServerAddr, workingDirs, wg, logger),
Etcd: components.NewEtcd(workingDirs, wg, logger),
Expand Down Expand Up @@ -87,7 +87,7 @@ func WithEnableCache(enableCache bool) Option {

func WithMetastore(Metastore bool) Option {
return func(c *Cluster) {
c.Metastore = Metastore
c.metastore = Metastore
}
}

Expand Down Expand Up @@ -143,7 +143,7 @@ func NewCluster(l logger.Logger, clusterName string, opts ...Option) (cluster.Op
DataDir: csd.DataDir,
LogsDir: csd.LogsDir,
PidsDir: csd.PidsDir,
}, &c.wg, c.logger, c.Metastore)
}, &c.wg, c.logger, c.metastore)

return c, nil
}
2 changes: 1 addition & 1 deletion pkg/cluster/baremetal/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func (c *Cluster) Create(ctx context.Context, options *opt.CreateOptions) error
return nil
}

if c.Metastore {
if c.metastore {
if err := withSpinner("Etcd Cluster", c.createEtcdCluster); err != nil {
return err
}
Expand Down
12 changes: 6 additions & 6 deletions pkg/components/metasrv.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,19 @@ type metaSrv struct {
workingDirs WorkingDirs
wg *sync.WaitGroup
logger logger.Logger
Metastore bool
metastore bool

allocatedDirs
}

func NewMetaSrv(config *config.MetaSrv, workingDirs WorkingDirs,
wg *sync.WaitGroup, logger logger.Logger, Metastore bool) ClusterComponent {
wg *sync.WaitGroup, logger logger.Logger, metastore bool) ClusterComponent {
return &metaSrv{
config: config,
workingDirs: workingDirs,
wg: wg,
logger: logger,
Metastore: Metastore,
metastore: metastore,
}
}

Expand Down Expand Up @@ -128,9 +128,9 @@ func (m *metaSrv) BuildArgs(params ...interface{}) []string {
args = GenerateAddrArg("--http-addr", m.config.HTTPAddr, nodeID, args)
args = GenerateAddrArg("--bind-addr", bindAddr, nodeID, args)

if m.Metastore {
Metastore := strconv.FormatBool(m.Metastore)
args = GenerateAddrArg("--use-memory-store", Metastore, nodeID, args)
if m.metastore {
metastore := strconv.FormatBool(m.metastore)
args = GenerateAddrArg("--use-memory-store", metastore, nodeID, args)
}

if len(m.config.Config) > 0 {
Expand Down

0 comments on commit e605f7c

Please sign in to comment.