Skip to content

Commit 1c2b813

Browse files
committed
(SERVER-3050) Bypass the fact cache in the v4 catalog endpoint
When we stopped explicitly querying the PuppetDB terminus for facts, we inadventently started using the yaml cache terminus instead of PuppetDB, even when PuppetDB was configured. However, trusted facts are not stored in the yaml cache, and the primary use case for this endpoint requires stored trusted facts to be retrieved from the system. So this commit updates the fact retrieval to bypass the cache terminus for facts, going instead directly to the primary terminus. When PuppetDB is configured, this means we will query PDB for facts, rather than the default yaml cache, and therefore retrieve its stored trusted facts.
1 parent 846047a commit 1c2b813

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/ruby/puppetserver-lib/puppet/server/compiler.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,10 @@ def extract_trusted_facts(request_data, facts)
208208
end
209209

210210
def get_facts_from_terminus(nodename, environment)
211+
# Ignore the cache terminus, which is not guaranteed to store trusted facts
211212
facts = Puppet::Node::Facts.indirection.find(nodename,
212-
{environment: environment})
213+
{environment: environment,
214+
ignore_cache: true})
213215

214216
# If no facts have been stored for the node, the terminus will return nil
215217
if facts.nil?

0 commit comments

Comments
 (0)