Skip to content

Commit a5a134b

Browse files
authored
Merge pull request #134 from opsmill/wvd-20241111-fix-infrahubctl-transform-branch
sets branch on InfrahubClient when running `infrahubctl transform` `infahubctl check` and `infrahubctl generator`
2 parents b5acff9 + 799405c commit a5a134b

File tree

4 files changed

+4
-3
lines changed

4 files changed

+4
-3
lines changed

changelog/133.fixed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixes issues where InfrahubClient was not properly configured for a branch when running the `infrahubctl transform`, `infrahubctl check` and `infrhubctl generator` commands.

infrahub_sdk/ctl/check.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ async def run_checks(
196196
log = logging.getLogger("infrahub")
197197

198198
check_summary: list[bool] = []
199-
client = initialize_client()
199+
client = initialize_client(branch=branch)
200200
for check_module in check_modules:
201201
if check_module.definition.targets:
202202
result = await run_targeted_check(

infrahub_sdk/ctl/cli_commands.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ def transform(
335335
transform_config = matched[0]
336336

337337
# Get client
338-
client = initialize_client()
338+
client = initialize_client(branch=branch)
339339

340340
# Get python transform class instance
341341
try:

infrahub_sdk/ctl/generator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ async def run(
4343
if param_key:
4444
identifier = param_key[0]
4545

46-
client = initialize_client()
46+
client = initialize_client(branch=branch)
4747
if variables_dict:
4848
data = execute_graphql_query(
4949
query=generator_config.query,

0 commit comments

Comments
 (0)