@@ -144,25 +144,26 @@ def _assign_dynamic_config_values(self, schema, config, parent_keys=None):
144
144
is_dictionary = isinstance (config_item_value , dict )
145
145
is_list = isinstance (config_item_value , list )
146
146
147
+ # pass a copy of parent_keys so the loop doesn't add sibling keys
148
+ current_keys = parent_keys + [str (config_item_keys )]
149
+
147
150
# Inspect nested object properties
148
151
if is_dictionary :
149
- parent_keys += [str (config_item_key )]
150
152
property_schema = self ._get_object_property_schema (
151
153
schema_item ,
152
154
additional_properties_keys = config_item_value .keys (),
153
155
)
154
156
self ._assign_dynamic_config_values (
155
157
schema = property_schema ,
156
158
config = config [config_item_key ],
157
- parent_keys = parent_keys ,
159
+ parent_keys = current_keys ,
158
160
)
159
161
# Inspect nested list items
160
162
elif is_list :
161
- parent_keys += [str (config_item_key )]
162
163
self ._assign_dynamic_config_values (
163
164
schema = schema_item .get ("items" , {}),
164
165
config = config [config_item_key ],
165
- parent_keys = parent_keys ,
166
+ parent_keys = current_keys ,
166
167
)
167
168
else :
168
169
is_jinja_expression = jinja_utils .is_jinja_expression (
@@ -171,9 +172,7 @@ def _assign_dynamic_config_values(self, schema, config, parent_keys=None):
171
172
172
173
if is_jinja_expression :
173
174
# Resolve / render the Jinja template expression
174
- full_config_item_key = "." .join (
175
- parent_keys + [str (config_item_key )]
176
- )
175
+ full_config_item_key = "." .join (current_keys )
177
176
value = self ._get_datastore_value_for_expression (
178
177
key = full_config_item_key ,
179
178
value = config_item_value ,
0 commit comments