Remove version checking from image-tag

This commit is contained in:
Andrew Kahr 2024-03-16 22:01:07 -07:00
parent 0c16aab353
commit 2c1b4030c8
4 changed files with 1 additions and 14 deletions

BIN
dist/index.js generated vendored

Binary file not shown.

BIN
dist/index.js.map generated vendored

Binary file not shown.

View File

@ -27,7 +27,7 @@ describe('ImageTag', () => {
expect(image.builderPlatform).toStrictEqual(testImageParameters.builderPlatform); expect(image.builderPlatform).toStrictEqual(testImageParameters.builderPlatform);
}); });
test.each(['2000.0.0f0', '2011.1.11f1'])('accepts %p version format', (version) => { test.each(['2000.0.0f0', '2011.1.11f1', '6000.0.0f1'])('accepts %p version format', (version) => {
expect( expect(
() => () =>
new ImageTag({ new ImageTag({
@ -37,11 +37,6 @@ describe('ImageTag', () => {
).not.toThrow(); ).not.toThrow();
}); });
test.each(['some version', ''])('throws for incorrect version %p', (editorVersion) => {
const { targetPlatform } = testImageParameters;
expect(() => new ImageTag({ editorVersion, targetPlatform })).toThrow();
});
test.each(['nonExisting'])('throws for unsupported target %p', (targetPlatform) => { test.each(['nonExisting'])('throws for unsupported target %p', (targetPlatform) => {
expect(() => new ImageTag({ targetPlatform })).toThrow(); expect(() => new ImageTag({ targetPlatform })).toThrow();
}); });

View File

@ -20,10 +20,6 @@ class ImageTag {
providerStrategy, providerStrategy,
} = imageProperties; } = imageProperties;
if (!ImageTag.versionPattern.test(editorVersion)) {
throw new Error(`Invalid version "${editorVersion}".`);
}
// Todo we might as well skip this class for customImage. // Todo we might as well skip this class for customImage.
// Either // Either
this.customImage = customImage; this.customImage = customImage;
@ -41,10 +37,6 @@ class ImageTag {
this.imageRollingVersion = Number(containerRegistryImageVersion); // Will automatically roll to the latest non-breaking version. this.imageRollingVersion = Number(containerRegistryImageVersion); // Will automatically roll to the latest non-breaking version.
} }
static get versionPattern(): RegExp {
return /^(20\d{2}\.\d\.\w{3,4}|3)$/;
}
static get targetPlatformSuffixes() { static get targetPlatformSuffixes() {
return { return {
generic: '', generic: '',