Skip to content

feat(primary-ip): --assignee-type is optional when creating a Primary IP#1395

Merged
lukasmetzner merged 2 commits intomainfrom
optional-assignee-type
Apr 28, 2026
Merged

feat(primary-ip): --assignee-type is optional when creating a Primary IP#1395
lukasmetzner merged 2 commits intomainfrom
optional-assignee-type

Conversation

@lukasmetzner
Copy link
Copy Markdown
Contributor

@lukasmetzner lukasmetzner commented Apr 28, 2026

Primary IPs assignee_type behavior change

As of 1 August 2026, the behavior of the Primary IP assignee_type property will change, and will return unassigned when the Primary IP is not assigned (when assignee_id is null). The goal is to eventually assign Primary IPs to other resource types, not only to server.

See the changelog for more details.

In addition, the Primary IP request body assignee_type property of the operation POST /v1/primary_ips is now optional. Primary IPs created without assignee_type return server until 1 August 2026, after this date, its value will be unassigned.

See the changelog for more details.

@lukasmetzner lukasmetzner requested a review from a team as a code owner April 28, 2026 11:35
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 28, 2026

Codecov Report

❌ Patch coverage is 52.63158% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.54%. Comparing base (a518481) to head (fd28de5).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
internal/cmd/primaryip/create.go 52.63% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1395      +/-   ##
==========================================
- Coverage   67.58%   67.54%   -0.05%     
==========================================
  Files         300      300              
  Lines       11082    11096      +14     
==========================================
+ Hits         7490     7495       +5     
- Misses       2647     2656       +9     
  Partials      945      945              
Flag Coverage Δ
unit 67.54% <52.63%> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jooola jooola changed the title feat(primary-ip): assignee_type is optional when creating a primary ip feat(primary-ip): --assignee-type is optional when creating a Primary IP Apr 28, 2026
@jooola jooola force-pushed the optional-assignee-type branch 2 times, most recently from 18e39fd to 5db3fef Compare April 28, 2026 12:23
@jooola jooola force-pushed the optional-assignee-type branch from 5db3fef to fd28de5 Compare April 28, 2026 12:25
@lukasmetzner lukasmetzner merged commit ad5a7b6 into main Apr 28, 2026
6 of 7 checks passed
@lukasmetzner lukasmetzner deleted the optional-assignee-type branch April 28, 2026 12:54
lukasmetzner pushed a commit that referenced this pull request Apr 28, 2026
### Primary IPs `assignee_type` behavior change

When creating a Primary IP with the `primary-ip` command, the
`--assignee-type` flag will be required together with the
`--assignee-id` flag. Using the default value (`server`) for the
`--assignee-type` flag is deprecated. Consider explicitly setting the
`--assignee-type` flag.

As of 1 August 2026, the behavior of the Primary IP `assignee_type`
property will change, and will return `unassigned` when the Primary IP
is not assigned (when `assignee_id` is `null`). The goal is to
eventually assign Primary IPs to other resource types, not only to
`server`.

See the
[changelog](https://docs.hetzner.cloud/changelog#2026-04-27-primary-ips-will-return-unassigned)
for more details.

In addition, the Primary IP request body `assignee_type` property of the
operation [`POST
/v1/primary_ips`](https://docs.hetzner.cloud/reference/cloud#tag/primary-ips/create_primary_ip)
is now optional. Primary IPs created without `assignee_type` return
`server` until 1 August 2026, after this date, its value will be
`unassigned`.

See the
[changelog](https://docs.hetzner.cloud/changelog#2026-04-27-primary-ips-make-assignee_type-optional)
for more details.

### Features

- **primary-ip**: `--assignee-type` is optional when creating a Primary
IP (#1395)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants