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

Keep value of metal_connection.vlans in sync with API #271

Merged
merged 4 commits into from
Nov 29, 2022

Conversation

ctreatma
Copy link
Contributor

This updates the metal_connection resource and data source to read the value of vlans from the API response to ensure that terraform state stays up-to-date with the real infrastructure if someone modifies the VLANs for a terraform-managed metal_connection outside of terraform.

Closes #270

The TestCheckAttr functions cannot be used on list values, so we have to validate the `vlans` length and each individual element instead.
@ctreatma ctreatma added this to the v1.11.0 milestone Nov 28, 2022
@codecov-commenter
Copy link

Codecov Report

Base: 59.43% // Head: 60.17% // Increases project coverage by +0.74% 🎉

Coverage data is based on head (687c986) compared to base (a9f11e3).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #271      +/-   ##
==========================================
+ Coverage   59.43%   60.17%   +0.74%     
==========================================
  Files          74       74              
  Lines       12889    12911      +22     
==========================================
+ Hits         7660     7769     +109     
+ Misses       4937     4839      -98     
- Partials      292      303      +11     
Impacted Files Coverage Δ
equinix/data_source_metal_connection.go 98.78% <100.00%> (+0.09%) ⬆️
equinix/resource_metal_connection.go 71.54% <100.00%> (+1.17%) ⬆️
equinix/resource_metal_spot_market_request.go 52.07% <0.00%> (-7.55%) ⬇️
equinix/data_source_metal_virtual_circuit.go 96.36% <0.00%> (-3.64%) ⬇️
equinix/helpers_device.go 67.52% <0.00%> (-0.52%) ⬇️
equinix/resource_metal_virtual_circuit.go 76.35% <0.00%> (-0.32%) ⬇️
equinix/resource_metal_port_vlan_attachment.go 65.50% <0.00%> (+3.49%) ⬆️
equinix/resource_metal_device.go 69.10% <0.00%> (+5.49%) ⬆️
equinix/utils.go 86.95% <0.00%> (+10.86%) ⬆️
... and 1 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@ocobles ocobles merged commit c6ca815 into equinix:master Nov 29, 2022
@ctreatma ctreatma deleted the read_connection_vlans branch November 29, 2022 17:13
thogarty pushed a commit that referenced this pull request Sep 5, 2023
Keep value of metal_connection.vlans in sync with API
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.

metal_connection resource and data source do not read VLAN IDs from API
3 participants