Commit edd96fc
authored
Fix apply_overrides to support nested template overrides in spec.yaml (#23348)
* Fix apply_overrides to support nested template overrides in spec.yaml
When a spec.yaml template reference has an overrides: block targeting a field
that lives inside a nested template (e.g. tags inside instances/default ->
instances/all_integrations -> instances/tags), apply_overrides previously
could not find the field because it only searched the raw (unexpanded)
template list.
The new _expand_and_find helper recursively loads nested template refs
in-place, allowing any named field at any nesting depth to be reached
from a single overrides: block in spec.yaml.
* Fix ruff formatting in template.py and test_template.py1 parent f7406de commit edd96fc
3 files changed
Lines changed: 71 additions & 10 deletions
File tree
- datadog_checks_dev
- changelog.d
- datadog_checks/dev/tooling/configuration
- tests/tooling/configuration
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Lines changed: 48 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
79 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
80 | 117 | | |
81 | 118 | | |
82 | 119 | | |
| |||
100 | 137 | | |
101 | 138 | | |
102 | 139 | | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
107 | 143 | | |
108 | 144 | | |
109 | 145 | | |
| |||
123 | 159 | | |
124 | 160 | | |
125 | 161 | | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
130 | 168 | | |
131 | 169 | | |
132 | 170 | | |
| |||
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
0 commit comments