Skip to content

Commit

Permalink
fix(terraform): check for missing version provider blocks (#12962)
Browse files Browse the repository at this point in the history
  • Loading branch information
secustor committed Dec 5, 2021
1 parent 99749f1 commit 87abbeb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/manager/terraform/__snapshots__/extract.spec.ts.snap
Expand Up @@ -212,6 +212,7 @@ Object {
"depType": "provider",
"lockedVersion": undefined,
"lookupName": "hashicorp/helm",
"skipReason": "no-version",
},
Object {
"currentValue": "V1.9",
Expand Down
2 changes: 1 addition & 1 deletion lib/manager/terraform/extract.spec.ts
Expand Up @@ -36,7 +36,7 @@ describe('manager/terraform/extract', () => {
const res = await extractPackageFile(tf1, '1.tf', {});
expect(res).toMatchSnapshot();
expect(res.deps).toHaveLength(51);
expect(res.deps.filter((dep) => dep.skipReason)).toHaveLength(8);
expect(res.deps.filter((dep) => dep.skipReason)).toHaveLength(9);
});

it('returns null if only local deps', async () => {
Expand Down
4 changes: 4 additions & 0 deletions lib/manager/terraform/providers.ts
Expand Up @@ -99,4 +99,8 @@ export function analyzeTerraformProvider(
massageProviderLookupName(dep);

dep.lockedVersion = getLockedVersion(dep, locks);

if (!dep.currentValue) {
dep.skipReason = SkipReason.NoVersion;
}
}

0 comments on commit 87abbeb

Please sign in to comment.