Referencing a class does not validate until it is consume in a `require` like metaparameter
|Affected Puppet version:||2.7.6||Branch:|
From the original report:
I had a typo in my require default line which didn’t raise any sort of error until I added to a specific resource. That is I had
$require = Class["apps::postgres::multi"]when there was no such class (the class was named
apps::postgresql::multi) and this did not raise an error.
I found the typo when I had an ordering issue and tried adding the
require => Class["apps::postgres::multi"]to a specific resource and this generated the error “err: Failed to apply catalog: Could not find dependency Class …”.
It should generate the ‘could not find dependency’ error for the default.
I have verified this: assigning a reference to a type does absolutely not validation in Puppet 2.7, including when the content is consumed in some cases:
$foo = Class["foo"] $bar = Banana["bar"] # note: no such type! notice("hello, $foo, from your little $bar")
Instead, the referenced type and entity should be validated during compilation, so that a clear error occurs when you reference a non-existent anything – not just when that value would be consumed in a way that dereferences the dependency.
#1 Updated by Daniel Pittman over 1 year ago
- Subject changed from require metaparameter default does not raise an error to Referencing a class does not validate until it is consume in a `require` like metaparameter
- Description updated (diff)
- Category set to language
- Status changed from Unreviewed to Needs Decision
- Assignee set to Randall Hansen
Randall, this is assigned to you because the key priority decision is around the UX failure here, I think. Can you work out what priority this has, and what it targets, please?