Skip to content

Commit

Permalink
fix(registry): add project_id field for scaleway (#1709)
Browse files Browse the repository at this point in the history
* fix(container-registry): add project_id field for scaleway

* fix: add helm-repository update
  • Loading branch information
RemiBonnet authored Oct 8, 2024
1 parent d3ceaa9 commit 3a551b3
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export function ContainerRegistryCreateEditModal({
region: registry?.config?.region,
access_key_id: registry?.config?.access_key_id,
secret_access_key: undefined,
scaleway_project_id: registry?.config?.scaleway_project_id,
scaleway_access_key: registry?.config?.scaleway_access_key,
scaleway_secret_key: undefined,
json_credentials: undefined,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('ContainerRegistryForm', () => {
},
{
kind: 'SCALEWAY_CR',
required_config: ['region', 'scaleway_access_key', 'scaleway_secret_key'],
required_config: ['region', 'scaleway_access_key', 'scaleway_project_id', 'scaleway_secret_key'],
is_mandatory: true,
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,22 @@ export function ContainerRegistryForm({
)}
{watchKind === ContainerRegistryKindEnum.SCALEWAY_CR && (
<>
<Controller
name="config.scaleway_project_id"
control={methods.control}
rules={{
required: 'Please enter a Scaleway project id.',
}}
render={({ field, fieldState: { error } }) => (
<InputText
name={field.name}
onChange={field.onChange}
value={field.value}
label="Project ID"
error={error?.message}
/>
)}
/>
<Controller
name="config.scaleway_access_key"
control={methods.control}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe('HelmRepositoryCreateEditModal', () => {
},
{
kind: 'OCI_SCALEWAY_CR',
required_config: ['region', 'scaleway_access_key', 'scaleway_secret_key'],
required_config: ['region', 'scaleway_project_id', 'scaleway_access_key', 'scaleway_secret_key'],
is_mandatory: true,
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export function HelmRepositoryCreateEditModal({
password: undefined,
region: repository?.config?.region,
access_key_id: repository?.config?.access_key_id,
scaleway_project_id: repository?.config?.scaleway_project_id,
scaleway_access_key: repository?.config?.scaleway_access_key,
scaleway_secret_key: undefined,
secret_access_key: undefined,
Expand Down Expand Up @@ -355,6 +356,22 @@ export function HelmRepositoryCreateEditModal({
/>
)}
/>
<Controller
name="config.scaleway_project_id"
control={methods.control}
rules={{
required: 'Please enter a Scaleway project id.',
}}
render={({ field, fieldState: { error } }) => (
<InputText
name={field.name}
onChange={field.onChange}
value={field.value}
label="Project ID"
error={error?.message}
/>
)}
/>
<Controller
name="config.scaleway_access_key"
control={methods.control}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import {
ContainerMainCallsApi,
type ContainerRequest,
ContainersApi,
CustomDomainApi,
type CustomDomainRequest,
DatabaseActionsApi,
DatabaseDeploymentHistoryApi,
Expand Down Expand Up @@ -106,7 +105,6 @@ const containerConfigurationApi = new ContainerConfigurationApi()
const helmConfigurationApi = new HelmConfigurationApi()
const jobConfigurationApi = new JobConfigurationApi()

const customDomainApi = new CustomDomainApi()
const customDomainApplicationApi = new ApplicationCustomDomainApi()
const customDomainContainerApi = new ContainerCustomDomainApi()
const customDomainHelmApi = new HelmCustomDomainApi()
Expand Down Expand Up @@ -482,11 +480,11 @@ export const services = createQueryKeys('services', {
serviceType,
}))
.with('CONTAINER', (serviceType) => ({
query: customDomainApi.checkContainerCustomDomain.bind(customDomainApi),
query: customDomainContainerApi.checkContainerCustomDomain.bind(customDomainContainerApi),
serviceType,
}))
.with('HELM', (serviceType) => ({
query: customDomainApi.checkHelmCustomDomain.bind(customDomainApi),
query: customDomainHelmApi.checkHelmCustomDomain.bind(customDomainHelmApi),
serviceType,
}))
.exhaustive()
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"jwt-decode": "^4.0.0",
"monaco-editor": "^0.44.0",
"posthog-js": "^1.131.4",
"qovery-typescript-axios": "^1.1.483",
"qovery-typescript-axios": "^1.1.487",
"react": "18.3.1",
"react-country-flag": "^3.0.2",
"react-datepicker": "^4.12.0",
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4124,7 +4124,7 @@ __metadata:
prettier: ^3.2.5
prettier-plugin-tailwindcss: ^0.5.14
pretty-quick: ^4.0.0
qovery-typescript-axios: ^1.1.483
qovery-typescript-axios: ^1.1.487
qovery-ws-typescript-axios: ^0.1.153
react: 18.3.1
react-country-flag: ^3.0.2
Expand Down Expand Up @@ -19426,12 +19426,12 @@ __metadata:
languageName: node
linkType: hard

"qovery-typescript-axios@npm:^1.1.483":
version: 1.1.483
resolution: "qovery-typescript-axios@npm:1.1.483"
"qovery-typescript-axios@npm:^1.1.487":
version: 1.1.487
resolution: "qovery-typescript-axios@npm:1.1.487"
dependencies:
axios: ^0.27.2
checksum: f8503bb282e1de17bd86f6d5b5d7bf0b82ecefa1a3d8a66bb0b57c5f8d262e887d7abb7f59596e09bf036c1227f7233a00b32c2f8fdec87f13a653d76239f274
checksum: c3c8a5a38e81664e68fe4638f9104a97b6b751946a4fd1c99267df829d7c2a0adfc9b999dafc828d0b770145ed8ce39452a60acb31bf507cb96f642afe99bc20
languageName: node
linkType: hard

Expand Down

0 comments on commit 3a551b3

Please sign in to comment.