Check for clobber issues within a single catalog #27
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.
There is code that checks for multiple windows_env instances with
clobber enabled on the same variable. This check makes use of the
instance variable @mergemode, which gets the entire contents of the
previously instantiated resource.
This was causing issues in the case where Puppet restarts mid-way
through its run to account for agent-specified environment conflicts.
When Puppet does this, it does not clear, or re-instantiate, its
types. This caused all instance variables to stick around for the next
run.
The check was looking at the instance variable that it already made;
which was technically coming from a different catalog (a different,
albeit stunted, Puppet run).
This commit fixes the issue by adding some logic that checks to see that
we are only validating for duplicate clobber within the same catalog.
Ideally, this fix shouldn't be needed because Puppet should
re-instantiate its types when it restarts a Puppet run.