diff --git a/.github/workflows/generate-clients.yaml b/.github/workflows/generate-clients.yaml index cd6b38a9..49b29548 100644 --- a/.github/workflows/generate-clients.yaml +++ b/.github/workflows/generate-clients.yaml @@ -18,7 +18,7 @@ jobs: matrix: include: - language: go - version: 6.0.1 + version: 7.0.1 target-branch: master deploy-ssh-key: SSH_DEPLOY_KEY_GO deploy-ssh-key-ws: SSH_DEPLOY_KEY_WS_GO diff --git a/src/schemas/ContainerResponse.yaml b/src/schemas/ContainerResponse.yaml index 67da99e4..27ae6fa4 100644 --- a/src/schemas/ContainerResponse.yaml +++ b/src/schemas/ContainerResponse.yaml @@ -1,13 +1,11 @@ allOf: - $ref: './BaseResponse.yaml' - $ref: './ServiceStorageResponse.yaml' + - $ref: './ContainerSource.yaml' - type: object required: - environment - - registry - name - - image_name - - tag - auto_preview - cpu - memory @@ -19,8 +17,6 @@ allOf: properties: environment: $ref: './ReferenceObject.yaml' - registry: - $ref: './ContainerRegistryProviderDetailsResponse.yaml' maximum_cpu: type: integer description: Maximum cpu that can be allocated to the container based on organization cluster configuration. unit is millicores (m). 1000m = 1 cpu @@ -35,12 +31,6 @@ allOf: description: type: string description: give a description to this container - image_name: - type: string - description: name of the image container - tag: - type: string - description: tag of the image container arguments: type: array items: diff --git a/src/schemas/ContainerSource.yaml b/src/schemas/ContainerSource.yaml new file mode 100644 index 00000000..73b00bcb --- /dev/null +++ b/src/schemas/ContainerSource.yaml @@ -0,0 +1,22 @@ +type: object +required: + - image_name + - tag + - registry +properties: + image_name: + type: string + description: | + The image name pattern differs according to chosen container registry provider: + * `ECR`: `repository` + * `SCALEWAY_CR`: `namespace/image` + * `DOCKER_HUB`: `image` or `repository/image` + * `PUBLIC_ECR`: `registry_alias/repository` + tag: + type: string + description: tag of the image container + registry_id: + type: string + description: tag of the image container + registry: + $ref: "./ContainerRegistryProviderDetailsResponse.yaml" diff --git a/src/schemas/_index.yaml b/src/schemas/_index.yaml index 299125d3..e19e3228 100644 --- a/src/schemas/_index.yaml +++ b/src/schemas/_index.yaml @@ -356,6 +356,12 @@ GitRepositoryBranchResponseList: $ref: ./GitRepositoryBranchResponseList.yaml GitRepositoryResponseList: $ref: ./GitRepositoryResponseList.yaml +SourceDocker: + $ref: ./job/SourceDocker.yaml +ContainerSource: + $ref: ./ContainerSource.yaml +SourceImage: + $ref: ./job/SourceImage.yaml Healthcheck: $ref: ./Healthcheck.yaml Instance: diff --git a/src/schemas/job/JobResponse.yaml b/src/schemas/job/JobResponse.yaml index fe810320..b8e3fb92 100644 --- a/src/schemas/job/JobResponse.yaml +++ b/src/schemas/job/JobResponse.yaml @@ -13,6 +13,7 @@ allOf: - maximum_cpu - maximum_memory - healthchecks + - source properties: environment: $ref: '../ReferenceObject.yaml' @@ -61,43 +62,10 @@ allOf: description: Port where to run readiness and liveliness probes checks. The port will not be exposed externally default: null source: - type: object - properties: - image: - type: object - nullable: true - required: - - image_name - - tag - - registry_id - - registry - properties: - image_name: - type: string - description: | - The image name pattern differs according to chosen container registry provider: - * `ECR`: `repository` - * `SCALEWAY_CR`: `namespace/image` - * `DOCKER_HUB`: `image` or `repository/image` - * `PUBLIC_ECR`: `registry_alias/repository` - tag: - type: string - description: tag of the image container - registry_id: - type: string - description: tag of the image container - registry: - $ref: '../ContainerRegistryProviderDetailsResponse.yaml' - docker: - type: object - nullable: true - properties: - dockerfile_path: - type: string - description: The path of the associated Dockerfile. Only if you are using build_mode = DOCKER - nullable: true - git_repository: - $ref: '../ApplicationGitRepositoryResponse.yaml' + oneOf: + - $ref: './SourceImage.yaml' + - $ref: './SourceDocker.yaml' + nullable: false healthchecks: $ref: '../Healthcheck.yaml' schedule: diff --git a/src/schemas/job/SourceDocker.yaml b/src/schemas/job/SourceDocker.yaml new file mode 100644 index 00000000..f716e455 --- /dev/null +++ b/src/schemas/job/SourceDocker.yaml @@ -0,0 +1,11 @@ +type: object +properties: + docker: + type: object + properties: + dockerfile_path: + type: string + description: The path of the associated Dockerfile. Only if you are using build_mode = DOCKER + nullable: true + git_repository: + $ref: '../ApplicationGitRepositoryResponse.yaml' \ No newline at end of file diff --git a/src/schemas/job/SourceImage.yaml b/src/schemas/job/SourceImage.yaml new file mode 100644 index 00000000..32b6accc --- /dev/null +++ b/src/schemas/job/SourceImage.yaml @@ -0,0 +1,4 @@ +type: object +properties: + image: + $ref: '../ContainerSource.yaml' \ No newline at end of file