Commit 60fab12
committed
(PUP-11074) Add catalog edge only if parent resource has a container
Managing resources with generators behaves differently with `puppet
resource` and `puppet apply`.
When running with `puppet apply`, the parent resource is always
contained by something like `Class[Main]`, so adding an edge between
that and our generated resource works.
When running with `puppet resource`, the parent resource is not
contained by anything (`container_of(parent_resource)` returns nil),
which adds an edge with a nil vertex to the catalog. This in turn causes
the run to fail with a NilClass exception when performing pre-run
checks[1] in the Transaction class, as the catalog now contains a nil
vertex.
[1] https://github.com/puppetlabs/puppet/blob/ab56d86ecb4b71298c75325462bf73376420bb40/lib/puppet/transaction.rb#L801 parent 2fde3e6 commit 60fab12
File tree
2 files changed
+31
-1
lines changed- lib/puppet/transaction
- spec/integration/application
2 files changed
+31
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
| 140 | + | |
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
0 commit comments