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

Update CT resource batch_id plan modifiers to handle unknown children #1023

Merged
merged 1 commit into from
Jan 22, 2025

Conversation

chrismarget-j
Copy link
Collaborator

It turns out that #1017 fixed a related issue, but not the exact problem faced by @coterv in #1012.

Both issues are in the plan modifier for the CT primitive batch_id attribute.

@coterv's configuration causes the plan modifier to run while the details of child primitives are in Unknown state.

Prior to these changes, the plan modifier counts those not-yet-available child primitives, concludes that none exist, and sets the batch_id attribute to null (there are no children, so there won't be a child container, so the ID is moot).

Later, when the child primitives are fully fleshed out (upstream dependencies are satisfied), the plan modifier runs again. This time, when it counts the child primitives, it finds a non-zero number and sets the batch_id to Unknown (there will be a child container object, and it will have an ID).

Terraform complains about this inconsistent planning behavior: batch_id: was null, but now cty.UnknownVal(cty.String)

Closes #1012

@chrismarget-j chrismarget-j merged commit 92c1d19 into main Jan 22, 2025
1 check passed
@chrismarget-j chrismarget-j deleted the issue-1012-with-unknown-child-primitives branch January 22, 2025 21:33
@coterv
Copy link

coterv commented Jan 23, 2025

Issue resolved in v0.80.1

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.

Provider v0.79 - Inconsistent Plan Error When Adding Routing Policy Primitive to CT (Apstra 4.2.1.1)
3 participants