Skip to content

Commit

Permalink
CLI: Remove --auto flag (#396)
Browse files Browse the repository at this point in the history
This PR removes the `--auto` flag from both the `init` and `add`
subcommands.

The internal behavior of the `initConfig`'s `autoSetup` is kept to still
allow using the concept in situations like preseed.
  • Loading branch information
masnax authored Sep 12, 2024
2 parents a26a916 + b2aaf48 commit 8522b67
Show file tree
Hide file tree
Showing 9 changed files with 130 additions and 397 deletions.
5 changes: 1 addition & 4 deletions cmd/microcloud/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
type cmdAdd struct {
common *CmdControl

flagAutoSetup bool
flagWipe bool
flagPreseed bool
flagLookupTimeout int64
Expand All @@ -30,7 +29,6 @@ func (c *cmdAdd) Command() *cobra.Command {
RunE: c.Run,
}

cmd.Flags().BoolVar(&c.flagAutoSetup, "auto", false, "Automatic setup with default configuration")
cmd.Flags().BoolVar(&c.flagWipe, "wipe", false, "Wipe disks to add to MicroCeph")
cmd.Flags().BoolVar(&c.flagPreseed, "preseed", false, "Expect Preseed YAML for configuring MicroCloud in stdin")
cmd.Flags().Int64Var(&c.flagLookupTimeout, "lookup-timeout", 0, "Amount of seconds to wait for systems to show up. Defaults: 60s for interactive, 5s for automatic and preseed")
Expand All @@ -46,7 +44,6 @@ func (c *cmdAdd) Run(cmd *cobra.Command, args []string) error {
cfg := initConfig{
bootstrap: false,
setupMany: true,
autoSetup: c.flagAutoSetup,
wipeAllDisks: c.flagWipe,
common: c.common,
asker: &c.common.asker,
Expand All @@ -57,7 +54,7 @@ func (c *cmdAdd) Run(cmd *cobra.Command, args []string) error {
cfg.lookupTimeout = DefaultLookupTimeout
if c.flagLookupTimeout > 0 {
cfg.lookupTimeout = time.Duration(c.flagLookupTimeout) * time.Second
} else if c.flagAutoSetup || c.flagPreseed {
} else if c.flagPreseed {
cfg.lookupTimeout = DefaultAutoLookupTimeout
}

Expand Down
Loading

0 comments on commit 8522b67

Please sign in to comment.