fix(terraform): check for missing version provider blocks (#12962)

This commit is contained in:
Sebastian Poxhofer 2021-12-05 19:52:04 +01:00 committed by GitHub
parent 99749f17f3
commit 87abbebc1d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 1 deletions

View file

@ -212,6 +212,7 @@ Object {
"depType": "provider", "depType": "provider",
"lockedVersion": undefined, "lockedVersion": undefined,
"lookupName": "hashicorp/helm", "lookupName": "hashicorp/helm",
"skipReason": "no-version",
}, },
Object { Object {
"currentValue": "V1.9", "currentValue": "V1.9",

View file

@ -36,7 +36,7 @@ describe('manager/terraform/extract', () => {
const res = await extractPackageFile(tf1, '1.tf', {}); const res = await extractPackageFile(tf1, '1.tf', {});
expect(res).toMatchSnapshot(); expect(res).toMatchSnapshot();
expect(res.deps).toHaveLength(51); 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 () => { it('returns null if only local deps', async () => {

View file

@ -99,4 +99,8 @@ export function analyzeTerraformProvider(
massageProviderLookupName(dep); massageProviderLookupName(dep);
dep.lockedVersion = getLockedVersion(dep, locks); dep.lockedVersion = getLockedVersion(dep, locks);
if (!dep.currentValue) {
dep.skipReason = SkipReason.NoVersion;
}
} }