Commit 2f577b4
committed
Cast
Reading the existing config on the node in `load_current_value` returns
string keys. If you then pass the same configuration but with symbol
keys to `server_config` in `postgresql_config`, `converge_if_changed`
will believe the resource changed and proceed with converging. The keys
are already cast to strings before being passed to the `template`
resource, so the template itself doesn't actually change but the
`postgresql_config` resource still believes it changed, so any
notifications will fire. For example, if you have the resource reload
postgresql on change, it'll reload each time the node is converged.
By casting the keys to strings when coercing the property, the resource
will no longer believe it changed when the only difference was the class
of the key, thus it wont fire notifications unnecessarily.
Signed-off-by: Chris Gunther <[email protected]>server_config keys to strings in postgresql_config to avoid unnecessary converges1 parent 0b0da2c commit 2f577b4
File tree
3 files changed
+21
-19
lines changed- resources
- test/cookbooks/test/recipes
3 files changed
+21
-19
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
0 commit comments