From e605f7c3c78ac852df88f3721827d1bbf3c4ffa1 Mon Sep 17 00:00:00 2001 From: confoc Date: Fri, 24 May 2024 16:23:43 +0800 Subject: [PATCH] fix5 --- pkg/cluster/baremetal/cluster.go | 10 +++++----- pkg/cluster/baremetal/create.go | 2 +- pkg/components/metasrv.go | 12 ++++++------ 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/pkg/cluster/baremetal/cluster.go b/pkg/cluster/baremetal/cluster.go index 860e1c73..56c49378 100644 --- a/pkg/cluster/baremetal/cluster.go +++ b/pkg/cluster/baremetal/cluster.go @@ -34,7 +34,7 @@ type Cluster struct { config *config.BareMetalClusterConfig createNoDirs bool enableCache bool - Metastore bool + metastore bool am artifacts.Manager mm metadata.Manager @@ -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), @@ -87,7 +87,7 @@ func WithEnableCache(enableCache bool) Option { func WithMetastore(Metastore bool) Option { return func(c *Cluster) { - c.Metastore = Metastore + c.metastore = Metastore } } @@ -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 } diff --git a/pkg/cluster/baremetal/create.go b/pkg/cluster/baremetal/create.go index 78f8e8e6..37f5dc0b 100644 --- a/pkg/cluster/baremetal/create.go +++ b/pkg/cluster/baremetal/create.go @@ -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 } diff --git a/pkg/components/metasrv.go b/pkg/components/metasrv.go index 0117d38d..cbce4258 100644 --- a/pkg/components/metasrv.go +++ b/pkg/components/metasrv.go @@ -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, } } @@ -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 {