fix(docker): use docker versioning for debian images with regular tags (#17602)

This commit is contained in:
Johannes Feichtner 2022-09-04 07:08:51 +02:00 committed by GitHub
parent 4ccd085aa5
commit c4127f994c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 1 deletions

View file

@ -649,6 +649,22 @@ describe('modules/manager/dockerfile/extract', () => {
]);
});
it('handles debian with regular tag', () => {
const res = extractPackageFile('FROM debian:11.4-slim\n', '', {})?.deps;
expect(res).toEqual([
{
autoReplaceStringTemplate:
'{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}',
currentDigest: undefined,
currentValue: '11.4-slim',
datasource: 'docker',
depName: 'debian',
depType: 'final',
replaceString: 'debian:11.4-slim',
},
]);
});
it('handles debian with prefixes', () => {
const res = extractPackageFile('FROM amd64/debian:10\n', '', {})?.deps;
expect(res).toEqual([

View file

@ -208,7 +208,10 @@ export function getDep(
dep.versioning = ubuntuVersioning.id;
}
if (dep.depName === 'debian') {
if (
dep.depName === 'debian' &&
debianVersioning.api.isVersion(dep.currentValue)
) {
dep.versioning = debianVersioning.id;
}