Conversation
…rect data With two indentical inventory queries, one with the AllEnvs flag and one without both queries return the data from the query with the AllEnvs flag set. This fix adds a test to the invitem class when assembling the inventory query result to check that the node environments match or that the query has the AllEnvs flag set.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
With two identical inventory queries, one with the AllEnvs flag and one without both queries return the data from the query with the AllEnvs flag set.
Inventory queries use a pre calculated list of nodes to loop over to determine which nodes match the inventory query. If any inventory queries have the AllEnvs flag set then nodes from all environments will be present in the pre calculated list of nodes. Thus other queries which do not have the AllEnvs flags set could then match nodes from other environments.
The fix adds a test to the invitem class when assembling the inventory query result to check that the node environments match or that the query has the AllEnvs flag set. Unit tests are also added to check this functionality.