1
0
Fork 0
mirror of https://github.com/docker/login-action.git synced 2025-04-22 14:46:37 +02:00

Add support for public ECR

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2020-12-11 07:15:35 +01:00
parent 7c9afe235c
commit 1e75de0e0e
No known key found for this signature in database
GPG key ID: 3248E46B6BB8C7F7
6 changed files with 121 additions and 23 deletions

View file

@ -5,12 +5,24 @@ describe('isECR', () => {
test.each([
['registry.gitlab.com', false],
['gcr.io', false],
['012345678901.dkr.ecr.eu-west-3.amazonaws.com', true]
['012345678901.dkr.ecr.eu-west-3.amazonaws.com', true],
['public.ecr.aws', true]
])('given registry %p', async (registry, expected) => {
expect(await aws.isECR(registry)).toEqual(expected);
});
});
describe('isPubECR', () => {
test.each([
['registry.gitlab.com', false],
['gcr.io', false],
['012345678901.dkr.ecr.eu-west-3.amazonaws.com', false],
['public.ecr.aws', true]
])('given registry %p', async (registry, expected) => {
expect(await aws.isPubECR(registry)).toEqual(expected);
});
});
describe('getCLI', () => {
it('exists', async () => {
const awsPath = await aws.getCLI();
@ -45,10 +57,10 @@ describe('parseCLIVersion', () => {
});
describe('getRegion', () => {
test.each([['012345678901.dkr.ecr.eu-west-3.amazonaws.com', 'eu-west-3']])(
'given registry %p',
async (registry, expected) => {
expect(await aws.getRegion(registry)).toEqual(expected);
}
);
test.each([
['012345678901.dkr.ecr.eu-west-3.amazonaws.com', 'eu-west-3'],
['public.ecr.aws', 'us-east-1']
])('given registry %p', async (registry, expected) => {
expect(await aws.getRegion(registry)).toEqual(expected);
});
});