Update CT primitive batch_id
plan modifiers
#1017
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
batch_id
attribute represents the ID of the "batch" policy object associated with a Connectivity Template primitive.Primitives which have children keep their child IDs in the "batch" policy object.
Primitives which do not have children do not have a "batch" policy object.
So, the state (null or not) of
batch_id
of a given primitive depends on whether that primitive has any child primitives.Each primitive has a plan modifier which detected deletion of the last child, and set the
batch_id
from some value tonull
.The original description is accurate: "preserves the the state value unless all child primitives have been removed, in which case null is planned"
The problem is we're only detecting the transition from value -> null. We don't detect the other side of it: Creation of the first child, in which case the
batch_id
needs to be updated fromnull
to some known value.This PR modifies the string plan modification logic of each child-capable primitive to ensure they handle switching between
known
andnull
and back again.IpLink
BgpPeeringGenericSystem
BgpPeeringIpEndpoint
DynamicBgpPeering
VirtualNetworkSingle