mirror of
https://github.com/goharbor/harbor.git
synced 2024-09-29 22:07:32 +02:00
Add aws China regions ECR support, both of cn-north-1 and cn-northwest-1 endpoints.
Signed-off-by: Ziming Zhang <zziming@vmware.com>
This commit is contained in:
parent
a651eb0949
commit
bda66e9e1f
@ -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{
|
||||
|
Loading…
Reference in New Issue
Block a user