Skip to content

Commit

Permalink
fix(primary-ip): assignee-id was not correctly passed when creating t…
Browse files Browse the repository at this point in the history
…he IP (#506)

When creating a Primary IP and directly assigning it to a server, the
id was not passed on to the API. This caused the API request to error:

    ➜ hcloud primary-ip create --type ipv4 --name test --assignee-id 1234
    hcloud: invalid input in fields 'assignee_id', 'datacenter' (invalid_input)
  • Loading branch information
apricote committed Jun 22, 2023
1 parent b54bdad commit 8c027b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/cmd/primaryip/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ var CreateCmd = base.Cmd{
cmd.Flags().String("name", "", "Name (required)")
cmd.MarkFlagRequired("name")

cmd.Flags().String("assignee-id", "", "Assignee (usually a server) to assign Primary IP to")
cmd.Flags().Int("assignee-id", 0, "Assignee (usually a server) to assign Primary IP to")

cmd.Flags().String("datacenter", "", "Datacenter (ID or name)")
cmd.RegisterFlagCompletionFunc("datacenter", cmpl.SuggestCandidatesF(client.Datacenter().Names))
Expand Down

0 comments on commit 8c027b6

Please sign in to comment.