-
Notifications
You must be signed in to change notification settings - Fork 32
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
[bugfix] Prevent destroy operation for static ports in bulk list when… #271
[bugfix] Prevent destroy operation for static ports in bulk list when… #271
Conversation
… updating the list
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Hi @akinross . The issue itself seems to be fixed as now the resource is updated-in-place instead of destroyed-recreating. But adding a new port to the list now re-orders the list, showing an update to every single entry on the bulk. Im guessing this is due to some sort() or ordering of the data when being written to the state.
On this output, the new port in the configuration is the 1/20. The 1/9 is already configured, but due to the re-ordering on the state, is being shown as a new one. |
@edudppaz Akini is on leave and will be back soon! The reason you are seeing this behaviour is because static_ports is defined as TypeList in the resource which makes Terraform treat static_ports as ordered collections. This means that the order of items in a list is significant and any change in the order of items is considered a change to the list itself. A way to get around this would be to use TypeSet for the said attribute but it comes with its own cosmetic quirks. |
… updating the list
fixes #270