Skip to content

Commit e7e1c09

Browse files
committed
fix: circular dependency for REGISTRY_TYPE_MAP fix
1 parent 20cb06a commit e7e1c09

File tree

4 files changed

+176
-196
lines changed

4 files changed

+176
-196
lines changed

src/Common/Constants.ts

Lines changed: 0 additions & 176 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { RegistryType } from '@Shared/types'
18-
import { RegistryTypeDetailType } from './Types'
19-
import { getContainerRegistryIcon } from './utils'
20-
2117
export const FALLBACK_REQUEST_TIMEOUT = 60000
2218
export const Host = window?.__ORCHESTRATOR_ROOT__ ?? '/orchestrator'
2319

@@ -215,178 +211,6 @@ export const BuildStageVariable = {
215211
PostBuild: 'postBuildStage',
216212
}
217213

218-
export const REGISTRY_TYPE_MAP: Record<string, RegistryTypeDetailType> = {
219-
ecr: {
220-
value: 'ecr',
221-
label: 'ECR',
222-
desiredFormat: '(desired format: repo-name)',
223-
placeholderText: 'Eg. repo_name',
224-
gettingStartedLink: 'https://docs.aws.amazon.com/AmazonECR/latest/userguide/get-set-up-for-amazon-ecr.html',
225-
defaultRegistryURL: '',
226-
registryURL: {
227-
label: 'Registry URL',
228-
defaultValue: '',
229-
placeholder: 'Eg. xxxxxxxxxxxx.dkr.ecr.region.amazonaws.com',
230-
},
231-
id: {
232-
label: 'Access key ID',
233-
defaultValue: '',
234-
placeholder: '',
235-
},
236-
password: {
237-
label: 'Secret access key',
238-
defaultValue: '',
239-
placeholder: '',
240-
},
241-
startIcon: getContainerRegistryIcon(RegistryType.ECR),
242-
},
243-
'docker-hub': {
244-
value: 'docker-hub',
245-
label: 'Docker',
246-
desiredFormat: '(desired format: username/repo-name)',
247-
placeholderText: 'Eg. username/repo_name',
248-
gettingStartedLink: 'https://docs.docker.com/docker-hub/',
249-
defaultRegistryURL: 'docker.io',
250-
registryURL: {
251-
label: 'Registry URL',
252-
defaultValue: '',
253-
placeholder: '',
254-
},
255-
id: {
256-
label: 'Username',
257-
defaultValue: '',
258-
placeholder: '',
259-
},
260-
password: {
261-
label: 'Password/Token (Recommended: Token)',
262-
defaultValue: '',
263-
placeholder: '',
264-
},
265-
startIcon: getContainerRegistryIcon(RegistryType.DOCKER_HUB),
266-
},
267-
acr: {
268-
value: 'acr',
269-
label: 'Azure',
270-
desiredFormat: '(desired format: repo-name)',
271-
placeholderText: 'Eg. repo_name',
272-
gettingStartedLink:
273-
'https://docs.microsoft.com/en-us/azure/container-registry/container-registry-get-started-portal',
274-
defaultRegistryURL: '',
275-
registryURL: {
276-
label: 'Registry URL/Login Server',
277-
defaultValue: '',
278-
placeholder: 'Eg. xxx.azurecr.io',
279-
},
280-
id: {
281-
label: 'Username/Registry Name',
282-
defaultValue: '',
283-
placeholder: '',
284-
},
285-
password: {
286-
label: 'Password',
287-
defaultValue: '',
288-
placeholder: '',
289-
},
290-
startIcon: getContainerRegistryIcon(RegistryType.ACR),
291-
},
292-
'artifact-registry': {
293-
value: 'artifact-registry',
294-
label: 'Artifact Registry (GCP)',
295-
desiredFormat: '(desired format: project-id/artifacts-repo/repo-name)',
296-
placeholderText: 'Eg. project-id/artifacts-repo/repo-name',
297-
gettingStartedLink: 'https://cloud.google.com/artifact-registry/docs/manage-repos?hl=en_US',
298-
defaultRegistryURL: '',
299-
registryURL: {
300-
label: 'Registry URL',
301-
defaultValue: '',
302-
placeholder: 'Eg. region-docker.pkg.dev',
303-
},
304-
id: {
305-
label: 'Username',
306-
defaultValue: '_json_key',
307-
placeholder: '',
308-
},
309-
password: {
310-
label: 'Service Account JSON File',
311-
defaultValue: '',
312-
placeholder: 'Paste json file content here',
313-
},
314-
startIcon: getContainerRegistryIcon(RegistryType.ARTIFACT_REGISTRY),
315-
},
316-
gcr: {
317-
value: 'gcr',
318-
label: 'GCR',
319-
desiredFormat: '(desired format: project-id/repo-name)',
320-
placeholderText: 'Eg. project-id/repo_name',
321-
gettingStartedLink: 'https://cloud.google.com/container-registry/docs/quickstart',
322-
defaultRegistryURL: 'gcr.io',
323-
registryURL: {
324-
label: 'Registry URL',
325-
defaultValue: 'gcr.io',
326-
placeholder: '',
327-
},
328-
id: {
329-
label: 'Username',
330-
defaultValue: '_json_key',
331-
placeholder: '',
332-
},
333-
password: {
334-
label: 'Service Account JSON File',
335-
defaultValue: '',
336-
placeholder: 'Paste json file content here',
337-
},
338-
startIcon: getContainerRegistryIcon(RegistryType.GCR),
339-
},
340-
quay: {
341-
value: 'quay',
342-
label: 'Quay',
343-
desiredFormat: '(desired format: username/repo-name)',
344-
placeholderText: 'Eg. username/repo_name',
345-
gettingStartedLink: '',
346-
defaultRegistryURL: 'quay.io',
347-
registryURL: {
348-
label: 'Registry URL',
349-
defaultValue: '',
350-
placeholder: '',
351-
},
352-
id: {
353-
label: 'Username',
354-
defaultValue: '',
355-
placeholder: '',
356-
},
357-
password: {
358-
label: 'Token',
359-
defaultValue: '',
360-
placeholder: '',
361-
},
362-
startIcon: getContainerRegistryIcon(RegistryType.QUAY),
363-
},
364-
other: {
365-
value: 'other',
366-
label: 'Other',
367-
desiredFormat: '',
368-
placeholderText: '',
369-
gettingStartedLink: '',
370-
defaultRegistryURL: '',
371-
registryURL: {
372-
label: 'Registry URL',
373-
defaultValue: '',
374-
placeholder: '',
375-
},
376-
id: {
377-
label: 'Username',
378-
defaultValue: '',
379-
placeholder: '',
380-
},
381-
password: {
382-
label: 'Password/Token',
383-
defaultValue: '',
384-
placeholder: '',
385-
},
386-
startIcon: getContainerRegistryIcon(RegistryType.OTHER),
387-
},
388-
}
389-
390214
export const RepositoryAction = {
391215
CONTAINER: 'CONTAINER',
392216
CHART_PULL: 'CHART_PULL',

src/Common/utils.tsx

Lines changed: 0 additions & 20 deletions
This file was deleted.
Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
import { RegistryTypeDetailType } from '@Common/Types'
2+
import { RegistryType } from '@Shared/types'
3+
import { RegistryIcon } from './RegistryIcon'
4+
5+
export const REGISTRY_TYPE_MAP: Record<string, RegistryTypeDetailType> = {
6+
ecr: {
7+
value: 'ecr',
8+
label: 'ECR',
9+
desiredFormat: '(desired format: repo-name)',
10+
placeholderText: 'Eg. repo_name',
11+
gettingStartedLink: 'https://docs.aws.amazon.com/AmazonECR/latest/userguide/get-set-up-for-amazon-ecr.html',
12+
defaultRegistryURL: '',
13+
registryURL: {
14+
label: 'Registry URL',
15+
defaultValue: '',
16+
placeholder: 'Eg. xxxxxxxxxxxx.dkr.ecr.region.amazonaws.com',
17+
},
18+
id: {
19+
label: 'Access key ID',
20+
defaultValue: '',
21+
placeholder: '',
22+
},
23+
password: {
24+
label: 'Secret access key',
25+
defaultValue: '',
26+
placeholder: '',
27+
},
28+
startIcon: <RegistryIcon registryType={RegistryType.ECR} />,
29+
},
30+
'docker-hub': {
31+
value: 'docker-hub',
32+
label: 'Docker',
33+
desiredFormat: '(desired format: username/repo-name)',
34+
placeholderText: 'Eg. username/repo_name',
35+
gettingStartedLink: 'https://docs.docker.com/docker-hub/',
36+
defaultRegistryURL: 'docker.io',
37+
registryURL: {
38+
label: 'Registry URL',
39+
defaultValue: '',
40+
placeholder: '',
41+
},
42+
id: {
43+
label: 'Username',
44+
defaultValue: '',
45+
placeholder: '',
46+
},
47+
password: {
48+
label: 'Password/Token (Recommended: Token)',
49+
defaultValue: '',
50+
placeholder: '',
51+
},
52+
startIcon: <RegistryIcon registryType={RegistryType.DOCKER_HUB} />,
53+
},
54+
acr: {
55+
value: 'acr',
56+
label: 'Azure',
57+
desiredFormat: '(desired format: repo-name)',
58+
placeholderText: 'Eg. repo_name',
59+
gettingStartedLink:
60+
'https://docs.microsoft.com/en-us/azure/container-registry/container-registry-get-started-portal',
61+
defaultRegistryURL: '',
62+
registryURL: {
63+
label: 'Registry URL/Login Server',
64+
defaultValue: '',
65+
placeholder: 'Eg. xxx.azurecr.io',
66+
},
67+
id: {
68+
label: 'Username/Registry Name',
69+
defaultValue: '',
70+
placeholder: '',
71+
},
72+
password: {
73+
label: 'Password',
74+
defaultValue: '',
75+
placeholder: '',
76+
},
77+
startIcon: <RegistryIcon registryType={RegistryType.ACR} />,
78+
},
79+
'artifact-registry': {
80+
value: 'artifact-registry',
81+
label: 'Artifact Registry (GCP)',
82+
desiredFormat: '(desired format: project-id/artifacts-repo/repo-name)',
83+
placeholderText: 'Eg. project-id/artifacts-repo/repo-name',
84+
gettingStartedLink: 'https://cloud.google.com/artifact-registry/docs/manage-repos?hl=en_US',
85+
defaultRegistryURL: '',
86+
registryURL: {
87+
label: 'Registry URL',
88+
defaultValue: '',
89+
placeholder: 'Eg. region-docker.pkg.dev',
90+
},
91+
id: {
92+
label: 'Username',
93+
defaultValue: '_json_key',
94+
placeholder: '',
95+
},
96+
password: {
97+
label: 'Service Account JSON File',
98+
defaultValue: '',
99+
placeholder: 'Paste json file content here',
100+
},
101+
startIcon: <RegistryIcon registryType={RegistryType.ARTIFACT_REGISTRY} />,
102+
},
103+
gcr: {
104+
value: 'gcr',
105+
label: 'GCR',
106+
desiredFormat: '(desired format: project-id/repo-name)',
107+
placeholderText: 'Eg. project-id/repo_name',
108+
gettingStartedLink: 'https://cloud.google.com/container-registry/docs/quickstart',
109+
defaultRegistryURL: 'gcr.io',
110+
registryURL: {
111+
label: 'Registry URL',
112+
defaultValue: 'gcr.io',
113+
placeholder: '',
114+
},
115+
id: {
116+
label: 'Username',
117+
defaultValue: '_json_key',
118+
placeholder: '',
119+
},
120+
password: {
121+
label: 'Service Account JSON File',
122+
defaultValue: '',
123+
placeholder: 'Paste json file content here',
124+
},
125+
startIcon: <RegistryIcon registryType={RegistryType.GCR} />,
126+
},
127+
quay: {
128+
value: 'quay',
129+
label: 'Quay',
130+
desiredFormat: '(desired format: username/repo-name)',
131+
placeholderText: 'Eg. username/repo_name',
132+
gettingStartedLink: '',
133+
defaultRegistryURL: 'quay.io',
134+
registryURL: {
135+
label: 'Registry URL',
136+
defaultValue: '',
137+
placeholder: '',
138+
},
139+
id: {
140+
label: 'Username',
141+
defaultValue: '',
142+
placeholder: '',
143+
},
144+
password: {
145+
label: 'Token',
146+
defaultValue: '',
147+
placeholder: '',
148+
},
149+
startIcon: <RegistryIcon registryType={RegistryType.QUAY} />,
150+
},
151+
other: {
152+
value: 'other',
153+
label: 'Other',
154+
desiredFormat: '',
155+
placeholderText: '',
156+
gettingStartedLink: '',
157+
defaultRegistryURL: '',
158+
registryURL: {
159+
label: 'Registry URL',
160+
defaultValue: '',
161+
placeholder: '',
162+
},
163+
id: {
164+
label: 'Username',
165+
defaultValue: '',
166+
placeholder: '',
167+
},
168+
password: {
169+
label: 'Password/Token',
170+
defaultValue: '',
171+
placeholder: '',
172+
},
173+
startIcon: <RegistryIcon registryType={RegistryType.OTHER} />,
174+
},
175+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
export * from './RegistryIcon'
2+
export * from './constants'

0 commit comments

Comments
 (0)