Remove version checking from image-tag
parent
0c16aab353
commit
2c1b4030c8
|
|
@ -6506,9 +6506,6 @@ const platform_1 = __importDefault(__nccwpck_require__(9707));
|
||||||
class ImageTag {
|
class ImageTag {
|
||||||
constructor(imageProperties) {
|
constructor(imageProperties) {
|
||||||
const { editorVersion, targetPlatform, customImage, buildPlatform, containerRegistryRepository, containerRegistryImageVersion, providerStrategy, } = imageProperties;
|
const { editorVersion, targetPlatform, customImage, buildPlatform, containerRegistryRepository, containerRegistryImageVersion, providerStrategy, } = 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;
|
||||||
|
|
@ -6520,9 +6517,6 @@ class ImageTag {
|
||||||
this.imagePlatformPrefix = ImageTag.getImagePlatformPrefixes(buildPlatform);
|
this.imagePlatformPrefix = ImageTag.getImagePlatformPrefixes(buildPlatform);
|
||||||
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() {
|
|
||||||
return /^(20\d{2}\.\d\.\w{3,4}|3)$/;
|
|
||||||
}
|
|
||||||
static get targetPlatformSuffixes() {
|
static get targetPlatformSuffixes() {
|
||||||
return {
|
return {
|
||||||
generic: '',
|
generic: '',
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -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();
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -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: '',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue