Skip to content

Commit dd1d2a2

Browse files
Making the filter for the targets to be statically set as this shouldn't change and potential issues arise if the identifier is only valid on the specific object and not the 'CoreGroup'.
1 parent b264b04 commit dd1d2a2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

infrahub_sdk/ctl/check.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,10 @@ async def run_targeted_check(
137137
variables: dict[str, str],
138138
branch: str | None = None,
139139
) -> bool:
140-
filters = {}
141140
identifier = None
142141
identifier_attribute = None
143142
# TODO: Does this support multiple parameters and we need make identifiers a dict to iterate over on L166-168?
144143
for param_key, param_value in check_module.definition.parameters.items():
145-
filters[param_value] = check_module.definition.targets
146144
identifier = param_key
147145
identifier_attribute = param_value.split("__")[0]
148146

@@ -159,7 +157,9 @@ async def run_targeted_check(
159157
)
160158
check_summary.append(result)
161159
else:
162-
targets = await client.get(kind="CoreGroup", include=["members"], **filters)
160+
targets = await client.get(
161+
kind="CoreGroup", include=["members"], **{"name__value": check_module.definition.targets}
162+
)
163163
await targets.members.fetch()
164164
for member in targets.members.peers:
165165
check_parameter = {}

0 commit comments

Comments
 (0)