(#18187) Clear *root* environment when clearing caches#1455
Closed
domcleal wants to merge 1 commit intopuppetlabs:masterfrom
Closed
(#18187) Clear *root* environment when clearing caches#1455domcleal wants to merge 1 commit intopuppetlabs:masterfrom
domcleal wants to merge 1 commit intopuppetlabs:masterfrom
Conversation
When changing settings or initializing Puppet via TestHelper, the Puppet::Node::Environment.clear method is called to delete the cached environment objects, as they may reference cached module paths based on old values of settings. The *root* environment is a special case, as it acts as the current environment when no other environment has been created and set yet. It can still have a module path based on current settings, so it too should be cleared along with other cached environments. This was an issue in 2.7.x in particular, where *root* would be used usually. In later versions, app_defaults_initialized? prevents *root* from being used too early.
Contributor
Author
|
Replaces GH-1339, targeted at master instead (though most useful in 2.7.x). |
Contributor
|
Thanks very much for submitting this pull request! I actually rebased this pull request myself since we decided to retarget at 3.1.x. It's been merged as 7bd6a90 and should be released in 3.1.1. Pardon the confusion on this; I didn't update the tickets in a timely manner before acting. Thanks again! |
Contributor
|
In addition, this has been merged up from 3.1.x into master as ab440d9. |
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.
When changing settings or initializing Puppet via TestHelper, the
Puppet::Node::Environment.clear method is called to delete the cached
environment objects, as they may reference cached module paths based on old
values of settings.
The root environment is a special case, as it acts as the current environment
when no other environment has been created and set yet. It can still have a
module path based on current settings, so it too should be cleared along with
other cached environments.
This was an issue in 2.7.x in particular, where root would be used usually.
In later versions, app_defaults_initialized? prevents root from being used
too early.