Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions cmd/api/v2/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ If ~/.ssh/[id_ed25519.pub | id_rsa.pub | id_dsa.pub] is present it will be picke
consoleCmd.Flags().StringP("project", "p", "", "project of the machine")
consoleCmd.Flags().StringP("sshidentity", "i", "", "the ssh private key used when creating the machine")
genericcli.Must(consoleCmd.RegisterFlagCompletionFunc("project", c.Completion.Project))
genericcli.Must(consoleCmd.MarkFlagRequired("project"))

return genericcli.NewCmds(cmdsConfig, consoleCmd)
}
Expand Down Expand Up @@ -207,7 +206,7 @@ func (c *machine) console(args []string) error {
return err
}

err = helpers.SSHClient(id, viper.GetString("sshidentity"), parsedurl.Host, viper.GetInt("metal-console-port"), c.c.Context.Token, new(viper.GetString("project")))
err = helpers.SSHClient(id, viper.GetString("sshidentity"), parsedurl.Host, viper.GetInt("metal-console-port"), c.c.Context.Token, new(c.c.GetProject()))
if err != nil {
return fmt.Errorf("machine console error: %w", err)
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/helpers/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ func MachineCreateRequestFromCLI(c *config.Config) (*apiv2.MachineServiceCreateR
Hostname: hostname,
Image: viper.GetString("image"),
Name: viper.GetString("name"),
Project: viper.GetString("project"),
Project: c.GetProject(),
Size: size,
SshPublicKeys: keys,
Labels: labels,
Expand Down Expand Up @@ -566,7 +566,7 @@ IPs can be added per network colon separated, these ips must be already allocate
cmd.Flags().StringSlice("placement-labels", []string{}, "placement tags used for rack spreading")

cmd.MarkFlagsMutuallyExclusive("file", "project")
cmd.MarkFlagsRequiredTogether("project", "networks", "hostname", "image")
cmd.MarkFlagsRequiredTogether("networks", "hostname", "image")
cmd.MarkFlagsRequiredTogether("size", "partition")

// Completion for arguments
Expand Down