Commit bda66e9e authored by Ziming Zhang's avatar Ziming Zhang Committed by Ziming
Browse files

Add aws China regions ECR support, both of cn-north-1 and cn-northwest-1 endpoints.


Signed-off-by: default avatarZiming Zhang <zziming@vmware.com>
parent a651eb09
......@@ -198,6 +198,14 @@ describe("CreateEditEndpointComponent (inline template)", () => {
{
"key": "sa-east-1",
"value": "https://api.ecr.sa-east-1.amazonaws.com"
},
{
"key": "cn-north-1",
"value": "https://api.ecr.cn-north-1.amazonaws.com.cn"
},
{
"key": "cn-northwest-1",
"value": "https://api.ecr.cn-northwest-1.amazonaws.com.cn"
}
]
},
......
......@@ -185,7 +185,16 @@ describe("EndpointComponent (inline template)", () => {
{
"key": "sa-east-1",
"value": "https://api.ecr.sa-east-1.amazonaws.com"
},
{
"key": "cn-north-1",
"value": "https://api.ecr.cn-north-1.amazonaws.com.cn"
},
{
"key": "cn-northwest-1",
"value": "https://api.ecr.cn-northwest-1.amazonaws.com.cn"
}
]
},
"credential_pattern": null
......
......@@ -189,6 +189,14 @@ func getAdapterInfo() *model.AdapterPattern {
Key: "sa-east-1",
Value: "https://api.ecr.sa-east-1.amazonaws.com",
},
{
Key: "cn-north-1",
Value: "https://api.ecr.cn-north-1.amazonaws.com.cn",
},
{
Key: "cn-northwest-1",
Value: "https://api.ecr.cn-northwest-1.amazonaws.com.cn",
},
},
},
}
......
......@@ -49,6 +49,28 @@ func TestAdapter_NewAdapter(t *testing.T) {
assert.Nil(t, err)
assert.NotNil(t, adapter)
adapter, err = newAdapter(&model.Registry{
Type: model.RegistryTypeAwsEcr,
Credential: &model.Credential{
AccessKey: "xxx",
AccessSecret: "ppp",
},
URL: "https://api.ecr.test-china-region.amazonaws.com.cn",
})
assert.Nil(t, err)
assert.NotNil(t, adapter)
adapter, err = newAdapter(&model.Registry{
Type: model.RegistryTypeAwsEcr,
Credential: &model.Credential{
AccessKey: "xxx",
AccessSecret: "ppp",
},
URL: "https://123456.dkr.ecr.test-china-region.amazonaws.com.cn",
})
assert.Nil(t, err)
assert.NotNil(t, adapter)
adapter, err = newAdapter(&model.Registry{
Type: model.RegistryTypeAwsEcr,
Credential: &model.Credential{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment