diff --git a/src/portal/src/lib/components/create-edit-endpoint/create-edit-endpoint.component.spec.ts b/src/portal/src/lib/components/create-edit-endpoint/create-edit-endpoint.component.spec.ts index b3e2263ef..0c56d0319 100644 --- a/src/portal/src/lib/components/create-edit-endpoint/create-edit-endpoint.component.spec.ts +++ b/src/portal/src/lib/components/create-edit-endpoint/create-edit-endpoint.component.spec.ts @@ -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" } ] }, diff --git a/src/portal/src/lib/components/endpoint/endpoint.component.spec.ts b/src/portal/src/lib/components/endpoint/endpoint.component.spec.ts index 991e9b44e..414ed023e 100644 --- a/src/portal/src/lib/components/endpoint/endpoint.component.spec.ts +++ b/src/portal/src/lib/components/endpoint/endpoint.component.spec.ts @@ -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 diff --git a/src/replication/adapter/awsecr/adapter.go b/src/replication/adapter/awsecr/adapter.go index d73c50940..0ad569d3f 100644 --- a/src/replication/adapter/awsecr/adapter.go +++ b/src/replication/adapter/awsecr/adapter.go @@ -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", + }, }, }, } diff --git a/src/replication/adapter/awsecr/adapter_test.go b/src/replication/adapter/awsecr/adapter_test.go index 3b1a19e6b..ce196729b 100644 --- a/src/replication/adapter/awsecr/adapter_test.go +++ b/src/replication/adapter/awsecr/adapter_test.go @@ -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{