Skip to content

Commit a3a24bc

Browse files
authored
fix(allow_list): Load string values (#59)
Loads string values input to the allow_list properties as if they were yaml inputs.
1 parent ff36e00 commit a3a24bc

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

jobs/otel-collector-windows/templates/config.yml.erb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,11 @@ def check_for_use_of_valid_components!(component_kind, included_components)
176176
end
177177

178178
def check_for_use_of_allowed_components!(component_kind, included_components, allowed_components)
179+
if allowed_components.is_a? String
180+
return if allowed_components.empty?
181+
allowed_components = YAML.safe_load(allowed_components)
182+
end
183+
179184
user_components = config.fetch(component_kind, {}).map {|key, _| key.split('/')[0]}
180185

181186
unrecognized_allowed_components = allowed_components - included_components

jobs/otel-collector/templates/config.yml.erb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,11 @@ def check_for_use_of_valid_components!(component_kind, included_components)
176176
end
177177

178178
def check_for_use_of_allowed_components!(component_kind, included_components, allowed_components)
179+
if allowed_components.is_a? String
180+
return if allowed_components.empty?
181+
allowed_components = YAML.safe_load(allowed_components)
182+
end
183+
179184
user_components = config.fetch(component_kind, {}).map {|key, _| key.split('/')[0]}
180185

181186
unrecognized_allowed_components = allowed_components - included_components

0 commit comments

Comments
 (0)