Skip to content

Commit fe3d6ad

Browse files
authored
Merge pull request #80 from kang2453/master
docs: Add Docker Hub and AWS ECR settings to README.md, and modify GC…
2 parents d821029 + 2793dcc commit fe3d6ad

File tree

2 files changed

+51
-22
lines changed

2 files changed

+51
-22
lines changed

README.md

Lines changed: 49 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,59 @@ SpaceONE Repository Service
1010

1111
# Configuration
1212

13-
## FOR AWS ECR User
1413

14+
15+
16+
## Docker Hub Setup ( Docker Hub )
17+
~~~
18+
CONNECTORS:
19+
DockerHubConnector:
20+
registry_url:"<registry_url>"
21+
22+
REGISTRY_INFO:
23+
DOCKER_HUB:
24+
url: registry.hub.docker.com
25+
DEFAULT_REGISTRY: "DOCKER_HUB"
1526
~~~
16-
CONNECTOR:
17-
RegistryConnector:
18-
host: https://<account_id>.dkr.ecr.<region_name>.amazonaws.com
19-
verify_ssl: False
20-
username: AWS
21-
api_version: 2
22-
23-
## GCP artifact repository added
24-
CONNECTOR:
25-
RegistryConnector:
26-
host: https://<account_id>.dkr.ecr.<region_name>.amazonaws.com
27-
verify_ssl: False
28-
username: AWS
29-
api_version: 2
27+
28+
## AWS Setup (ECR)
29+
~~~
30+
CONNECTORS:
31+
AWSPrivateECRConnector:
32+
aws_access_key_id: "<AWS_ACCESS_KEY_ID>"
33+
aws_secret_access_key: "<AWS_SECRET_ACCESS_KEY>"
34+
region_name: "<ap-northeast-2>"
35+
account_id: "<123456789012>"
36+
37+
REGISTRY_INFO:
38+
AWS_PRIVATE_ECR:
39+
url: "<account_id>.dkr.ecr.<region>.amazonaws.com"
40+
41+
DEFAULT_REGISTRY: "AWS_PRIVATE_ECR"
42+
~~~
43+
44+
- Example url: `123456789012.dkr.ecr.ap-northeast-2.amazonaws.com`
45+
- If you set `DEFAULT_REGISTRY` to `AWS_PRIVATE_ECR`, plugin images are pulled from ECR.
46+
47+
48+
## GCP Setup (Artifact Registry)
49+
50+
Prepare a service account key (JSON) and use its Base64-encoded string.
51+
52+
~~~
53+
CONNECTORS:
3054
GCPPrivateGCRConnector:
31-
project_id: project id
32-
repository_id: gcp's artifact registry id
33-
location:
34-
service_account_key: service account key base64 encode
55+
project_id: "<my-project-id>" # Optional; inferred from the service account key when omitted
56+
repository_id: "<artifact-registry-repo-id>"
57+
location: "<artifact-registry-repo-location>"
58+
service_account_key: "<BASE64_ENCODED_SERVICE_ACCOUNT_JSON>"
3559
3660
REGISTRY_INFO:
3761
GCP_PRIVATE_GCR:
38-
url: <location>-docker.pkg.dev/<project_id>/<repository_id>
62+
url: "<location>-docker.pkg.dev/<project_id>/<repository_id>"
63+
64+
DEFAULT_REGISTRY: "GCP_PRIVATE_GCR"
3965
~~~
66+
67+
- Example url: `asia-northeast3-docker.pkg.dev/my-project/gcr-repository`
68+
- If you set `DEFAULT_REGISTRY` to `GCP_PRIVATE_GCR`, plugin images are pulled from Artifact Registry.

src/spaceone/repository/connector/registry_connector.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ def __init__(self, *args, **kwargs):
158158

159159
# 서비스 계정 키 JSON 사용
160160
try:
161-
self.repository_id = self.config.get("repository_id", "space-cloudops")
162-
self.location = self.config.get("location", "asia-northeast3")
161+
self.repository_id = self.config.get("repository_id")
162+
self.location = self.config.get("location")
163163

164164
service_account_key = self.config.get("service_account_key")
165165
decoded_key = base64.b64decode(service_account_key).decode('utf-8')

0 commit comments

Comments
 (0)