We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e0c62a9 commit f25ff28Copy full SHA for f25ff28
__tests__/aws.test.ts
@@ -11,7 +11,8 @@ describe('isECR', () => {
11
['876820548815.dkr.ecr.cn-north-1.amazonaws.com.cn', true],
12
['390948362332.dkr.ecr.cn-northwest-1.amazonaws.com.cn', true],
13
['012345678901.dkr-ecr.eu-north-1.on.aws', true],
14
- ['public.ecr.aws', true]
+ ['public.ecr.aws', true],
15
+ ['ecr-public.aws.com', true]
16
])('given registry %p', async (registry, expected) => {
17
expect(aws.isECR(registry)).toEqual(expected);
18
});
@@ -25,7 +26,8 @@ describe('isPubECR', () => {
25
26
['876820548815.dkr.ecr.cn-north-1.amazonaws.com.cn', false],
27
['390948362332.dkr.ecr.cn-northwest-1.amazonaws.com.cn', false],
28
['012345678901.dkr-ecr.eu-north-1.on.aws', false],
29
30
31
32
expect(aws.isPubECR(registry)).toEqual(expected);
33
src/aws.ts
@@ -6,13 +6,14 @@ import {HttpProxyAgent} from 'http-proxy-agent';
6
import {HttpsProxyAgent} from 'https-proxy-agent';
7
8
const ecrRegistryRegex = /^(([0-9]{12})\.(dkr\.ecr|dkr-ecr)\.(.+)\.(on\.aws|amazonaws\.com(.cn)?))(\/([^:]+)(:.+)?)?$/;
9
+const ecrPublicRegistryRegex = /public\.ecr\.aws|ecr-public\.aws\.com/;
10
export const isECR = (registry: string): boolean => {
return ecrRegistryRegex.test(registry) || isPubECR(registry);
};
export const isPubECR = (registry: string): boolean => {
- return registry === 'public.ecr.aws';
+ return ecrPublicRegistryRegex.test(registry);
19
export const getRegion = (registry: string): string => {
0 commit comments