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: prepend port with node name, to prevent "duplicate ports" error in multi-node clusters #410

Open
wants to merge 2 commits into
base: integration/main
Choose a base branch
from

Conversation

acch
Copy link
Contributor

@acch acch commented Feb 18, 2025

Fixes #409.

When adding VLAN(s) to a broadcast domain, the broadcast domain will contain a list of ports added to it. In multi-node clusters, the same port/VLAN may exist on multiple nodes. With the current implementation, this will lead to the following error message:

╷
│ Error: Duplicate Set Element
│ 
│   with module.netapp.module.network.netapp-ontap_network_broadcast_domain.this,
│   on ../../modules/network/main.tf line 12, in resource "netapp-ontap_network_broadcast_domain" "this":
│   12: resource "netapp-ontap_network_broadcast_domain" "this" {
│ 
│ This attribute contains duplicate values of: tftypes.String<"a0a-1234">
╵

This PR changes the code in a way that the port name is prefixed with the node name - in order to make the string values unique. This mimics the behavior of the CLI, which also prepends the node name to the port name in the output of broadcast-domain show.

Acceptance tests (still) pass in my local test setup:

$ TF_ACC=1 go test ./internal/provider/networking/network_broadcast_domain_resource_test.go -v
=== RUN   TestAccNetworkBroadcastDomainResource
--- PASS: TestAccNetworkBroadcastDomainResource (3.72s)
PASS
ok      command-line-arguments  3.731s

acch added 2 commits February 18, 2025 20:01
…in multi-node clusters NetApp#409

Signed-off-by: Achim Christ <achim.christ@sva.de>
Signed-off-by: Achim Christ <achim.christ@sva.de>
@acch
Copy link
Contributor Author

acch commented Feb 18, 2025

@carchi8py @suhasbshekar Unfortunately, I've missed this bug in my local test setup (single-node cluster). It has only surfaced while integrating the new provider version into the customer's staging environment (multi-node cluster). It's now blocking our integration efforts, preventing us to continue migration to the official provider...

Any chance to merge this PR and release a new version to the registry short-term?

@acch
Copy link
Contributor Author

acch commented Feb 20, 2025

@carchi8py @suhasbshekar Any chance to merge & release this fix short-term?

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.

[Bug]: broadcast_domain: "duplicate ports" error when adding VLANs in multi-node clusters
1 participant