Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Updating network by adding/removing nodes when using it in a K8s doesn't work #13

Closed
OmarElawady opened this issue Aug 26, 2021 · 1 comment
Assignees
Labels
type_bug Something isn't working

Comments

@OmarElawady
Copy link
Contributor

Description

Since the K8s resource must know the ip ranges of the nodes from the network resource, it references the nodes_ip_range computed property from the network resource. When a node is added/removed, this computed value is changed after the network update is complete which appears as inconsistency between the planning and execution to terraform causing it to fail.

To clarify the issue, it's helpful to depict the terraform workflow when applying an update. Terraform has a local state (stored in terraform.state) which is usually linked to remote objects stored on remote site. The read operation reads the remote data and syncs the local state with it. When changing the configuration, and executing terraform apply, the terraform first performs a read operation on the resources and syncs the local state with them. After that it inspects whether the configuration change would actually change the current state, if so it displays this info to the user and applies the update on the resources. If in the middle of the update some resource changes its property, it appears to terraform as inconsistency. This is exactly what happens for this issue, since the nodes_ip_range is not modified during the read (not possible to know the to-be-applied values), and after update the K8s was expecting some value but it gets another one.

Reporting in the plugin

Appears as an error message "Provider produced inconsistent result after apply".

Workaround

execute terraform apply -parallelism=1 again, it should see the up-to-date value and deploy the failing resources.

Fixes

No apparent clean fix. But it looks like it should be too common in other scenarios to go unnoticed.

@mariobassem
Copy link
Collaborator

mariobassem commented Nov 15, 2022

should be solved by this (#361)

@mariobassem mariobassem modified the milestones: 1.6.0, v1.5.9 Nov 21, 2022
@mariobassem mariobassem moved this to 👀 Verification in 3.9.0 Nov 21, 2022
@mariobassem mariobassem moved this from 👀 Verification to ✅ Done in 3.9.0 Nov 21, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
type_bug Something isn't working
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants