From 4de80c2ee52f0600a7a76311ab54609b15f095bb Mon Sep 17 00:00:00 2001 From: pauhull <22707808+pauhull@users.noreply.github.com> Date: Thu, 18 Jan 2024 13:36:59 +0100 Subject: [PATCH] feat(server): remove unsupported linux32 rescue type --- internal/cmd/server/enable_rescue.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/internal/cmd/server/enable_rescue.go b/internal/cmd/server/enable_rescue.go index d75cfaf7..3ae72c69 100644 --- a/internal/cmd/server/enable_rescue.go +++ b/internal/cmd/server/enable_rescue.go @@ -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)) @@ -43,7 +43,16 @@ var EnableRescueCmd = base.Cmd{ opts hcloud.ServerEnableRescueOpts ) rescueType, _ := cmd.Flags().GetString("type") + opts.Type = hcloud.ServerRescueType(rescueType) + switch opts.Type { + case hcloud.ServerRescueTypeLinux64: + break + case hcloud.ServerRescueTypeLinux32: + return fmt.Errorf("rescue type not supported anymore: %s", opts.Type) + default: + return fmt.Errorf("invalid rescue type: %s", opts.Type) + } sshKeys, _ := cmd.Flags().GetStringSlice("ssh-key") for _, sshKeyIDOrName := range sshKeys {