Jira (PUP-10304) Always lookup environment using :current_environment

9 views
Skip to first unread message

Molly Waggett (JIRA)

unread,
Feb 20, 2020, 2:26:04 PM2/20/20
to puppe...@googlegroups.com
Molly Waggett created an issue
 
Puppet / New Feature PUP-10304
Always lookup environment using :current_environment
Issue Type: New Feature New Feature
Assignee: Unassigned
Created: 2020/02/20 11:24 AM
Priority: Normal Normal
Reporter: Molly Waggett

Besides the initial environment lookup, lookup the environment using :current_environment, e.g. Puppet.lookup(:current_environment)

This ensures that we continue to use the same version of an environment that we started with.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Molly Waggett (JIRA)

unread,
Feb 20, 2020, 5:36:03 PM2/20/20
to puppe...@googlegroups.com
Molly Waggett updated an issue
Change By: Molly Waggett
Besides the initial environment lookup, lookup the environment using :current_environment, e.g. {{Puppet.lookup(:current_environment)}} , as opposed to accessing the cache, e.g. {{Puppet.lookup(:environments).get(name)}}.

This ensures that we continue to use the same version of an environment that we started with.

Molly Waggett (JIRA)

unread,
Feb 20, 2020, 5:36:06 PM2/20/20
to puppe...@googlegroups.com
Molly Waggett updated an issue
Besides the initial environment lookup, lookup we should look up the environment using :current_environment, e.g. {{Puppet.lookup(:current_environment)}}, as opposed to accessing the cache, e.g. {{Puppet.lookup(:environments).get(name)}}.


This ensures that we continue to use the same version of an environment that we started with.

Molly Waggett (JIRA)

unread,
Feb 20, 2020, 5:37:04 PM2/20/20
to puppe...@googlegroups.com
Molly Waggett updated an issue
Besides the initial After environment lookup initialization , we should look up the environment using :current_environment, e.g. {{Puppet.lookup(:current_environment)}}, as opposed to accessing the cache, e.g. {{Puppet.lookup(:environments).get(name)}}.


This ensures that we continue to use the same version of an environment that we started with.

Maggie Dreyer (JIRA)

unread,
Feb 21, 2020, 4:29:04 PM2/21/20
to puppe...@googlegroups.com

Maggie Dreyer (JIRA)

unread,
Feb 24, 2020, 1:36:04 PM2/24/20
to puppe...@googlegroups.com
Maggie Dreyer commented on New Feature PUP-10304
 
Re: Always lookup environment using :current_environment

In indirected_routes, we figure out the environment, then store it in params and override :current_environment with it. Later, when we do the find through the indirection, params get turned into an Indirector::Request that is passed along to the proper terminus. In the Catalog::Compiler indirection, we pull the environment out of this Indirector::Request and set the node's environment to it. It seems like throughout the compile itself, this environment stored on the node is used. I used our v4 catalog endpoint implementation as a cross-reference: the only way we specify the environment for the compile is by setting it on a node, and that one seems to work correctly.

Next up, I'm going to check other places we access the environment cache and see what they're up to.

Maggie Dreyer (JIRA)

unread,
Feb 24, 2020, 2:12:06 PM2/24/20
to puppe...@googlegroups.com

We fetch the environment new from the cache for each request made during an agent run: node, file_metadatas/pluginfacts, file_metadatas/plugins, file_metadatas/locales, catalog, report. This seems potentially problematic, but I'm not entirely sure how to fix it without the agent understanding something about environment versions.

Maggie Dreyer (JIRA)

unread,
Feb 24, 2020, 6:14:04 PM2/24/20
to puppe...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages