Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
confoc committed May 24, 2024
2 parents 84262a5 + 98e56c4 commit b30a1c8
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
12 changes: 12 additions & 0 deletions cmd/gtctl/cluster_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ type clusterCreateCliOptions struct {
Config string
GreptimeBinVersion string
EnableCache bool
<<<<<<< HEAD

Check failure on line 65 in cmd/gtctl/cluster_create.go

View workflow job for this annotation

GitHub Actions / Check linters

expected '}', found '<<' (typecheck)
metastore bool
=======
EnableEtcd bool
>>>>>>> 98e56c47ca7ee1089a8b4e1c45b0eb7332f2638f

// Common options.
Timeout int
Expand Down Expand Up @@ -110,7 +114,11 @@ func NewCreateClusterCommand(l logger.Logger) *cobra.Command {
cmd.Flags().StringVar(&options.GreptimeDBClusterValuesFile, "greptimedb-cluster-values-file", "", "The values file for greptimedb cluster.")
cmd.Flags().StringVar(&options.EtcdClusterValuesFile, "etcd-cluster-values-file", "", "The values file for etcd cluster.")
cmd.Flags().StringVar(&options.GreptimeDBOperatorValuesFile, "greptimedb-operator-values-file", "", "The values file for greptimedb operator.")
<<<<<<< HEAD
cmd.Flags().BoolVarP(&options.metastore, "memory-meta-storage", "m", false, "Bootstrap the whole cluster without installing etcd for testing purposes through using the memory storage of metasrv in bare-metal mode.")
=======
cmd.Flags().BoolVarP(&options.EnableEtcd, "memory-meta-storage", "m", true, "Bootstrap the whole cluster without installing etcd for testing purposes through using the memory storage of metasrv in bare-metal mode.")
>>>>>>> 98e56c47ca7ee1089a8b4e1c45b0eb7332f2638f

return cmd
}
Expand Down Expand Up @@ -184,7 +192,11 @@ func NewCluster(args []string, options *clusterCreateCliOptions, l logger.Logger
l.V(0).Infof("Creating GreptimeDB cluster '%s' on bare-metal", logger.Bold(clusterName))

var opts []baremetal.Option
<<<<<<< HEAD

Check failure on line 195 in cmd/gtctl/cluster_create.go

View workflow job for this annotation

GitHub Actions / Check linters

expected declaration, found '<<' (typecheck)
opts = append(opts, baremetal.WithEnableCache(options.EnableCache), baremetal.Withmetastore(options.metastore))
=======
opts = append(opts, baremetal.WithEnableCache(options.EnableCache), baremetal.WithEnableEtcd(options.EnableEtcd))
>>>>>>> 98e56c47ca7ee1089a8b4e1c45b0eb7332f2638f
if len(options.GreptimeBinVersion) > 0 {
opts = append(opts, baremetal.WithGreptimeVersion(options.GreptimeBinVersion))
}
Expand Down
10 changes: 10 additions & 0 deletions pkg/cluster/baremetal/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ type Cluster struct {
config *config.BareMetalClusterConfig
createNoDirs bool
enableCache bool
<<<<<<< HEAD

Check failure on line 37 in pkg/cluster/baremetal/cluster.go

View workflow job for this annotation

GitHub Actions / Check linters

syntax error: unexpected <<, expected field name or embedded type
metastore bool
=======

Check failure on line 39 in pkg/cluster/baremetal/cluster.go

View workflow job for this annotation

GitHub Actions / Check linters

syntax error: unexpected ==, expected field name or embedded type
enableEtcd bool
>>>>>>> 98e56c47ca7ee1089a8b4e1c45b0eb7332f2638f

Check failure on line 41 in pkg/cluster/baremetal/cluster.go

View workflow job for this annotation

GitHub Actions / Check linters

syntax error: unexpected >>, expected field name or embedded type

am artifacts.Manager
mm metadata.Manager
Expand Down Expand Up @@ -85,9 +89,15 @@ func WithEnableCache(enableCache bool) Option {
}
}

<<<<<<< HEAD
func Withmetastore(metastore bool) Option {
return func(c *Cluster) {
c.metastore = metastore
=======
func WithEnableEtcd(enableEtcd bool) Option {
return func(c *Cluster) {
c.enableEtcd = enableEtcd
>>>>>>> 98e56c47ca7ee1089a8b4e1c45b0eb7332f2638f
}
}

Expand Down
4 changes: 4 additions & 0 deletions pkg/cluster/baremetal/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,12 @@ func (c *Cluster) Create(ctx context.Context, options *opt.CreateOptions) error
}
return nil
}
<<<<<<< HEAD

if c.metastore {
=======
if c.enableEtcd {
>>>>>>> 98e56c47ca7ee1089a8b4e1c45b0eb7332f2638f
if err := withSpinner("Etcd Cluster", c.createEtcdCluster); err != nil {
return err
}
Expand Down

0 comments on commit b30a1c8

Please sign in to comment.