Skip to content

479 import ethernet port #480

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

Closed
wants to merge 4 commits into from

Conversation

acch
Copy link
Contributor

@acch acch commented Apr 28, 2025

Fixes #479.

When importing ethernet_port (e.g. VLAN) resources in multi-node clusters, the port name (e.g. a0a-1234) might exist on multiple nodes. Hence, the port name alone is not sufficient to identify a particular ethernet port. Importing an ambiguous ethernet port leads to the following error:

$ terraform import ... a0a-1234,cluster1

╷
│ Error: Error Reading Ethernet Port Info
│
│ Error on GET /network/ethernet/ports/: received 2 or more records when only
│ one is expected - statusCode 200, err=<nil>,
│ response=restclient.RestResponse{NumRecords:2,
│ Records:[]map[string]interface {}{ ... }

This PR adds the node name to the import identifier, i.e.:

$ terraform import ... a0a-1234,nodea,cluster1
$ terraform import ... a0a-1234,nodeb,cluster1

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

$ TF_ACC=1 go test ./internal/provider/networking/network_ethernet_port_resource_test.go -v
=== RUN   TestAccNetworkEthernetPortResource
--- PASS: TestAccNetworkEthernetPortResource (1.58s)
PASS
ok      command-line-arguments  1.588s

acch added 2 commits April 28, 2025 15:53
…ved 2 or more records" error

Signed-off-by: Achim Christ <[email protected]>
Signed-off-by: Achim Christ <[email protected]>
@acch acch closed this Apr 28, 2025
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]: ethernet port: error when importing VLANs in multi-node clusters
1 participant