Skip to content

Commit

Permalink
fix(manager/terragrunt): add missing registry host
Browse files Browse the repository at this point in the history
Added registry url to extraction result at Terragrunt Manager when
source uses tfr protocol and contains custom registry hostname.

Fixes: #26668
  • Loading branch information
ismtabo committed Jan 16, 2024
1 parent 0352aed commit 3d5de6d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/modules/manager/terragrunt/__fixtures__/1.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,8 @@ terraform {
terraform {
source = "tfr://terraform-aws-modules/vpc/aws?version=3.3.0"
}

#with domain
terraform {
source = "tfr://registry.domain.com/abc/helloworld/aws?version=1.0.0"
}
7 changes: 7 additions & 0 deletions lib/modules/manager/terragrunt/extract.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ describe('modules/manager/terragrunt/extract', () => {
depType: 'terragrunt',
},
{},
{
currentValue: '1.0.0',
datasource: 'terraform-module',
depName: 'abc/helloworld/aws',
depType: 'terragrunt',
registryUrls: ['https://registry.domain.com'],
},
],
});
});
Expand Down
3 changes: 3 additions & 0 deletions lib/modules/manager/terragrunt/modules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ export function analyseTerragruntModule(
tfrVersionMatch.groups.cloud;
dep.currentValue = tfrVersionMatch.groups.currentValue;
dep.datasource = TerraformModuleDatasource.id;
if (tfrVersionMatch.groups.registry) {
dep.registryUrls = [`https://${tfrVersionMatch.groups.registry}`];
}
} else if (source) {
const moduleParts = source.split('//')[0].split('/');
if (moduleParts[0] === '..') {
Expand Down

0 comments on commit 3d5de6d

Please sign in to comment.