Skip to content

Commit

Permalink
feat(server): remove unsupported linux32 rescue type
Browse files Browse the repository at this point in the history
  • Loading branch information
phm07 committed Jan 18, 2024
1 parent c5e3f00 commit 23ad143
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion internal/cmd/server/enable_rescue.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ var EnableRescueCmd = base.Cmd{
DisableFlagsInUseLine: true,
}
cmd.Flags().String("type", "linux64", "Rescue type")
cmd.RegisterFlagCompletionFunc("type", cmpl.SuggestCandidates("linux64", "linux32"))
cmd.RegisterFlagCompletionFunc("type", cmpl.SuggestCandidates("linux64"))

cmd.Flags().StringSlice("ssh-key", nil, "ID or name of SSH key to inject (can be specified multiple times)")
cmd.RegisterFlagCompletionFunc("ssh-key", cmpl.SuggestCandidatesF(client.SSHKey().Names))
Expand All @@ -43,7 +43,14 @@ var EnableRescueCmd = base.Cmd{
opts hcloud.ServerEnableRescueOpts
)
rescueType, _ := cmd.Flags().GetString("type")

opts.Type = hcloud.ServerRescueType(rescueType)
switch opts.Type {
case hcloud.ServerRescueTypeLinux64:
break
default:
return fmt.Errorf("invalid rescue type: %v", opts.Type)
}

sshKeys, _ := cmd.Flags().GetStringSlice("ssh-key")
for _, sshKeyIDOrName := range sshKeys {
Expand Down

0 comments on commit 23ad143

Please sign in to comment.