feat(docker): strip common prefixes from docker depName (#10997)

Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
This commit is contained in:
Rhys Arkins 2021-07-29 11:18:26 +02:00 committed by GitHub
parent 3096f340c8
commit 871f9f5b8e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 1 deletions

View file

@ -48,6 +48,18 @@ export function getDep(
'{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}';
}
dep.datasource = datasourceDocker.id;
// Pretty up special prefixes
if (dep.depName) {
const specialPrefixes = ['amd64', 'arm64', 'library'];
for (const prefix of specialPrefixes) {
if (dep.depName.startsWith(`${prefix}/`)) {
dep.lookupName = dep.depName;
dep.depName = dep.depName.replace(`${prefix}/`, '');
}
}
}
if (dep.depName === 'ubuntu') {
dep.versioning = ubuntuVersioning.id;
}

View file

@ -16,8 +16,9 @@ Array [
"currentDigest": "sha256:36adc17e9cceab32179d3314da9cb9c737ffb11f0de4e688f407ad6d9ca32201",
"currentValue": "10.0.0",
"datasource": "docker",
"depName": "amd64/node",
"depName": "node",
"depType": "docker",
"lookupName": "amd64/node",
"replaceString": "amd64/node:10.0.0@sha256:36adc17e9cceab32179d3314da9cb9c737ffb11f0de4e688f407ad6d9ca32201",
},
Object {