Skip to content

Commit

Permalink
fix(image): backup is suggested as type in update command (#603)
Browse files Browse the repository at this point in the history
As described in the [API
Docs](https://docs.hetzner.cloud/#images-update-an-image), the only
allowed image type to update to is `snapshot`. The completions should
reflect that.
  • Loading branch information
phm07 authored Nov 7, 2023
1 parent 55ae0a1 commit 6ea4695
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/cmd/image/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var UpdateCmd = base.UpdateCmd{
DefineFlags: func(cmd *cobra.Command) {
cmd.Flags().String("description", "", "Image description")
cmd.Flags().String("type", "", "Image type")
cmd.RegisterFlagCompletionFunc("type", cmpl.SuggestCandidates("backup", "snapshot"))
cmd.RegisterFlagCompletionFunc("type", cmpl.SuggestCandidates("snapshot"))
},
Update: func(ctx context.Context, client hcapi2.Client, cmd *cobra.Command, resource interface{}, flags map[string]pflag.Value) error {
image := resource.(*hcloud.Image)
Expand Down

0 comments on commit 6ea4695

Please sign in to comment.