Repository navigation
ENG-36170: Read and send the IX fields that import and Update drop - #533
Open
Phil-Browne wants to merge 11 commits into
Open
Phil-Browne wants to merge 11 commits into
Phil-Browne wants to merge 11 commits into
Conversation
The read call now maps the MAC address, shutdown, cost centre, and reverse DNS. Update sends cost centre, public graph, and reverse DNS, and fills requested_product_uid from the plan when an import left it null. The IX order cannot carry those three settings, so Create sets them with an update after the order.
The basic test now sets and changes the three settings and the MAC, verifies shutdown and mac_address on import, and applies after a real import. The upgrade test plans a config created by the latest release with this build.
The API lowercases the MAC and adds a trailing dot to reverse DNS. The read call now keeps the value in state when only that form differs, and Update sends neither value for a form-only change.
The SDK drops an empty cost_centre or reverse_dns from the update, so Update now returns a clear error instead of an inconsistent result. Update also skips an unknown shutdown, and reverse DNS compares without case.
…an accurate The cost_centre clear check moves to ModifyPlan, which also marks the default reverse DNS unknown when the ASN changes. The schema rejects an empty reverse_dns, and the settings no longer copy a null state value into the plan.
…N change The API rebuilds the reverse DNS on an ASN change only when it holds the Megaport default. ModifyPlan now follows that rule, and it rejects a config that pins the default across the change. The upgrade acceptance test changes the ASN to show the rebuild on staging.
Terraform plans again at apply with the known ASN, so the error still fires on a real change. The error title now fits a config that sets the new default name too.
…nd narrow the ModifyPlan comment
There was a problem hiding this comment.
🟡 Changes recommended
The change permits an oversized cost_centre to fail only after purchasing a billable IX, and lacks failure-injection tests verifying UID retention and recovery after post-purchase update or GetIX failures.
2 open issues
What changed in this PR
This PR fixes dropped fields in megaport_ix so imported resources and later applies retain their settings consistently.
Changes:
- Hydrates missing IX fields and preserves equivalent MAC address and reverse-DNS formatting.
- Sends settings during Update and through a follow-up Create update, with planning rules for unsupported clearing and ASN changes.
- Adds unit and acceptance coverage for settings, apply after import, and provider upgrades.
| File | Description |
|---|---|
internal/provider/testdata/acceptance-suites.json |
Registers the IX upgrade acceptance test. |
internal/provider/ixs_data_source_test.go |
Extends the shared IX mock to support creation and settings updates. |
internal/provider/ix_resource.go |
Fixes field mapping, settings updates, import state, and planning behavior. |
internal/provider/ix_resource_test.go |
Expands acceptance coverage for settings, imports, and upgrades. |
internal/provider/ix_resource_fields_test.go |
Adds unit coverage for mapping, normalization, planning, and settings requests. |
docs/resources/ix.md |
Documents default reverse-DNS behavior. |
Review effort: Balanced
…llow-up update The SDK refuses a longer cost_centre in UpdateIX, so Create would order the IX and then fail on the follow-up update.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

User-Facing Summary
This PR maps and sends the
megaport_ixfields that import and Update dropped.Prior to this PR, every apply after an IX import would fail with "Provider produced inconsistent result after apply".
Changes
mac_address,shutdown,cost_centre, andreverse_dnsin the read callrequested_product_uidfrom the plan when state has nonecost_centre,public_graph, andreverse_dnsin Updatereverse_dnsas unknown when the ASN changesType of Change
Related Issues
ENG-36170, ENG-36183
How to Test
On staging I ran the IX acceptance tests, which now cover an apply after import and a provider upgrade.
Known limitation: clearing
cost_centreorreverse_dnsnow fails at plan.Scope of change: customer-facing yes, existing automated coverage yes.