Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(primary-ip): conflict when deleting IP #994

Merged
merged 1 commit into from
Sep 11, 2024

Conversation

apricote
Copy link
Member

There sometimes happens a conflict in terraform 1.9+ as it handles the state update before a delete differently. Both the server resource as well as the Primary IP resource try to shut down the server, even though the Primary IP should not as it is no longer assigned to the server.

This causes our e2e tests to fail.

This fixes the regression by explicitly checking that the server still has the IP assigned before trying to detach it.

@apricote apricote self-assigned this Sep 11, 2024
@apricote apricote requested a review from a team as a code owner September 11, 2024 13:04
Copy link

codecov bot commented Sep 11, 2024

Codecov Report

Attention: Patch coverage is 0% with 8 lines in your changes missing coverage. Please review.

Project coverage is 34.24%. Comparing base (89cfcd8) to head (7f931ff).
Report is 14 commits behind head on main.

Files with missing lines Patch % Lines
internal/primaryip/resource.go 0.00% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #994      +/-   ##
==========================================
- Coverage   34.27%   34.24%   -0.03%     
==========================================
  Files          62       64       +2     
  Lines        7915     7974      +59     
==========================================
+ Hits         2713     2731      +18     
- Misses       5161     5202      +41     
  Partials       41       41              
Flag Coverage Δ
unit 34.24% <0.00%> (-0.03%) ⬇️

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.

There sometimes happens a conflict in terraform 1.9+ as it handles the
state update before a delete differently. Both the server resource as
well as the Primary IP resource try to shut down the server, even though
the Primary IP should not as it is no longer assigned to the server.

This causes our e2e tests to fail.

This fixes the regression by explicitly checking that the server still
has the IP assigned before trying to detach it.
@apricote apricote force-pushed the primary-ip-detach-workaround branch from 5fc0756 to 7f931ff Compare September 11, 2024 13:09
@apricote apricote merged commit 0873fb1 into main Sep 11, 2024
3 of 7 checks passed
@apricote apricote deleted the primary-ip-detach-workaround branch September 11, 2024 14:59
jooola pushed a commit that referenced this pull request Nov 7, 2024
🤖 I have created a release *beep* *boop*
---


##
[1.49.0](v1.48.1...v1.49.0)
(2024-11-07)


### Features

* add data.load_balancer_type(s) data sources
([#991](#991))
([ef60613](ef60613))
* add support for opentofu v1.8
([#1029](#1029))
([c7902de](c7902de))
* drop support for opentofu v1.6
([#1030](#1030))
([8c448dd](8c448dd))


### Bug Fixes

* do not retry deleting a protected primary ip
([#1015](#1015))
([e9de286](e9de286)),
closes
[#1014](#1014)
* **primary-ip:** conflict when deleting IP
([#994](#994))
([0873fb1](0873fb1))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants