Skip to content

feat(primary-ip): make auto_delete attribute optional#1429

Merged
jooola merged 3 commits into
mainfrom
optional-auto-delete-primary-ip
May 29, 2026
Merged

feat(primary-ip): make auto_delete attribute optional#1429
jooola merged 3 commits into
mainfrom
optional-auto-delete-primary-ip

Conversation

@jooola
Copy link
Copy Markdown
Member

@jooola jooola commented May 28, 2026

The auto_delete attribute is currently required, but we recommend always setting its value to false:

 Setting `auto_delete` to `false` is recommended, because if a server assigned to the managed ip
 is getting deleted, it will also delete the primary IP which will break the terraform state.

This change makes the auto_delete attribute optional, and defaults to false. Simplifying user's configurations and using a recommended default.

https://docs.hetzner.cloud/reference/cloud#tag/primary-ips/create_primary_ip

@jooola jooola requested a review from a team as a code owner May 28, 2026 16:18
@jooola jooola requested a review from apricote May 28, 2026 16:18
@codecov
Copy link
Copy Markdown

codecov Bot commented May 28, 2026

Codecov Report

❌ Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 37.78%. Comparing base (1c22d4d) to head (de1662d).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
internal/primaryip/resource.go 66.66% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1429       +/-   ##
===========================================
- Coverage   72.98%   37.78%   -35.20%     
===========================================
  Files         112      112               
  Lines       12533    12536        +3     
===========================================
- Hits         9147     4737     -4410     
- Misses       2320     7740     +5420     
+ Partials     1066       59     -1007     
Flag Coverage Δ
e2e ?
unit 37.78% <66.66%> (+<0.01%) ⬆️

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): auto_delete attribute is now optional feat(primary-ip): make auto_delete attribute optional May 28, 2026
The auto_delete attribute is currently required, but we recommend always setting its value to false:

     Setting `auto_delete` to `false` is recommended, because if a server assigned to the managed ip
     is getting deleted, it will also delete the primary IP which will break the terraform state.

This change makes the `auto_delete` attribute optional, and leverage the API default value (false). Simplifying users configuration and use a sane API default.

https://docs.hetzner.cloud/reference/cloud#tag/primary-ips/create_primary_ip
@jooola jooola force-pushed the optional-auto-delete-primary-ip branch from 25047e2 to 482629d Compare May 29, 2026 11:30
Copy link
Copy Markdown
Contributor

@lukasmetzner lukasmetzner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Little nit on the docs. Otherwise, looks good to me 🚀

Comment thread internal/primaryip/resource.go Outdated
@jooola jooola merged commit 9eb0cc4 into main May 29, 2026
4 checks passed
@jooola jooola deleted the optional-auto-delete-primary-ip branch May 29, 2026 14:13
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