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

Change network type from list to set in resource instance #5253

Merged
merged 2 commits into from
Apr 2, 2024

Conversation

ismirlia
Copy link
Collaborator

There's an issue where doing terraform apply after an instance has been created will cause it to show that there were changes in the configuration even though there weren't.

This PR is fixes: #5224

@yussufsh
Copy link
Collaborator

@ismirlia changes look good but can you please post some test results here?

@ismirlia ismirlia marked this pull request as draft March 29, 2024 16:28
@ismirlia
Copy link
Collaborator Author

I think there might be an issue with how this works currently, I'm going to mark it as draft for now.

The previous solution replaced the list with a set to allow
terraform to ignore changes in the order of networks during a read,
but if networks were to get added via something like
ibmcloud_pi_network_port_attach then this currently triggers the
forcenew. This doesn't make sense because a user is allowed to
attach networks or volumes without having to create a new instance.
@ismirlia
Copy link
Collaborator Author

Similarly you can take a instance in and out of a placement-group.
I rolled back part of #5025
I think might have gone too far in that PR.

@ismirlia ismirlia marked this pull request as ready for review April 1, 2024 14:46
@ismirlia
Copy link
Collaborator Author

ismirlia commented Apr 1, 2024

Acceptance Test

--- PASS: TestAccIBMPIInstanceBasic (369.28s)
PASS
--- PASS: TestAccIBMPIInstanceNetwork (934.01s)
PASS

@hkantare hkantare merged commit 558154c into IBM-Cloud:master Apr 2, 2024
1 check passed
ismirlia added a commit to powervs-ibm/terraform-provider-ibm that referenced this pull request Apr 11, 2024
…5253)

* Change network type from list to set

* Replace forcenew with diffsuppressfunc

The previous solution replaced the list with a set to allow
terraform to ignore changes in the order of networks during a read,
but if networks were to get added via something like
ibmcloud_pi_network_port_attach then this currently triggers the
forcenew. This doesn't make sense because a user is allowed to
attach networks or volumes without having to create a new instance.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
service/Power Systems Issues related to Power Systems
Projects
None yet
3 participants