From 1227010788858c9934e0901c0175ba7a9d72ac3b Mon Sep 17 00:00:00 2001 From: Maysun J Faisal Date: Mon, 9 Aug 2021 16:51:09 -0400 Subject: [PATCH 1/7] Add Image Comp, add Deploy Cmd Kind & handle conversion to v1alpha1 Signed-off-by: Maysun J Faisal --- ...pace.devfile.io_devworkspaces.v1beta1.yaml | 443 ++++++++++++ crds/workspace.devfile.io_devworkspaces.yaml | 443 ++++++++++++ ...file.io_devworkspacetemplates.v1beta1.yaml | 431 +++++++++++ ...pace.devfile.io_devworkspacetemplates.yaml | 431 +++++++++++ pkg/apis/workspaces/v1alpha1/conversion.go | 13 +- pkg/apis/workspaces/v1alpha2/commands.go | 11 +- .../workspaces/v1alpha2/component_image.go | 38 + .../v1alpha2/component_image_dockerfile.go | 68 ++ pkg/apis/workspaces/v1alpha2/components.go | 7 +- .../v1alpha2/zz_generated.deepcopy.go | 672 ++++++++++++++++++ .../v1alpha2/zz_generated.parent_overrides.go | 245 ++++++- .../v1alpha2/zz_generated.plugin_overrides.go | 138 +++- .../zz_generated.union_definitions.go | 172 +++++ .../latest/dev-workspace-template-spec.json | 473 +++++++++++- schemas/latest/dev-workspace-template.json | 473 +++++++++++- schemas/latest/dev-workspace.json | 473 +++++++++++- schemas/latest/devfile.json | 238 ++++++- .../dev-workspace-template-spec.json | 533 +++++++++++++- .../ide-targeted/dev-workspace-template.json | 533 +++++++++++++- .../latest/ide-targeted/dev-workspace.json | 533 +++++++++++++- schemas/latest/ide-targeted/devfile.json | 268 ++++++- .../latest/ide-targeted/parent-overrides.json | 262 ++++++- .../latest/ide-targeted/plugin-overrides.json | 131 +++- schemas/latest/parent-overrides.json | 232 +++++- schemas/latest/plugin-overrides.json | 116 ++- 25 files changed, 7252 insertions(+), 125 deletions(-) create mode 100644 pkg/apis/workspaces/v1alpha2/component_image.go create mode 100644 pkg/apis/workspaces/v1alpha2/component_image_dockerfile.go diff --git a/crds/workspace.devfile.io_devworkspaces.v1beta1.yaml b/crds/workspace.devfile.io_devworkspaces.v1beta1.yaml index aeb71fad1..152ec4969 100644 --- a/crds/workspace.devfile.io_devworkspaces.v1beta1.yaml +++ b/crds/workspace.devfile.io_devworkspaces.v1beta1.yaml @@ -4187,6 +4187,7 @@ spec: - run - test - debug + - deploy type: string required: - kind @@ -4236,6 +4237,7 @@ spec: - run - test - debug + - deploy type: string required: - kind @@ -4281,6 +4283,7 @@ spec: - run - test - debug + - deploy type: string required: - kind @@ -4339,6 +4342,7 @@ spec: - run - test - debug + - deploy type: string required: - kind @@ -4392,6 +4396,8 @@ spec: - openshift - required: - volume + - required: + - image - required: - plugin - required: @@ -4409,6 +4415,7 @@ spec: - Kubernetes - Openshift - Volume + - Image - Plugin - Custom type: string @@ -4604,6 +4611,107 @@ spec: - componentClass - embeddedResource type: object + image: + description: Allows specifying the definition of an image + for outer loop builds + oneOf: + - required: + - dockerfile + properties: + dockerfile: + description: Allows specifying dockerfile type build + oneOf: + - required: + - uri + - required: + - id + - required: + - git + properties: + args: + description: The arguments to supply to the dockerfile + build. + items: + type: string + type: array + buildContext: + description: Path of source directory to establish + build context. Defaults to ${PROJECT_ROOT} in + the container + type: string + git: + description: Project's Git source + properties: + checkoutFrom: + description: Defines from what the project should + be checked out. Required if there are more + than one remote configured + properties: + remote: + description: The remote name should be used + as init. Required if there are more than + one remote configured + type: string + revision: + description: The revision to checkout from. + Should be branch name, tag or commit id. + Default branch is used if missing or specified + revision is not found. + type: string + type: object + remotes: + additionalProperties: + type: string + description: The remotes map which should be + initialized in the git project. Must have + at least one remote configured + type: object + required: + - remotes + type: object + gitLocation: + description: Location of the Dockerfile in the Git + repository when using git as Dockerfile src. + type: string + id: + description: Id in a registry that contains a Dockerfile + type: string + locationType: + description: Type of Dockerfile location + enum: + - Uri + - Id + - Git + type: string + registryUrl: + description: Registry URL to pull the Dockerfile + from when using id as Dockerfile src. To ensure + the dockerfile gets resolved consistently in different + environments, it is recommended to always specify + the `regsitryURL` when `Id` is used. + type: string + rootRequired: + description: "Specify if a privileged builder pod + is required. \n Default value is `false`" + type: boolean + uri: + description: URI Reference of a Dockerfile. It can + be a full URL or a relative URI from the current + devfile as the base URI. + type: string + type: object + imageName: + description: Name of the image for the resulting outerloop + build + type: string + imageType: + description: Type of image + enum: + - Dockerfile + type: string + required: + - imageName + type: object kubernetes: description: Allows importing into the devworkspace the Kubernetes resources defined in a given manifest. For @@ -4874,6 +4982,7 @@ spec: - run - test - debug + - deploy type: string type: object label: @@ -4921,6 +5030,7 @@ spec: - run - test - debug + - deploy type: string type: object label: @@ -4981,6 +5091,7 @@ spec: - run - test - debug + - deploy type: string type: object hotReloadCapable: @@ -5032,6 +5143,8 @@ spec: - openshift - required: - volume + - required: + - image properties: attributes: description: Map of implementation-dependant free-form @@ -5045,6 +5158,7 @@ spec: - Kubernetes - Openshift - Volume + - Image type: string container: description: Allows adding and configuring devworkspace-related @@ -5228,6 +5342,113 @@ spec: type: object type: array type: object + image: + description: Allows specifying the definition + of an image for outer loop builds + oneOf: + - required: + - dockerfile + properties: + dockerfile: + description: Allows specifying dockerfile + type build + oneOf: + - required: + - uri + - required: + - id + - required: + - git + properties: + args: + description: The arguments to supply to + the dockerfile build. + items: + type: string + type: array + buildContext: + description: Path of source directory + to establish build context. Defaults + to ${PROJECT_ROOT} in the container + type: string + git: + description: Project's Git source + properties: + checkoutFrom: + description: Defines from what the + project should be checked out. Required + if there are more than one remote + configured + properties: + remote: + description: The remote name should + be used as init. Required if + there are more than one remote + configured + type: string + revision: + description: The revision to checkout + from. Should be branch name, + tag or commit id. Default branch + is used if missing or specified + revision is not found. + type: string + type: object + remotes: + additionalProperties: + type: string + description: The remotes map which + should be initialized in the git + project. Must have at least one + remote configured + type: object + type: object + gitLocation: + description: Location of the Dockerfile + in the Git repository when using git + as Dockerfile src. + type: string + id: + description: Id in a registry that contains + a Dockerfile + type: string + locationType: + description: Type of Dockerfile location + enum: + - Uri + - Id + - Git + type: string + registryUrl: + description: Registry URL to pull the + Dockerfile from when using id as Dockerfile + src. To ensure the dockerfile gets resolved + consistently in different environments, + it is recommended to always specify + the `regsitryURL` when `Id` is used. + type: string + rootRequired: + description: "Specify if a privileged + builder pod is required. \n Default + value is `false`" + type: boolean + uri: + description: URI Reference of a Dockerfile. + It can be a full URL or a relative URI + from the current devfile as the base + URI. + type: string + type: object + imageName: + description: Name of the image for the resulting + outerloop build + type: string + imageType: + description: Type of image + enum: + - Dockerfile + type: string + type: object kubernetes: description: Allows importing into the devworkspace the Kubernetes resources defined in a given @@ -5623,6 +5844,7 @@ spec: - run - test - debug + - deploy type: string type: object label: @@ -5669,6 +5891,7 @@ spec: - run - test - debug + - deploy type: string type: object label: @@ -5728,6 +5951,7 @@ spec: - run - test - debug + - deploy type: string type: object hotReloadCapable: @@ -5778,6 +6002,8 @@ spec: - openshift - required: - volume + - required: + - image - required: - plugin properties: @@ -5793,6 +6019,7 @@ spec: - Kubernetes - Openshift - Volume + - Image - Plugin type: string container: @@ -5968,6 +6195,107 @@ spec: type: object type: array type: object + image: + description: Allows specifying the definition of an + image for outer loop builds + oneOf: + - required: + - dockerfile + properties: + dockerfile: + description: Allows specifying dockerfile type build + oneOf: + - required: + - uri + - required: + - id + - required: + - git + properties: + args: + description: The arguments to supply to the + dockerfile build. + items: + type: string + type: array + buildContext: + description: Path of source directory to establish + build context. Defaults to ${PROJECT_ROOT} + in the container + type: string + git: + description: Project's Git source + properties: + checkoutFrom: + description: Defines from what the project + should be checked out. Required if there + are more than one remote configured + properties: + remote: + description: The remote name should + be used as init. Required if there + are more than one remote configured + type: string + revision: + description: The revision to checkout + from. Should be branch name, tag or + commit id. Default branch is used + if missing or specified revision is + not found. + type: string + type: object + remotes: + additionalProperties: + type: string + description: The remotes map which should + be initialized in the git project. Must + have at least one remote configured + type: object + type: object + gitLocation: + description: Location of the Dockerfile in the + Git repository when using git as Dockerfile + src. + type: string + id: + description: Id in a registry that contains + a Dockerfile + type: string + locationType: + description: Type of Dockerfile location + enum: + - Uri + - Id + - Git + type: string + registryUrl: + description: Registry URL to pull the Dockerfile + from when using id as Dockerfile src. To ensure + the dockerfile gets resolved consistently + in different environments, it is recommended + to always specify the `regsitryURL` when `Id` + is used. + type: string + rootRequired: + description: "Specify if a privileged builder + pod is required. \n Default value is `false`" + type: boolean + uri: + description: URI Reference of a Dockerfile. + It can be a full URL or a relative URI from + the current devfile as the base URI. + type: string + type: object + imageName: + description: Name of the image for the resulting + outerloop build + type: string + imageType: + description: Type of image + enum: + - Dockerfile + type: string + type: object kubernetes: description: Allows importing into the devworkspace the Kubernetes resources defined in a given manifest. @@ -6244,6 +6572,7 @@ spec: - run - test - debug + - deploy type: string type: object label: @@ -6291,6 +6620,7 @@ spec: - run - test - debug + - deploy type: string type: object label: @@ -6353,6 +6683,7 @@ spec: - run - test - debug + - deploy type: string type: object hotReloadCapable: @@ -6407,6 +6738,8 @@ spec: - openshift - required: - volume + - required: + - image properties: attributes: description: Map of implementation-dependant @@ -6420,6 +6753,7 @@ spec: - Kubernetes - Openshift - Volume + - Image type: string container: description: Allows adding and configuring @@ -6615,6 +6949,115 @@ spec: type: object type: array type: object + image: + description: Allows specifying the definition + of an image for outer loop builds + oneOf: + - required: + - dockerfile + properties: + dockerfile: + description: Allows specifying dockerfile + type build + oneOf: + - required: + - uri + - required: + - id + - required: + - git + properties: + args: + description: The arguments to supply + to the dockerfile build. + items: + type: string + type: array + buildContext: + description: Path of source directory + to establish build context. Defaults + to ${PROJECT_ROOT} in the container + type: string + git: + description: Project's Git source + properties: + checkoutFrom: + description: Defines from what + the project should be checked + out. Required if there are more + than one remote configured + properties: + remote: + description: The remote name + should be used as init. + Required if there are more + than one remote configured + type: string + revision: + description: The revision + to checkout from. Should + be branch name, tag or commit + id. Default branch is used + if missing or specified + revision is not found. + type: string + type: object + remotes: + additionalProperties: + type: string + description: The remotes map which + should be initialized in the + git project. Must have at least + one remote configured + type: object + type: object + gitLocation: + description: Location of the Dockerfile + in the Git repository when using + git as Dockerfile src. + type: string + id: + description: Id in a registry that + contains a Dockerfile + type: string + locationType: + description: Type of Dockerfile location + enum: + - Uri + - Id + - Git + type: string + registryUrl: + description: Registry URL to pull + the Dockerfile from when using id + as Dockerfile src. To ensure the + dockerfile gets resolved consistently + in different environments, it is + recommended to always specify the + `regsitryURL` when `Id` is used. + type: string + rootRequired: + description: "Specify if a privileged + builder pod is required. \n Default + value is `false`" + type: boolean + uri: + description: URI Reference of a Dockerfile. + It can be a full URL or a relative + URI from the current devfile as + the base URI. + type: string + type: object + imageName: + description: Name of the image for the + resulting outerloop build + type: string + imageType: + description: Type of image + enum: + - Dockerfile + type: string + type: object kubernetes: description: Allows importing into the devworkspace the Kubernetes resources defined in a given diff --git a/crds/workspace.devfile.io_devworkspaces.yaml b/crds/workspace.devfile.io_devworkspaces.yaml index 55e1e5093..cf9583814 100644 --- a/crds/workspace.devfile.io_devworkspaces.yaml +++ b/crds/workspace.devfile.io_devworkspaces.yaml @@ -4185,6 +4185,7 @@ spec: - run - test - debug + - deploy type: string required: - kind @@ -4234,6 +4235,7 @@ spec: - run - test - debug + - deploy type: string required: - kind @@ -4279,6 +4281,7 @@ spec: - run - test - debug + - deploy type: string required: - kind @@ -4337,6 +4340,7 @@ spec: - run - test - debug + - deploy type: string required: - kind @@ -4390,6 +4394,8 @@ spec: - openshift - required: - volume + - required: + - image - required: - plugin - required: @@ -4407,6 +4413,7 @@ spec: - Kubernetes - Openshift - Volume + - Image - Plugin - Custom type: string @@ -4605,6 +4612,107 @@ spec: - componentClass - embeddedResource type: object + image: + description: Allows specifying the definition of an image + for outer loop builds + oneOf: + - required: + - dockerfile + properties: + dockerfile: + description: Allows specifying dockerfile type build + oneOf: + - required: + - uri + - required: + - id + - required: + - git + properties: + args: + description: The arguments to supply to the dockerfile + build. + items: + type: string + type: array + buildContext: + description: Path of source directory to establish + build context. Defaults to ${PROJECT_ROOT} in + the container + type: string + git: + description: Project's Git source + properties: + checkoutFrom: + description: Defines from what the project should + be checked out. Required if there are more + than one remote configured + properties: + remote: + description: The remote name should be used + as init. Required if there are more than + one remote configured + type: string + revision: + description: The revision to checkout from. + Should be branch name, tag or commit id. + Default branch is used if missing or specified + revision is not found. + type: string + type: object + remotes: + additionalProperties: + type: string + description: The remotes map which should be + initialized in the git project. Must have + at least one remote configured + type: object + required: + - remotes + type: object + gitLocation: + description: Location of the Dockerfile in the Git + repository when using git as Dockerfile src. + type: string + id: + description: Id in a registry that contains a Dockerfile + type: string + locationType: + description: Type of Dockerfile location + enum: + - Uri + - Id + - Git + type: string + registryUrl: + description: Registry URL to pull the Dockerfile + from when using id as Dockerfile src. To ensure + the dockerfile gets resolved consistently in different + environments, it is recommended to always specify + the `regsitryURL` when `Id` is used. + type: string + rootRequired: + description: "Specify if a privileged builder pod + is required. \n Default value is `false`" + type: boolean + uri: + description: URI Reference of a Dockerfile. It can + be a full URL or a relative URI from the current + devfile as the base URI. + type: string + type: object + imageName: + description: Name of the image for the resulting outerloop + build + type: string + imageType: + description: Type of image + enum: + - Dockerfile + type: string + required: + - imageName + type: object kubernetes: description: Allows importing into the devworkspace the Kubernetes resources defined in a given manifest. For @@ -4879,6 +4987,7 @@ spec: - run - test - debug + - deploy type: string type: object label: @@ -4926,6 +5035,7 @@ spec: - run - test - debug + - deploy type: string type: object label: @@ -4986,6 +5096,7 @@ spec: - run - test - debug + - deploy type: string type: object hotReloadCapable: @@ -5037,6 +5148,8 @@ spec: - openshift - required: - volume + - required: + - image properties: attributes: description: Map of implementation-dependant free-form @@ -5050,6 +5163,7 @@ spec: - Kubernetes - Openshift - Volume + - Image type: string container: description: Allows adding and configuring devworkspace-related @@ -5233,6 +5347,113 @@ spec: type: object type: array type: object + image: + description: Allows specifying the definition + of an image for outer loop builds + oneOf: + - required: + - dockerfile + properties: + dockerfile: + description: Allows specifying dockerfile + type build + oneOf: + - required: + - uri + - required: + - id + - required: + - git + properties: + args: + description: The arguments to supply to + the dockerfile build. + items: + type: string + type: array + buildContext: + description: Path of source directory + to establish build context. Defaults + to ${PROJECT_ROOT} in the container + type: string + git: + description: Project's Git source + properties: + checkoutFrom: + description: Defines from what the + project should be checked out. Required + if there are more than one remote + configured + properties: + remote: + description: The remote name should + be used as init. Required if + there are more than one remote + configured + type: string + revision: + description: The revision to checkout + from. Should be branch name, + tag or commit id. Default branch + is used if missing or specified + revision is not found. + type: string + type: object + remotes: + additionalProperties: + type: string + description: The remotes map which + should be initialized in the git + project. Must have at least one + remote configured + type: object + type: object + gitLocation: + description: Location of the Dockerfile + in the Git repository when using git + as Dockerfile src. + type: string + id: + description: Id in a registry that contains + a Dockerfile + type: string + locationType: + description: Type of Dockerfile location + enum: + - Uri + - Id + - Git + type: string + registryUrl: + description: Registry URL to pull the + Dockerfile from when using id as Dockerfile + src. To ensure the dockerfile gets resolved + consistently in different environments, + it is recommended to always specify + the `regsitryURL` when `Id` is used. + type: string + rootRequired: + description: "Specify if a privileged + builder pod is required. \n Default + value is `false`" + type: boolean + uri: + description: URI Reference of a Dockerfile. + It can be a full URL or a relative URI + from the current devfile as the base + URI. + type: string + type: object + imageName: + description: Name of the image for the resulting + outerloop build + type: string + imageType: + description: Type of image + enum: + - Dockerfile + type: string + type: object kubernetes: description: Allows importing into the devworkspace the Kubernetes resources defined in a given @@ -5628,6 +5849,7 @@ spec: - run - test - debug + - deploy type: string type: object label: @@ -5674,6 +5896,7 @@ spec: - run - test - debug + - deploy type: string type: object label: @@ -5733,6 +5956,7 @@ spec: - run - test - debug + - deploy type: string type: object hotReloadCapable: @@ -5783,6 +6007,8 @@ spec: - openshift - required: - volume + - required: + - image - required: - plugin properties: @@ -5798,6 +6024,7 @@ spec: - Kubernetes - Openshift - Volume + - Image - Plugin type: string container: @@ -5973,6 +6200,107 @@ spec: type: object type: array type: object + image: + description: Allows specifying the definition of an + image for outer loop builds + oneOf: + - required: + - dockerfile + properties: + dockerfile: + description: Allows specifying dockerfile type build + oneOf: + - required: + - uri + - required: + - id + - required: + - git + properties: + args: + description: The arguments to supply to the + dockerfile build. + items: + type: string + type: array + buildContext: + description: Path of source directory to establish + build context. Defaults to ${PROJECT_ROOT} + in the container + type: string + git: + description: Project's Git source + properties: + checkoutFrom: + description: Defines from what the project + should be checked out. Required if there + are more than one remote configured + properties: + remote: + description: The remote name should + be used as init. Required if there + are more than one remote configured + type: string + revision: + description: The revision to checkout + from. Should be branch name, tag or + commit id. Default branch is used + if missing or specified revision is + not found. + type: string + type: object + remotes: + additionalProperties: + type: string + description: The remotes map which should + be initialized in the git project. Must + have at least one remote configured + type: object + type: object + gitLocation: + description: Location of the Dockerfile in the + Git repository when using git as Dockerfile + src. + type: string + id: + description: Id in a registry that contains + a Dockerfile + type: string + locationType: + description: Type of Dockerfile location + enum: + - Uri + - Id + - Git + type: string + registryUrl: + description: Registry URL to pull the Dockerfile + from when using id as Dockerfile src. To ensure + the dockerfile gets resolved consistently + in different environments, it is recommended + to always specify the `regsitryURL` when `Id` + is used. + type: string + rootRequired: + description: "Specify if a privileged builder + pod is required. \n Default value is `false`" + type: boolean + uri: + description: URI Reference of a Dockerfile. + It can be a full URL or a relative URI from + the current devfile as the base URI. + type: string + type: object + imageName: + description: Name of the image for the resulting + outerloop build + type: string + imageType: + description: Type of image + enum: + - Dockerfile + type: string + type: object kubernetes: description: Allows importing into the devworkspace the Kubernetes resources defined in a given manifest. @@ -6249,6 +6577,7 @@ spec: - run - test - debug + - deploy type: string type: object label: @@ -6296,6 +6625,7 @@ spec: - run - test - debug + - deploy type: string type: object label: @@ -6358,6 +6688,7 @@ spec: - run - test - debug + - deploy type: string type: object hotReloadCapable: @@ -6412,6 +6743,8 @@ spec: - openshift - required: - volume + - required: + - image properties: attributes: description: Map of implementation-dependant @@ -6425,6 +6758,7 @@ spec: - Kubernetes - Openshift - Volume + - Image type: string container: description: Allows adding and configuring @@ -6620,6 +6954,115 @@ spec: type: object type: array type: object + image: + description: Allows specifying the definition + of an image for outer loop builds + oneOf: + - required: + - dockerfile + properties: + dockerfile: + description: Allows specifying dockerfile + type build + oneOf: + - required: + - uri + - required: + - id + - required: + - git + properties: + args: + description: The arguments to supply + to the dockerfile build. + items: + type: string + type: array + buildContext: + description: Path of source directory + to establish build context. Defaults + to ${PROJECT_ROOT} in the container + type: string + git: + description: Project's Git source + properties: + checkoutFrom: + description: Defines from what + the project should be checked + out. Required if there are more + than one remote configured + properties: + remote: + description: The remote name + should be used as init. + Required if there are more + than one remote configured + type: string + revision: + description: The revision + to checkout from. Should + be branch name, tag or commit + id. Default branch is used + if missing or specified + revision is not found. + type: string + type: object + remotes: + additionalProperties: + type: string + description: The remotes map which + should be initialized in the + git project. Must have at least + one remote configured + type: object + type: object + gitLocation: + description: Location of the Dockerfile + in the Git repository when using + git as Dockerfile src. + type: string + id: + description: Id in a registry that + contains a Dockerfile + type: string + locationType: + description: Type of Dockerfile location + enum: + - Uri + - Id + - Git + type: string + registryUrl: + description: Registry URL to pull + the Dockerfile from when using id + as Dockerfile src. To ensure the + dockerfile gets resolved consistently + in different environments, it is + recommended to always specify the + `regsitryURL` when `Id` is used. + type: string + rootRequired: + description: "Specify if a privileged + builder pod is required. \n Default + value is `false`" + type: boolean + uri: + description: URI Reference of a Dockerfile. + It can be a full URL or a relative + URI from the current devfile as + the base URI. + type: string + type: object + imageName: + description: Name of the image for the + resulting outerloop build + type: string + imageType: + description: Type of image + enum: + - Dockerfile + type: string + type: object kubernetes: description: Allows importing into the devworkspace the Kubernetes resources defined in a given diff --git a/crds/workspace.devfile.io_devworkspacetemplates.v1beta1.yaml b/crds/workspace.devfile.io_devworkspacetemplates.v1beta1.yaml index 66719ce21..ae3fd397d 100644 --- a/crds/workspace.devfile.io_devworkspacetemplates.v1beta1.yaml +++ b/crds/workspace.devfile.io_devworkspacetemplates.v1beta1.yaml @@ -3960,6 +3960,7 @@ spec: - run - test - debug + - deploy type: string required: - kind @@ -4007,6 +4008,7 @@ spec: - run - test - debug + - deploy type: string required: - kind @@ -4051,6 +4053,7 @@ spec: - run - test - debug + - deploy type: string required: - kind @@ -4106,6 +4109,7 @@ spec: - run - test - debug + - deploy type: string required: - kind @@ -4156,6 +4160,8 @@ spec: - openshift - required: - volume + - required: + - image - required: - plugin - required: @@ -4173,6 +4179,7 @@ spec: - Kubernetes - Openshift - Volume + - Image - Plugin - Custom type: string @@ -4361,6 +4368,106 @@ spec: - componentClass - embeddedResource type: object + image: + description: Allows specifying the definition of an image for + outer loop builds + oneOf: + - required: + - dockerfile + properties: + dockerfile: + description: Allows specifying dockerfile type build + oneOf: + - required: + - uri + - required: + - id + - required: + - git + properties: + args: + description: The arguments to supply to the dockerfile + build. + items: + type: string + type: array + buildContext: + description: Path of source directory to establish build + context. Defaults to ${PROJECT_ROOT} in the container + type: string + git: + description: Project's Git source + properties: + checkoutFrom: + description: Defines from what the project should + be checked out. Required if there are more than + one remote configured + properties: + remote: + description: The remote name should be used + as init. Required if there are more than one + remote configured + type: string + revision: + description: The revision to checkout from. + Should be branch name, tag or commit id. Default + branch is used if missing or specified revision + is not found. + type: string + type: object + remotes: + additionalProperties: + type: string + description: The remotes map which should be initialized + in the git project. Must have at least one remote + configured + type: object + required: + - remotes + type: object + gitLocation: + description: Location of the Dockerfile in the Git repository + when using git as Dockerfile src. + type: string + id: + description: Id in a registry that contains a Dockerfile + type: string + locationType: + description: Type of Dockerfile location + enum: + - Uri + - Id + - Git + type: string + registryUrl: + description: Registry URL to pull the Dockerfile from + when using id as Dockerfile src. To ensure the dockerfile + gets resolved consistently in different environments, + it is recommended to always specify the `regsitryURL` + when `Id` is used. + type: string + rootRequired: + description: "Specify if a privileged builder pod is + required. \n Default value is `false`" + type: boolean + uri: + description: URI Reference of a Dockerfile. It can be + a full URL or a relative URI from the current devfile + as the base URI. + type: string + type: object + imageName: + description: Name of the image for the resulting outerloop + build + type: string + imageType: + description: Type of image + enum: + - Dockerfile + type: string + required: + - imageName + type: object kubernetes: description: Allows importing into the devworkspace the Kubernetes resources defined in a given manifest. For example this allows @@ -4622,6 +4729,7 @@ spec: - run - test - debug + - deploy type: string type: object label: @@ -4668,6 +4776,7 @@ spec: - run - test - debug + - deploy type: string type: object label: @@ -4727,6 +4836,7 @@ spec: - run - test - debug + - deploy type: string type: object hotReloadCapable: @@ -4778,6 +4888,8 @@ spec: - openshift - required: - volume + - required: + - image properties: attributes: description: Map of implementation-dependant free-form @@ -4791,6 +4903,7 @@ spec: - Kubernetes - Openshift - Volume + - Image type: string container: description: Allows adding and configuring devworkspace-related @@ -4967,6 +5080,108 @@ spec: type: object type: array type: object + image: + description: Allows specifying the definition of an + image for outer loop builds + oneOf: + - required: + - dockerfile + properties: + dockerfile: + description: Allows specifying dockerfile type + build + oneOf: + - required: + - uri + - required: + - id + - required: + - git + properties: + args: + description: The arguments to supply to the + dockerfile build. + items: + type: string + type: array + buildContext: + description: Path of source directory to establish + build context. Defaults to ${PROJECT_ROOT} + in the container + type: string + git: + description: Project's Git source + properties: + checkoutFrom: + description: Defines from what the project + should be checked out. Required if there + are more than one remote configured + properties: + remote: + description: The remote name should + be used as init. Required if there + are more than one remote configured + type: string + revision: + description: The revision to checkout + from. Should be branch name, tag + or commit id. Default branch is + used if missing or specified revision + is not found. + type: string + type: object + remotes: + additionalProperties: + type: string + description: The remotes map which should + be initialized in the git project. Must + have at least one remote configured + type: object + type: object + gitLocation: + description: Location of the Dockerfile in + the Git repository when using git as Dockerfile + src. + type: string + id: + description: Id in a registry that contains + a Dockerfile + type: string + locationType: + description: Type of Dockerfile location + enum: + - Uri + - Id + - Git + type: string + registryUrl: + description: Registry URL to pull the Dockerfile + from when using id as Dockerfile src. To + ensure the dockerfile gets resolved consistently + in different environments, it is recommended + to always specify the `regsitryURL` when + `Id` is used. + type: string + rootRequired: + description: "Specify if a privileged builder + pod is required. \n Default value is `false`" + type: boolean + uri: + description: URI Reference of a Dockerfile. + It can be a full URL or a relative URI from + the current devfile as the base URI. + type: string + type: object + imageName: + description: Name of the image for the resulting + outerloop build + type: string + imageType: + description: Type of image + enum: + - Dockerfile + type: string + type: object kubernetes: description: Allows importing into the devworkspace the Kubernetes resources defined in a given manifest. @@ -5344,6 +5559,7 @@ spec: - run - test - debug + - deploy type: string type: object label: @@ -5388,6 +5604,7 @@ spec: - run - test - debug + - deploy type: string type: object label: @@ -5444,6 +5661,7 @@ spec: - run - test - debug + - deploy type: string type: object hotReloadCapable: @@ -5493,6 +5711,8 @@ spec: - openshift - required: - volume + - required: + - image - required: - plugin properties: @@ -5508,6 +5728,7 @@ spec: - Kubernetes - Openshift - Volume + - Image - Plugin type: string container: @@ -5677,6 +5898,103 @@ spec: type: object type: array type: object + image: + description: Allows specifying the definition of an image + for outer loop builds + oneOf: + - required: + - dockerfile + properties: + dockerfile: + description: Allows specifying dockerfile type build + oneOf: + - required: + - uri + - required: + - id + - required: + - git + properties: + args: + description: The arguments to supply to the dockerfile + build. + items: + type: string + type: array + buildContext: + description: Path of source directory to establish + build context. Defaults to ${PROJECT_ROOT} in + the container + type: string + git: + description: Project's Git source + properties: + checkoutFrom: + description: Defines from what the project should + be checked out. Required if there are more + than one remote configured + properties: + remote: + description: The remote name should be used + as init. Required if there are more than + one remote configured + type: string + revision: + description: The revision to checkout from. + Should be branch name, tag or commit id. + Default branch is used if missing or specified + revision is not found. + type: string + type: object + remotes: + additionalProperties: + type: string + description: The remotes map which should be + initialized in the git project. Must have + at least one remote configured + type: object + type: object + gitLocation: + description: Location of the Dockerfile in the Git + repository when using git as Dockerfile src. + type: string + id: + description: Id in a registry that contains a Dockerfile + type: string + locationType: + description: Type of Dockerfile location + enum: + - Uri + - Id + - Git + type: string + registryUrl: + description: Registry URL to pull the Dockerfile + from when using id as Dockerfile src. To ensure + the dockerfile gets resolved consistently in different + environments, it is recommended to always specify + the `regsitryURL` when `Id` is used. + type: string + rootRequired: + description: "Specify if a privileged builder pod + is required. \n Default value is `false`" + type: boolean + uri: + description: URI Reference of a Dockerfile. It can + be a full URL or a relative URI from the current + devfile as the base URI. + type: string + type: object + imageName: + description: Name of the image for the resulting outerloop + build + type: string + imageType: + description: Type of image + enum: + - Dockerfile + type: string + type: object kubernetes: description: Allows importing into the devworkspace the Kubernetes resources defined in a given manifest. For @@ -5945,6 +6263,7 @@ spec: - run - test - debug + - deploy type: string type: object label: @@ -5992,6 +6311,7 @@ spec: - run - test - debug + - deploy type: string type: object label: @@ -6052,6 +6372,7 @@ spec: - run - test - debug + - deploy type: string type: object hotReloadCapable: @@ -6103,6 +6424,8 @@ spec: - openshift - required: - volume + - required: + - image properties: attributes: description: Map of implementation-dependant free-form @@ -6116,6 +6439,7 @@ spec: - Kubernetes - Openshift - Volume + - Image type: string container: description: Allows adding and configuring devworkspace-related @@ -6299,6 +6623,113 @@ spec: type: object type: array type: object + image: + description: Allows specifying the definition + of an image for outer loop builds + oneOf: + - required: + - dockerfile + properties: + dockerfile: + description: Allows specifying dockerfile + type build + oneOf: + - required: + - uri + - required: + - id + - required: + - git + properties: + args: + description: The arguments to supply to + the dockerfile build. + items: + type: string + type: array + buildContext: + description: Path of source directory + to establish build context. Defaults + to ${PROJECT_ROOT} in the container + type: string + git: + description: Project's Git source + properties: + checkoutFrom: + description: Defines from what the + project should be checked out. Required + if there are more than one remote + configured + properties: + remote: + description: The remote name should + be used as init. Required if + there are more than one remote + configured + type: string + revision: + description: The revision to checkout + from. Should be branch name, + tag or commit id. Default branch + is used if missing or specified + revision is not found. + type: string + type: object + remotes: + additionalProperties: + type: string + description: The remotes map which + should be initialized in the git + project. Must have at least one + remote configured + type: object + type: object + gitLocation: + description: Location of the Dockerfile + in the Git repository when using git + as Dockerfile src. + type: string + id: + description: Id in a registry that contains + a Dockerfile + type: string + locationType: + description: Type of Dockerfile location + enum: + - Uri + - Id + - Git + type: string + registryUrl: + description: Registry URL to pull the + Dockerfile from when using id as Dockerfile + src. To ensure the dockerfile gets resolved + consistently in different environments, + it is recommended to always specify + the `regsitryURL` when `Id` is used. + type: string + rootRequired: + description: "Specify if a privileged + builder pod is required. \n Default + value is `false`" + type: boolean + uri: + description: URI Reference of a Dockerfile. + It can be a full URL or a relative URI + from the current devfile as the base + URI. + type: string + type: object + imageName: + description: Name of the image for the resulting + outerloop build + type: string + imageType: + description: Type of image + enum: + - Dockerfile + type: string + type: object kubernetes: description: Allows importing into the devworkspace the Kubernetes resources defined in a given diff --git a/crds/workspace.devfile.io_devworkspacetemplates.yaml b/crds/workspace.devfile.io_devworkspacetemplates.yaml index 9f99201de..d3e4aa203 100644 --- a/crds/workspace.devfile.io_devworkspacetemplates.yaml +++ b/crds/workspace.devfile.io_devworkspacetemplates.yaml @@ -3958,6 +3958,7 @@ spec: - run - test - debug + - deploy type: string required: - kind @@ -4005,6 +4006,7 @@ spec: - run - test - debug + - deploy type: string required: - kind @@ -4049,6 +4051,7 @@ spec: - run - test - debug + - deploy type: string required: - kind @@ -4104,6 +4107,7 @@ spec: - run - test - debug + - deploy type: string required: - kind @@ -4154,6 +4158,8 @@ spec: - openshift - required: - volume + - required: + - image - required: - plugin - required: @@ -4171,6 +4177,7 @@ spec: - Kubernetes - Openshift - Volume + - Image - Plugin - Custom type: string @@ -4362,6 +4369,106 @@ spec: - componentClass - embeddedResource type: object + image: + description: Allows specifying the definition of an image for + outer loop builds + oneOf: + - required: + - dockerfile + properties: + dockerfile: + description: Allows specifying dockerfile type build + oneOf: + - required: + - uri + - required: + - id + - required: + - git + properties: + args: + description: The arguments to supply to the dockerfile + build. + items: + type: string + type: array + buildContext: + description: Path of source directory to establish build + context. Defaults to ${PROJECT_ROOT} in the container + type: string + git: + description: Project's Git source + properties: + checkoutFrom: + description: Defines from what the project should + be checked out. Required if there are more than + one remote configured + properties: + remote: + description: The remote name should be used + as init. Required if there are more than one + remote configured + type: string + revision: + description: The revision to checkout from. + Should be branch name, tag or commit id. Default + branch is used if missing or specified revision + is not found. + type: string + type: object + remotes: + additionalProperties: + type: string + description: The remotes map which should be initialized + in the git project. Must have at least one remote + configured + type: object + required: + - remotes + type: object + gitLocation: + description: Location of the Dockerfile in the Git repository + when using git as Dockerfile src. + type: string + id: + description: Id in a registry that contains a Dockerfile + type: string + locationType: + description: Type of Dockerfile location + enum: + - Uri + - Id + - Git + type: string + registryUrl: + description: Registry URL to pull the Dockerfile from + when using id as Dockerfile src. To ensure the dockerfile + gets resolved consistently in different environments, + it is recommended to always specify the `regsitryURL` + when `Id` is used. + type: string + rootRequired: + description: "Specify if a privileged builder pod is + required. \n Default value is `false`" + type: boolean + uri: + description: URI Reference of a Dockerfile. It can be + a full URL or a relative URI from the current devfile + as the base URI. + type: string + type: object + imageName: + description: Name of the image for the resulting outerloop + build + type: string + imageType: + description: Type of image + enum: + - Dockerfile + type: string + required: + - imageName + type: object kubernetes: description: Allows importing into the devworkspace the Kubernetes resources defined in a given manifest. For example this allows @@ -4627,6 +4734,7 @@ spec: - run - test - debug + - deploy type: string type: object label: @@ -4673,6 +4781,7 @@ spec: - run - test - debug + - deploy type: string type: object label: @@ -4732,6 +4841,7 @@ spec: - run - test - debug + - deploy type: string type: object hotReloadCapable: @@ -4783,6 +4893,8 @@ spec: - openshift - required: - volume + - required: + - image properties: attributes: description: Map of implementation-dependant free-form @@ -4796,6 +4908,7 @@ spec: - Kubernetes - Openshift - Volume + - Image type: string container: description: Allows adding and configuring devworkspace-related @@ -4972,6 +5085,108 @@ spec: type: object type: array type: object + image: + description: Allows specifying the definition of an + image for outer loop builds + oneOf: + - required: + - dockerfile + properties: + dockerfile: + description: Allows specifying dockerfile type + build + oneOf: + - required: + - uri + - required: + - id + - required: + - git + properties: + args: + description: The arguments to supply to the + dockerfile build. + items: + type: string + type: array + buildContext: + description: Path of source directory to establish + build context. Defaults to ${PROJECT_ROOT} + in the container + type: string + git: + description: Project's Git source + properties: + checkoutFrom: + description: Defines from what the project + should be checked out. Required if there + are more than one remote configured + properties: + remote: + description: The remote name should + be used as init. Required if there + are more than one remote configured + type: string + revision: + description: The revision to checkout + from. Should be branch name, tag + or commit id. Default branch is + used if missing or specified revision + is not found. + type: string + type: object + remotes: + additionalProperties: + type: string + description: The remotes map which should + be initialized in the git project. Must + have at least one remote configured + type: object + type: object + gitLocation: + description: Location of the Dockerfile in + the Git repository when using git as Dockerfile + src. + type: string + id: + description: Id in a registry that contains + a Dockerfile + type: string + locationType: + description: Type of Dockerfile location + enum: + - Uri + - Id + - Git + type: string + registryUrl: + description: Registry URL to pull the Dockerfile + from when using id as Dockerfile src. To + ensure the dockerfile gets resolved consistently + in different environments, it is recommended + to always specify the `regsitryURL` when + `Id` is used. + type: string + rootRequired: + description: "Specify if a privileged builder + pod is required. \n Default value is `false`" + type: boolean + uri: + description: URI Reference of a Dockerfile. + It can be a full URL or a relative URI from + the current devfile as the base URI. + type: string + type: object + imageName: + description: Name of the image for the resulting + outerloop build + type: string + imageType: + description: Type of image + enum: + - Dockerfile + type: string + type: object kubernetes: description: Allows importing into the devworkspace the Kubernetes resources defined in a given manifest. @@ -5349,6 +5564,7 @@ spec: - run - test - debug + - deploy type: string type: object label: @@ -5393,6 +5609,7 @@ spec: - run - test - debug + - deploy type: string type: object label: @@ -5449,6 +5666,7 @@ spec: - run - test - debug + - deploy type: string type: object hotReloadCapable: @@ -5498,6 +5716,8 @@ spec: - openshift - required: - volume + - required: + - image - required: - plugin properties: @@ -5513,6 +5733,7 @@ spec: - Kubernetes - Openshift - Volume + - Image - Plugin type: string container: @@ -5682,6 +5903,103 @@ spec: type: object type: array type: object + image: + description: Allows specifying the definition of an image + for outer loop builds + oneOf: + - required: + - dockerfile + properties: + dockerfile: + description: Allows specifying dockerfile type build + oneOf: + - required: + - uri + - required: + - id + - required: + - git + properties: + args: + description: The arguments to supply to the dockerfile + build. + items: + type: string + type: array + buildContext: + description: Path of source directory to establish + build context. Defaults to ${PROJECT_ROOT} in + the container + type: string + git: + description: Project's Git source + properties: + checkoutFrom: + description: Defines from what the project should + be checked out. Required if there are more + than one remote configured + properties: + remote: + description: The remote name should be used + as init. Required if there are more than + one remote configured + type: string + revision: + description: The revision to checkout from. + Should be branch name, tag or commit id. + Default branch is used if missing or specified + revision is not found. + type: string + type: object + remotes: + additionalProperties: + type: string + description: The remotes map which should be + initialized in the git project. Must have + at least one remote configured + type: object + type: object + gitLocation: + description: Location of the Dockerfile in the Git + repository when using git as Dockerfile src. + type: string + id: + description: Id in a registry that contains a Dockerfile + type: string + locationType: + description: Type of Dockerfile location + enum: + - Uri + - Id + - Git + type: string + registryUrl: + description: Registry URL to pull the Dockerfile + from when using id as Dockerfile src. To ensure + the dockerfile gets resolved consistently in different + environments, it is recommended to always specify + the `regsitryURL` when `Id` is used. + type: string + rootRequired: + description: "Specify if a privileged builder pod + is required. \n Default value is `false`" + type: boolean + uri: + description: URI Reference of a Dockerfile. It can + be a full URL or a relative URI from the current + devfile as the base URI. + type: string + type: object + imageName: + description: Name of the image for the resulting outerloop + build + type: string + imageType: + description: Type of image + enum: + - Dockerfile + type: string + type: object kubernetes: description: Allows importing into the devworkspace the Kubernetes resources defined in a given manifest. For @@ -5950,6 +6268,7 @@ spec: - run - test - debug + - deploy type: string type: object label: @@ -5997,6 +6316,7 @@ spec: - run - test - debug + - deploy type: string type: object label: @@ -6057,6 +6377,7 @@ spec: - run - test - debug + - deploy type: string type: object hotReloadCapable: @@ -6108,6 +6429,8 @@ spec: - openshift - required: - volume + - required: + - image properties: attributes: description: Map of implementation-dependant free-form @@ -6121,6 +6444,7 @@ spec: - Kubernetes - Openshift - Volume + - Image type: string container: description: Allows adding and configuring devworkspace-related @@ -6304,6 +6628,113 @@ spec: type: object type: array type: object + image: + description: Allows specifying the definition + of an image for outer loop builds + oneOf: + - required: + - dockerfile + properties: + dockerfile: + description: Allows specifying dockerfile + type build + oneOf: + - required: + - uri + - required: + - id + - required: + - git + properties: + args: + description: The arguments to supply to + the dockerfile build. + items: + type: string + type: array + buildContext: + description: Path of source directory + to establish build context. Defaults + to ${PROJECT_ROOT} in the container + type: string + git: + description: Project's Git source + properties: + checkoutFrom: + description: Defines from what the + project should be checked out. Required + if there are more than one remote + configured + properties: + remote: + description: The remote name should + be used as init. Required if + there are more than one remote + configured + type: string + revision: + description: The revision to checkout + from. Should be branch name, + tag or commit id. Default branch + is used if missing or specified + revision is not found. + type: string + type: object + remotes: + additionalProperties: + type: string + description: The remotes map which + should be initialized in the git + project. Must have at least one + remote configured + type: object + type: object + gitLocation: + description: Location of the Dockerfile + in the Git repository when using git + as Dockerfile src. + type: string + id: + description: Id in a registry that contains + a Dockerfile + type: string + locationType: + description: Type of Dockerfile location + enum: + - Uri + - Id + - Git + type: string + registryUrl: + description: Registry URL to pull the + Dockerfile from when using id as Dockerfile + src. To ensure the dockerfile gets resolved + consistently in different environments, + it is recommended to always specify + the `regsitryURL` when `Id` is used. + type: string + rootRequired: + description: "Specify if a privileged + builder pod is required. \n Default + value is `false`" + type: boolean + uri: + description: URI Reference of a Dockerfile. + It can be a full URL or a relative URI + from the current devfile as the base + URI. + type: string + type: object + imageName: + description: Name of the image for the resulting + outerloop build + type: string + imageType: + description: Type of image + enum: + - Dockerfile + type: string + type: object kubernetes: description: Allows importing into the devworkspace the Kubernetes resources defined in a given diff --git a/pkg/apis/workspaces/v1alpha1/conversion.go b/pkg/apis/workspaces/v1alpha1/conversion.go index f244d80a6..6dadbfce5 100644 --- a/pkg/apis/workspaces/v1alpha1/conversion.go +++ b/pkg/apis/workspaces/v1alpha1/conversion.go @@ -105,12 +105,15 @@ func convertDevWorkspaceTemplateSpecFrom_v1alpha2(src *v1alpha2.DevWorkspaceTemp } } for _, srcComponent := range src.Components { - destComponent := Component{} - err := convertComponentFrom_v1alpha2(&srcComponent, &destComponent) - if err != nil { - return err + // Image Component is not present in v1alpha1 + if srcComponent.Image == nil { + destComponent := Component{} + err := convertComponentFrom_v1alpha2(&srcComponent, &destComponent) + if err != nil { + return err + } + dest.Components = append(dest.Components, destComponent) } - dest.Components = append(dest.Components, destComponent) } for _, srcProject := range src.Projects { destProject := Project{} diff --git a/pkg/apis/workspaces/v1alpha2/commands.go b/pkg/apis/workspaces/v1alpha2/commands.go index fe6883e79..6698a1d30 100644 --- a/pkg/apis/workspaces/v1alpha2/commands.go +++ b/pkg/apis/workspaces/v1alpha2/commands.go @@ -18,14 +18,15 @@ const ( ) // CommandGroupKind describes the kind of command group. -// +kubebuilder:validation:Enum=build;run;test;debug +// +kubebuilder:validation:Enum=build;run;test;debug;deploy type CommandGroupKind string const ( - BuildCommandGroupKind CommandGroupKind = "build" - RunCommandGroupKind CommandGroupKind = "run" - TestCommandGroupKind CommandGroupKind = "test" - DebugCommandGroupKind CommandGroupKind = "debug" + BuildCommandGroupKind CommandGroupKind = "build" + RunCommandGroupKind CommandGroupKind = "run" + TestCommandGroupKind CommandGroupKind = "test" + DebugCommandGroupKind CommandGroupKind = "debug" + DeployCommandGroupKind CommandGroupKind = "deploy" ) type CommandGroup struct { diff --git a/pkg/apis/workspaces/v1alpha2/component_image.go b/pkg/apis/workspaces/v1alpha2/component_image.go new file mode 100644 index 000000000..c6e7e6b77 --- /dev/null +++ b/pkg/apis/workspaces/v1alpha2/component_image.go @@ -0,0 +1,38 @@ +package v1alpha2 + +// ImageType describes the type of image. +// Only one of the following image type may be specified. +// +kubebuilder:validation:Enum=Dockerfile +type ImageType string + +const ( + DockerfileImageType ImageType = "Dockerfile" +) + +type BaseImage struct { +} + +// Component that allows the developer to build a runtime image for outerloop +type ImageComponent struct { + BaseComponent `json:",inline"` + Image `json:",inline"` +} + +type Image struct { + // Name of the image for the resulting outerloop build + ImageName string `json:"imageName"` + ImageUnion `json:",inline"` +} + +// +union +type ImageUnion struct { + // Type of image + // + // +unionDiscriminator + // +optional + ImageType ImageType `json:"imageType,omitempty"` + + // Allows specifying dockerfile type build + // +optional + Dockerfile *DockerfileImage `json:"dockerfile,omitempty"` +} diff --git a/pkg/apis/workspaces/v1alpha2/component_image_dockerfile.go b/pkg/apis/workspaces/v1alpha2/component_image_dockerfile.go new file mode 100644 index 000000000..cca3349ac --- /dev/null +++ b/pkg/apis/workspaces/v1alpha2/component_image_dockerfile.go @@ -0,0 +1,68 @@ +package v1alpha2 + +// DockerfileLocationType describes the type of +// the location for the Dockerfile outerloop build. +// Only one of the following location type may be specified. +// +kubebuilder:validation:Enum=Uri;Id;Git +type DockerfileLocationType string + +const ( + UriLikeDockerfileLocationType DockerfileLocationType = "Uri" + IdLikeDockerfileLocationType DockerfileLocationType = "Id" + GitLikeDockerfileLocationType DockerfileLocationType = "Git" +) + +// Dockerfile Image type to specify the outerloop build using a Dockerfile +type DockerfileImage struct { + BaseImage `json:",inline"` + DockerfileLocation `json:",inline"` + Dockerfile `json:",inline"` + + // Registry URL to pull the Dockerfile from when using id as Dockerfile src. + // To ensure the dockerfile gets resolved consistently in different environments, + // it is recommended to always specify the `regsitryURL` when `Id` is used. + // +optional + RegistryUrl string `json:"registryUrl,omitempty"` + + // Location of the Dockerfile in the Git repository when using git as Dockerfile src. + // +optional + GitLocation string `json:"gitLocation,omitempty"` +} + +// +union +type DockerfileLocation struct { + // Type of Dockerfile location + // + + // +unionDiscriminator + // +optional + LocationType DockerfileLocationType `json:"locationType,omitempty"` + + // URI Reference of a Dockerfile. + // It can be a full URL or a relative URI from the current devfile as the base URI. + // +optional + Uri string `json:"uri,omitempty"` + + // Id in a registry that contains a Dockerfile + // +optional + Id string `json:"id,omitempty"` + + // Project's Git source + // +optional + Git *GitProjectSource `json:"git,omitempty"` +} + +type Dockerfile struct { + // Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container + // +optional + BuildContext string `json:"buildContext,omitempty"` + + // The arguments to supply to the dockerfile build. + // +optional + Args []string `json:"args,omitempty" patchStrategy:"replace"` + + // Specify if a privileged builder pod is required. + // + // Default value is `false` + // +optional + RootRequired bool `json:"rootRequired,omitempty"` +} diff --git a/pkg/apis/workspaces/v1alpha2/components.go b/pkg/apis/workspaces/v1alpha2/components.go index 208499234..9356aa655 100644 --- a/pkg/apis/workspaces/v1alpha2/components.go +++ b/pkg/apis/workspaces/v1alpha2/components.go @@ -7,7 +7,7 @@ import ( // ComponentType describes the type of component. // Only one of the following component type may be specified. -// +kubebuilder:validation:Enum=Container;Kubernetes;Openshift;Volume;Plugin;Custom +// +kubebuilder:validation:Enum=Container;Kubernetes;Openshift;Volume;Image;Plugin;Custom type ComponentType string const ( @@ -16,6 +16,7 @@ const ( OpenshiftComponentType ComponentType = "Openshift" PluginComponentType ComponentType = "Plugin" VolumeComponentType ComponentType = "Volume" + ImageComponentType ComponentType = "Image" CustomComponentType ComponentType = "Custom" ) @@ -72,6 +73,10 @@ type ComponentUnion struct { // +optional Volume *VolumeComponent `json:"volume,omitempty"` + // Allows specifying the definition of an image for outer loop builds + // +optional + Image *ImageComponent `json:"image,omitempty"` + // Allows importing a plugin. // // Plugins are mainly imported devfiles that contribute components, commands diff --git a/pkg/apis/workspaces/v1alpha2/zz_generated.deepcopy.go b/pkg/apis/workspaces/v1alpha2/zz_generated.deepcopy.go index 983f3ec20..3cc9a602f 100644 --- a/pkg/apis/workspaces/v1alpha2/zz_generated.deepcopy.go +++ b/pkg/apis/workspaces/v1alpha2/zz_generated.deepcopy.go @@ -213,6 +213,66 @@ func (in *BaseComponentPluginOverrideParentOverride) DeepCopy() *BaseComponentPl return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BaseImage) DeepCopyInto(out *BaseImage) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BaseImage. +func (in *BaseImage) DeepCopy() *BaseImage { + if in == nil { + return nil + } + out := new(BaseImage) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BaseImageParentOverride) DeepCopyInto(out *BaseImageParentOverride) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BaseImageParentOverride. +func (in *BaseImageParentOverride) DeepCopy() *BaseImageParentOverride { + if in == nil { + return nil + } + out := new(BaseImageParentOverride) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BaseImagePluginOverride) DeepCopyInto(out *BaseImagePluginOverride) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BaseImagePluginOverride. +func (in *BaseImagePluginOverride) DeepCopy() *BaseImagePluginOverride { + if in == nil { + return nil + } + out := new(BaseImagePluginOverride) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BaseImagePluginOverrideParentOverride) DeepCopyInto(out *BaseImagePluginOverrideParentOverride) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BaseImagePluginOverrideParentOverride. +func (in *BaseImagePluginOverrideParentOverride) DeepCopy() *BaseImagePluginOverrideParentOverride { + if in == nil { + return nil + } + out := new(BaseImagePluginOverrideParentOverride) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CheckoutFrom) DeepCopyInto(out *CheckoutFrom) { *out = *in @@ -243,6 +303,36 @@ func (in *CheckoutFromParentOverride) DeepCopy() *CheckoutFromParentOverride { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CheckoutFromPluginOverride) DeepCopyInto(out *CheckoutFromPluginOverride) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CheckoutFromPluginOverride. +func (in *CheckoutFromPluginOverride) DeepCopy() *CheckoutFromPluginOverride { + if in == nil { + return nil + } + out := new(CheckoutFromPluginOverride) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CheckoutFromPluginOverrideParentOverride) DeepCopyInto(out *CheckoutFromPluginOverrideParentOverride) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CheckoutFromPluginOverrideParentOverride. +func (in *CheckoutFromPluginOverrideParentOverride) DeepCopy() *CheckoutFromPluginOverrideParentOverride { + if in == nil { + return nil + } + out := new(CheckoutFromPluginOverrideParentOverride) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Command) DeepCopyInto(out *Command) { *out = *in @@ -570,6 +660,36 @@ func (in *CommonProjectSourceParentOverride) DeepCopy() *CommonProjectSourcePare return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CommonProjectSourcePluginOverride) DeepCopyInto(out *CommonProjectSourcePluginOverride) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CommonProjectSourcePluginOverride. +func (in *CommonProjectSourcePluginOverride) DeepCopy() *CommonProjectSourcePluginOverride { + if in == nil { + return nil + } + out := new(CommonProjectSourcePluginOverride) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CommonProjectSourcePluginOverrideParentOverride) DeepCopyInto(out *CommonProjectSourcePluginOverrideParentOverride) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CommonProjectSourcePluginOverrideParentOverride. +func (in *CommonProjectSourcePluginOverrideParentOverride) DeepCopy() *CommonProjectSourcePluginOverrideParentOverride { + if in == nil { + return nil + } + out := new(CommonProjectSourcePluginOverrideParentOverride) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Component) DeepCopyInto(out *Component) { *out = *in @@ -685,6 +805,11 @@ func (in *ComponentUnion) DeepCopyInto(out *ComponentUnion) { *out = new(VolumeComponent) (*in).DeepCopyInto(*out) } + if in.Image != nil { + in, out := &in.Image, &out.Image + *out = new(ImageComponent) + (*in).DeepCopyInto(*out) + } if in.Plugin != nil { in, out := &in.Plugin, &out.Plugin *out = new(PluginComponent) @@ -730,6 +855,11 @@ func (in *ComponentUnionParentOverride) DeepCopyInto(out *ComponentUnionParentOv *out = new(VolumeComponentParentOverride) (*in).DeepCopyInto(*out) } + if in.Image != nil { + in, out := &in.Image, &out.Image + *out = new(ImageComponentParentOverride) + (*in).DeepCopyInto(*out) + } if in.Plugin != nil { in, out := &in.Plugin, &out.Plugin *out = new(PluginComponentParentOverride) @@ -770,6 +900,11 @@ func (in *ComponentUnionPluginOverride) DeepCopyInto(out *ComponentUnionPluginOv *out = new(VolumeComponentPluginOverride) (*in).DeepCopyInto(*out) } + if in.Image != nil { + in, out := &in.Image, &out.Image + *out = new(ImageComponentPluginOverride) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComponentUnionPluginOverride. @@ -805,6 +940,11 @@ func (in *ComponentUnionPluginOverrideParentOverride) DeepCopyInto(out *Componen *out = new(VolumeComponentPluginOverrideParentOverride) (*in).DeepCopyInto(*out) } + if in.Image != nil { + in, out := &in.Image, &out.Image + *out = new(ImageComponentPluginOverrideParentOverride) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComponentUnionPluginOverrideParentOverride. @@ -1535,6 +1675,238 @@ func (in *DevWorkspaceTemplateSpecContent) DeepCopy() *DevWorkspaceTemplateSpecC return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Dockerfile) DeepCopyInto(out *Dockerfile) { + *out = *in + if in.Args != nil { + in, out := &in.Args, &out.Args + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Dockerfile. +func (in *Dockerfile) DeepCopy() *Dockerfile { + if in == nil { + return nil + } + out := new(Dockerfile) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DockerfileImage) DeepCopyInto(out *DockerfileImage) { + *out = *in + out.BaseImage = in.BaseImage + in.DockerfileLocation.DeepCopyInto(&out.DockerfileLocation) + in.Dockerfile.DeepCopyInto(&out.Dockerfile) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerfileImage. +func (in *DockerfileImage) DeepCopy() *DockerfileImage { + if in == nil { + return nil + } + out := new(DockerfileImage) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DockerfileImageParentOverride) DeepCopyInto(out *DockerfileImageParentOverride) { + *out = *in + out.BaseImageParentOverride = in.BaseImageParentOverride + in.DockerfileLocationParentOverride.DeepCopyInto(&out.DockerfileLocationParentOverride) + in.DockerfileParentOverride.DeepCopyInto(&out.DockerfileParentOverride) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerfileImageParentOverride. +func (in *DockerfileImageParentOverride) DeepCopy() *DockerfileImageParentOverride { + if in == nil { + return nil + } + out := new(DockerfileImageParentOverride) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DockerfileImagePluginOverride) DeepCopyInto(out *DockerfileImagePluginOverride) { + *out = *in + out.BaseImagePluginOverride = in.BaseImagePluginOverride + in.DockerfileLocationPluginOverride.DeepCopyInto(&out.DockerfileLocationPluginOverride) + in.DockerfilePluginOverride.DeepCopyInto(&out.DockerfilePluginOverride) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerfileImagePluginOverride. +func (in *DockerfileImagePluginOverride) DeepCopy() *DockerfileImagePluginOverride { + if in == nil { + return nil + } + out := new(DockerfileImagePluginOverride) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DockerfileImagePluginOverrideParentOverride) DeepCopyInto(out *DockerfileImagePluginOverrideParentOverride) { + *out = *in + out.BaseImagePluginOverrideParentOverride = in.BaseImagePluginOverrideParentOverride + in.DockerfileLocationPluginOverrideParentOverride.DeepCopyInto(&out.DockerfileLocationPluginOverrideParentOverride) + in.DockerfilePluginOverrideParentOverride.DeepCopyInto(&out.DockerfilePluginOverrideParentOverride) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerfileImagePluginOverrideParentOverride. +func (in *DockerfileImagePluginOverrideParentOverride) DeepCopy() *DockerfileImagePluginOverrideParentOverride { + if in == nil { + return nil + } + out := new(DockerfileImagePluginOverrideParentOverride) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DockerfileLocation) DeepCopyInto(out *DockerfileLocation) { + *out = *in + if in.Git != nil { + in, out := &in.Git, &out.Git + *out = new(GitProjectSource) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerfileLocation. +func (in *DockerfileLocation) DeepCopy() *DockerfileLocation { + if in == nil { + return nil + } + out := new(DockerfileLocation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DockerfileLocationParentOverride) DeepCopyInto(out *DockerfileLocationParentOverride) { + *out = *in + if in.Git != nil { + in, out := &in.Git, &out.Git + *out = new(GitProjectSourceParentOverride) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerfileLocationParentOverride. +func (in *DockerfileLocationParentOverride) DeepCopy() *DockerfileLocationParentOverride { + if in == nil { + return nil + } + out := new(DockerfileLocationParentOverride) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DockerfileLocationPluginOverride) DeepCopyInto(out *DockerfileLocationPluginOverride) { + *out = *in + if in.Git != nil { + in, out := &in.Git, &out.Git + *out = new(GitProjectSourcePluginOverride) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerfileLocationPluginOverride. +func (in *DockerfileLocationPluginOverride) DeepCopy() *DockerfileLocationPluginOverride { + if in == nil { + return nil + } + out := new(DockerfileLocationPluginOverride) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DockerfileLocationPluginOverrideParentOverride) DeepCopyInto(out *DockerfileLocationPluginOverrideParentOverride) { + *out = *in + if in.Git != nil { + in, out := &in.Git, &out.Git + *out = new(GitProjectSourcePluginOverrideParentOverride) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerfileLocationPluginOverrideParentOverride. +func (in *DockerfileLocationPluginOverrideParentOverride) DeepCopy() *DockerfileLocationPluginOverrideParentOverride { + if in == nil { + return nil + } + out := new(DockerfileLocationPluginOverrideParentOverride) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DockerfileParentOverride) DeepCopyInto(out *DockerfileParentOverride) { + *out = *in + if in.Args != nil { + in, out := &in.Args, &out.Args + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerfileParentOverride. +func (in *DockerfileParentOverride) DeepCopy() *DockerfileParentOverride { + if in == nil { + return nil + } + out := new(DockerfileParentOverride) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DockerfilePluginOverride) DeepCopyInto(out *DockerfilePluginOverride) { + *out = *in + if in.Args != nil { + in, out := &in.Args, &out.Args + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerfilePluginOverride. +func (in *DockerfilePluginOverride) DeepCopy() *DockerfilePluginOverride { + if in == nil { + return nil + } + out := new(DockerfilePluginOverride) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DockerfilePluginOverrideParentOverride) DeepCopyInto(out *DockerfilePluginOverrideParentOverride) { + *out = *in + if in.Args != nil { + in, out := &in.Args, &out.Args + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerfilePluginOverrideParentOverride. +func (in *DockerfilePluginOverrideParentOverride) DeepCopy() *DockerfilePluginOverrideParentOverride { + if in == nil { + return nil + } + out := new(DockerfilePluginOverrideParentOverride) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Endpoint) DeepCopyInto(out *Endpoint) { *out = *in @@ -1879,6 +2251,62 @@ func (in *GitLikeProjectSourceParentOverride) DeepCopy() *GitLikeProjectSourcePa return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GitLikeProjectSourcePluginOverride) DeepCopyInto(out *GitLikeProjectSourcePluginOverride) { + *out = *in + out.CommonProjectSourcePluginOverride = in.CommonProjectSourcePluginOverride + if in.CheckoutFrom != nil { + in, out := &in.CheckoutFrom, &out.CheckoutFrom + *out = new(CheckoutFromPluginOverride) + **out = **in + } + if in.Remotes != nil { + in, out := &in.Remotes, &out.Remotes + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitLikeProjectSourcePluginOverride. +func (in *GitLikeProjectSourcePluginOverride) DeepCopy() *GitLikeProjectSourcePluginOverride { + if in == nil { + return nil + } + out := new(GitLikeProjectSourcePluginOverride) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GitLikeProjectSourcePluginOverrideParentOverride) DeepCopyInto(out *GitLikeProjectSourcePluginOverrideParentOverride) { + *out = *in + out.CommonProjectSourcePluginOverrideParentOverride = in.CommonProjectSourcePluginOverrideParentOverride + if in.CheckoutFrom != nil { + in, out := &in.CheckoutFrom, &out.CheckoutFrom + *out = new(CheckoutFromPluginOverrideParentOverride) + **out = **in + } + if in.Remotes != nil { + in, out := &in.Remotes, &out.Remotes + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitLikeProjectSourcePluginOverrideParentOverride. +func (in *GitLikeProjectSourcePluginOverrideParentOverride) DeepCopy() *GitLikeProjectSourcePluginOverrideParentOverride { + if in == nil { + return nil + } + out := new(GitLikeProjectSourcePluginOverrideParentOverride) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *GitProjectSource) DeepCopyInto(out *GitProjectSource) { *out = *in @@ -1911,6 +2339,250 @@ func (in *GitProjectSourceParentOverride) DeepCopy() *GitProjectSourceParentOver return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GitProjectSourcePluginOverride) DeepCopyInto(out *GitProjectSourcePluginOverride) { + *out = *in + in.GitLikeProjectSourcePluginOverride.DeepCopyInto(&out.GitLikeProjectSourcePluginOverride) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitProjectSourcePluginOverride. +func (in *GitProjectSourcePluginOverride) DeepCopy() *GitProjectSourcePluginOverride { + if in == nil { + return nil + } + out := new(GitProjectSourcePluginOverride) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GitProjectSourcePluginOverrideParentOverride) DeepCopyInto(out *GitProjectSourcePluginOverrideParentOverride) { + *out = *in + in.GitLikeProjectSourcePluginOverrideParentOverride.DeepCopyInto(&out.GitLikeProjectSourcePluginOverrideParentOverride) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitProjectSourcePluginOverrideParentOverride. +func (in *GitProjectSourcePluginOverrideParentOverride) DeepCopy() *GitProjectSourcePluginOverrideParentOverride { + if in == nil { + return nil + } + out := new(GitProjectSourcePluginOverrideParentOverride) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Image) DeepCopyInto(out *Image) { + *out = *in + in.ImageUnion.DeepCopyInto(&out.ImageUnion) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Image. +func (in *Image) DeepCopy() *Image { + if in == nil { + return nil + } + out := new(Image) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ImageComponent) DeepCopyInto(out *ImageComponent) { + *out = *in + out.BaseComponent = in.BaseComponent + in.Image.DeepCopyInto(&out.Image) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageComponent. +func (in *ImageComponent) DeepCopy() *ImageComponent { + if in == nil { + return nil + } + out := new(ImageComponent) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ImageComponentParentOverride) DeepCopyInto(out *ImageComponentParentOverride) { + *out = *in + out.BaseComponentParentOverride = in.BaseComponentParentOverride + in.ImageParentOverride.DeepCopyInto(&out.ImageParentOverride) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageComponentParentOverride. +func (in *ImageComponentParentOverride) DeepCopy() *ImageComponentParentOverride { + if in == nil { + return nil + } + out := new(ImageComponentParentOverride) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ImageComponentPluginOverride) DeepCopyInto(out *ImageComponentPluginOverride) { + *out = *in + out.BaseComponentPluginOverride = in.BaseComponentPluginOverride + in.ImagePluginOverride.DeepCopyInto(&out.ImagePluginOverride) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageComponentPluginOverride. +func (in *ImageComponentPluginOverride) DeepCopy() *ImageComponentPluginOverride { + if in == nil { + return nil + } + out := new(ImageComponentPluginOverride) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ImageComponentPluginOverrideParentOverride) DeepCopyInto(out *ImageComponentPluginOverrideParentOverride) { + *out = *in + out.BaseComponentPluginOverrideParentOverride = in.BaseComponentPluginOverrideParentOverride + in.ImagePluginOverrideParentOverride.DeepCopyInto(&out.ImagePluginOverrideParentOverride) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageComponentPluginOverrideParentOverride. +func (in *ImageComponentPluginOverrideParentOverride) DeepCopy() *ImageComponentPluginOverrideParentOverride { + if in == nil { + return nil + } + out := new(ImageComponentPluginOverrideParentOverride) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ImageParentOverride) DeepCopyInto(out *ImageParentOverride) { + *out = *in + in.ImageUnionParentOverride.DeepCopyInto(&out.ImageUnionParentOverride) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageParentOverride. +func (in *ImageParentOverride) DeepCopy() *ImageParentOverride { + if in == nil { + return nil + } + out := new(ImageParentOverride) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ImagePluginOverride) DeepCopyInto(out *ImagePluginOverride) { + *out = *in + in.ImageUnionPluginOverride.DeepCopyInto(&out.ImageUnionPluginOverride) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImagePluginOverride. +func (in *ImagePluginOverride) DeepCopy() *ImagePluginOverride { + if in == nil { + return nil + } + out := new(ImagePluginOverride) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ImagePluginOverrideParentOverride) DeepCopyInto(out *ImagePluginOverrideParentOverride) { + *out = *in + in.ImageUnionPluginOverrideParentOverride.DeepCopyInto(&out.ImageUnionPluginOverrideParentOverride) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImagePluginOverrideParentOverride. +func (in *ImagePluginOverrideParentOverride) DeepCopy() *ImagePluginOverrideParentOverride { + if in == nil { + return nil + } + out := new(ImagePluginOverrideParentOverride) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ImageUnion) DeepCopyInto(out *ImageUnion) { + *out = *in + if in.Dockerfile != nil { + in, out := &in.Dockerfile, &out.Dockerfile + *out = new(DockerfileImage) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageUnion. +func (in *ImageUnion) DeepCopy() *ImageUnion { + if in == nil { + return nil + } + out := new(ImageUnion) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ImageUnionParentOverride) DeepCopyInto(out *ImageUnionParentOverride) { + *out = *in + if in.Dockerfile != nil { + in, out := &in.Dockerfile, &out.Dockerfile + *out = new(DockerfileImageParentOverride) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageUnionParentOverride. +func (in *ImageUnionParentOverride) DeepCopy() *ImageUnionParentOverride { + if in == nil { + return nil + } + out := new(ImageUnionParentOverride) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ImageUnionPluginOverride) DeepCopyInto(out *ImageUnionPluginOverride) { + *out = *in + if in.Dockerfile != nil { + in, out := &in.Dockerfile, &out.Dockerfile + *out = new(DockerfileImagePluginOverride) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageUnionPluginOverride. +func (in *ImageUnionPluginOverride) DeepCopy() *ImageUnionPluginOverride { + if in == nil { + return nil + } + out := new(ImageUnionPluginOverride) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ImageUnionPluginOverrideParentOverride) DeepCopyInto(out *ImageUnionPluginOverrideParentOverride) { + *out = *in + if in.Dockerfile != nil { + in, out := &in.Dockerfile, &out.Dockerfile + *out = new(DockerfileImagePluginOverrideParentOverride) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageUnionPluginOverrideParentOverride. +func (in *ImageUnionPluginOverrideParentOverride) DeepCopy() *ImageUnionPluginOverrideParentOverride { + if in == nil { + return nil + } + out := new(ImageUnionPluginOverrideParentOverride) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ImportReference) DeepCopyInto(out *ImportReference) { *out = *in diff --git a/pkg/apis/workspaces/v1alpha2/zz_generated.parent_overrides.go b/pkg/apis/workspaces/v1alpha2/zz_generated.parent_overrides.go index 0b0027180..a51c2fde3 100644 --- a/pkg/apis/workspaces/v1alpha2/zz_generated.parent_overrides.go +++ b/pkg/apis/workspaces/v1alpha2/zz_generated.parent_overrides.go @@ -142,7 +142,7 @@ type CommandParentOverride struct { // +union type ComponentUnionParentOverride struct { - // +kubebuilder:validation:Enum=Container;Kubernetes;Openshift;Volume;Plugin + // +kubebuilder:validation:Enum=Container;Kubernetes;Openshift;Volume;Image;Plugin // Type of component // // +unionDiscriminator @@ -172,6 +172,10 @@ type ComponentUnionParentOverride struct { // +optional Volume *VolumeComponentParentOverride `json:"volume,omitempty"` + // Allows specifying the definition of an image for outer loop builds + // +optional + Image *ImageComponentParentOverride `json:"image,omitempty"` + // Allows importing a plugin. // // Plugins are mainly imported devfiles that contribute components, commands @@ -262,6 +266,12 @@ type VolumeComponentParentOverride struct { VolumeParentOverride `json:",inline"` } +// Component that allows the developer to build a runtime image for outerloop +type ImageComponentParentOverride struct { + BaseComponentParentOverride `json:",inline"` + ImageParentOverride `json:",inline"` +} + type PluginComponentParentOverride struct { BaseComponentParentOverride `json:",inline"` ImportReferenceParentOverride `json:",inline"` @@ -510,6 +520,14 @@ type VolumeParentOverride struct { Ephemeral *bool `json:"ephemeral,omitempty"` } +type ImageParentOverride struct { + + // +optional + // Name of the image for the resulting outerloop build + ImageName string `json:"imageName,omitempty"` + ImageUnionParentOverride `json:",inline"` +} + type ImportReferenceParentOverride struct { ImportReferenceUnionParentOverride `json:",inline"` @@ -616,6 +634,21 @@ type K8sLikeComponentLocationParentOverride struct { Inlined string `json:"inlined,omitempty"` } +// +union +type ImageUnionParentOverride struct { + + // +kubebuilder:validation:Enum=Dockerfile + // Type of image + // + // +unionDiscriminator + // +optional + ImageType ImageTypeParentOverride `json:"imageType,omitempty"` + + // Allows specifying dockerfile type build + // +optional + Dockerfile *DockerfileImageParentOverride `json:"dockerfile,omitempty"` +} + // Location from where the an import reference is retrieved // +union type ImportReferenceUnionParentOverride struct { @@ -706,6 +739,27 @@ type BaseCommandParentOverride struct { // Only one of the following component type may be specified. type K8sLikeComponentLocationTypeParentOverride string +// ImageType describes the type of image. +// Only one of the following image type may be specified. +type ImageTypeParentOverride string + +// Dockerfile Image type to specify the outerloop build using a Dockerfile +type DockerfileImageParentOverride struct { + BaseImageParentOverride `json:",inline"` + DockerfileLocationParentOverride `json:",inline"` + DockerfileParentOverride `json:",inline"` + + // Registry URL to pull the Dockerfile from when using id as Dockerfile src. + // To ensure the dockerfile gets resolved consistently in different environments, + // it is recommended to always specify the `regsitryURL` when `Id` is used. + // +optional + RegistryUrl string `json:"registryUrl,omitempty"` + + // Location of the Dockerfile in the Git repository when using git as Dockerfile src. + // +optional + GitLocation string `json:"gitLocation,omitempty"` +} + // ImportReferenceType describes the type of location // from where the referenced template structure should be retrieved. // Only one of the following parent locations may be specified. @@ -722,7 +776,7 @@ type KubernetesCustomResourceImportReferenceParentOverride struct { // +union type ComponentUnionPluginOverrideParentOverride struct { - // +kubebuilder:validation:Enum=Container;Kubernetes;Openshift;Volume + // +kubebuilder:validation:Enum=Container;Kubernetes;Openshift;Volume;Image // Type of component // // +unionDiscriminator @@ -751,6 +805,10 @@ type ComponentUnionPluginOverrideParentOverride struct { // shared by several other components // +optional Volume *VolumeComponentPluginOverrideParentOverride `json:"volume,omitempty"` + + // Allows specifying the definition of an image for outer loop builds + // +optional + Image *ImageComponentPluginOverrideParentOverride `json:"image,omitempty"` } // +union @@ -797,6 +855,50 @@ type CommandGroupParentOverride struct { IsDefault *bool `json:"isDefault,omitempty"` } +type BaseImageParentOverride struct { +} + +// +union +type DockerfileLocationParentOverride struct { + + // +kubebuilder:validation:Enum=Uri;Id;Git + // Type of Dockerfile location + // + + // +unionDiscriminator + // +optional + LocationType DockerfileLocationTypeParentOverride `json:"locationType,omitempty"` + + // URI Reference of a Dockerfile. + // It can be a full URL or a relative URI from the current devfile as the base URI. + // +optional + Uri string `json:"uri,omitempty"` + + // Id in a registry that contains a Dockerfile + // +optional + Id string `json:"id,omitempty"` + + // Project's Git source + // +optional + Git *GitProjectSourceParentOverride `json:"git,omitempty"` +} + +type DockerfileParentOverride struct { + + // Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container + // +optional + BuildContext string `json:"buildContext,omitempty"` + + // The arguments to supply to the dockerfile build. + // +optional + Args []string `json:"args,omitempty" patchStrategy:"replace"` + + // Specify if a privileged builder pod is required. + // + // Default value is `false` + // +optional + RootRequired bool `json:"rootRequired,omitempty"` +} + // ComponentType describes the type of component. // Only one of the following component type may be specified. type ComponentTypePluginOverrideParentOverride string @@ -824,6 +926,12 @@ type VolumeComponentPluginOverrideParentOverride struct { VolumePluginOverrideParentOverride `json:",inline"` } +// Component that allows the developer to build a runtime image for outerloop +type ImageComponentPluginOverrideParentOverride struct { + BaseComponentPluginOverrideParentOverride `json:",inline"` + ImagePluginOverrideParentOverride `json:",inline"` +} + // CommandType describes the type of command. // Only one of the following command type may be specified. type CommandTypePluginOverrideParentOverride string @@ -892,9 +1000,14 @@ type CompositeCommandPluginOverrideParentOverride struct { } // CommandGroupKind describes the kind of command group. -// +kubebuilder:validation:Enum=build;run;test;debug +// +kubebuilder:validation:Enum=build;run;test;debug;deploy type CommandGroupKindParentOverride string +// DockerfileLocationType describes the type of +// the location for the Dockerfile outerloop build. +// Only one of the following location type may be specified. +type DockerfileLocationTypeParentOverride string + // DevWorkspace component: Anything that will bring additional features / tooling / behaviour / context // to the devworkspace, in order to make working in it easier. type BaseComponentPluginOverrideParentOverride struct { @@ -1053,6 +1166,14 @@ type VolumePluginOverrideParentOverride struct { Ephemeral *bool `json:"ephemeral,omitempty"` } +type ImagePluginOverrideParentOverride struct { + + // +optional + // Name of the image for the resulting outerloop build + ImageName string `json:"imageName,omitempty"` + ImageUnionPluginOverrideParentOverride `json:",inline"` +} + type LabeledCommandPluginOverrideParentOverride struct { BaseCommandPluginOverrideParentOverride `json:",inline"` @@ -1114,6 +1235,21 @@ type K8sLikeComponentLocationPluginOverrideParentOverride struct { Inlined string `json:"inlined,omitempty"` } +// +union +type ImageUnionPluginOverrideParentOverride struct { + + // +kubebuilder:validation:Enum=Dockerfile + // Type of image + // + // +unionDiscriminator + // +optional + ImageType ImageTypePluginOverrideParentOverride `json:"imageType,omitempty"` + + // Allows specifying dockerfile type build + // +optional + Dockerfile *DockerfileImagePluginOverrideParentOverride `json:"dockerfile,omitempty"` +} + type BaseCommandPluginOverrideParentOverride struct { // +optional @@ -1126,6 +1262,27 @@ type BaseCommandPluginOverrideParentOverride struct { // Only one of the following component type may be specified. type K8sLikeComponentLocationTypePluginOverrideParentOverride string +// ImageType describes the type of image. +// Only one of the following image type may be specified. +type ImageTypePluginOverrideParentOverride string + +// Dockerfile Image type to specify the outerloop build using a Dockerfile +type DockerfileImagePluginOverrideParentOverride struct { + BaseImagePluginOverrideParentOverride `json:",inline"` + DockerfileLocationPluginOverrideParentOverride `json:",inline"` + DockerfilePluginOverrideParentOverride `json:",inline"` + + // Registry URL to pull the Dockerfile from when using id as Dockerfile src. + // To ensure the dockerfile gets resolved consistently in different environments, + // it is recommended to always specify the `regsitryURL` when `Id` is used. + // +optional + RegistryUrl string `json:"registryUrl,omitempty"` + + // Location of the Dockerfile in the Git repository when using git as Dockerfile src. + // +optional + GitLocation string `json:"gitLocation,omitempty"` +} + type CommandGroupPluginOverrideParentOverride struct { // +optional @@ -1137,8 +1294,88 @@ type CommandGroupPluginOverrideParentOverride struct { IsDefault *bool `json:"isDefault,omitempty"` } +type BaseImagePluginOverrideParentOverride struct { +} + +// +union +type DockerfileLocationPluginOverrideParentOverride struct { + + // +kubebuilder:validation:Enum=Uri;Id;Git + // Type of Dockerfile location + // + + // +unionDiscriminator + // +optional + LocationType DockerfileLocationTypePluginOverrideParentOverride `json:"locationType,omitempty"` + + // URI Reference of a Dockerfile. + // It can be a full URL or a relative URI from the current devfile as the base URI. + // +optional + Uri string `json:"uri,omitempty"` + + // Id in a registry that contains a Dockerfile + // +optional + Id string `json:"id,omitempty"` + + // Project's Git source + // +optional + Git *GitProjectSourcePluginOverrideParentOverride `json:"git,omitempty"` +} + +type DockerfilePluginOverrideParentOverride struct { + + // Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container + // +optional + BuildContext string `json:"buildContext,omitempty"` + + // The arguments to supply to the dockerfile build. + // +optional + Args []string `json:"args,omitempty" patchStrategy:"replace"` + + // Specify if a privileged builder pod is required. + // + // Default value is `false` + // +optional + RootRequired bool `json:"rootRequired,omitempty"` +} + // CommandGroupKind describes the kind of command group. -// +kubebuilder:validation:Enum=build;run;test;debug +// +kubebuilder:validation:Enum=build;run;test;debug;deploy type CommandGroupKindPluginOverrideParentOverride string +// DockerfileLocationType describes the type of +// the location for the Dockerfile outerloop build. +// Only one of the following location type may be specified. +type DockerfileLocationTypePluginOverrideParentOverride string + +type GitProjectSourcePluginOverrideParentOverride struct { + GitLikeProjectSourcePluginOverrideParentOverride `json:",inline"` +} + +type GitLikeProjectSourcePluginOverrideParentOverride struct { + CommonProjectSourcePluginOverrideParentOverride `json:",inline"` + + // Defines from what the project should be checked out. Required if there are more than one remote configured + // +optional + CheckoutFrom *CheckoutFromPluginOverrideParentOverride `json:"checkoutFrom,omitempty"` + + // +optional + // The remotes map which should be initialized in the git project. Must have at least one remote configured + Remotes map[string]string `json:"remotes,omitempty"` +} + +type CommonProjectSourcePluginOverrideParentOverride struct { +} + +type CheckoutFromPluginOverrideParentOverride struct { + + // The revision to checkout from. Should be branch name, tag or commit id. + // Default branch is used if missing or specified revision is not found. + // +optional + Revision string `json:"revision,omitempty"` + + // The remote name should be used as init. Required if there are more than one remote configured + // +optional + Remote string `json:"remote,omitempty"` +} + func (overrides ParentOverrides) isOverride() {} diff --git a/pkg/apis/workspaces/v1alpha2/zz_generated.plugin_overrides.go b/pkg/apis/workspaces/v1alpha2/zz_generated.plugin_overrides.go index 416cacef2..33ce26336 100644 --- a/pkg/apis/workspaces/v1alpha2/zz_generated.plugin_overrides.go +++ b/pkg/apis/workspaces/v1alpha2/zz_generated.plugin_overrides.go @@ -65,7 +65,7 @@ type CommandPluginOverride struct { // +union type ComponentUnionPluginOverride struct { - // +kubebuilder:validation:Enum=Container;Kubernetes;Openshift;Volume + // +kubebuilder:validation:Enum=Container;Kubernetes;Openshift;Volume;Image // Type of component // // +unionDiscriminator @@ -94,6 +94,10 @@ type ComponentUnionPluginOverride struct { // shared by several other components // +optional Volume *VolumeComponentPluginOverride `json:"volume,omitempty"` + + // Allows specifying the definition of an image for outer loop builds + // +optional + Image *ImageComponentPluginOverride `json:"image,omitempty"` } // +union @@ -156,6 +160,12 @@ type VolumeComponentPluginOverride struct { VolumePluginOverride `json:",inline"` } +// Component that allows the developer to build a runtime image for outerloop +type ImageComponentPluginOverride struct { + BaseComponentPluginOverride `json:",inline"` + ImagePluginOverride `json:",inline"` +} + // CommandType describes the type of command. // Only one of the following command type may be specified. type CommandTypePluginOverride string @@ -380,6 +390,14 @@ type VolumePluginOverride struct { Ephemeral *bool `json:"ephemeral,omitempty"` } +type ImagePluginOverride struct { + + // +optional + // Name of the image for the resulting outerloop build + ImageName string `json:"imageName,omitempty"` + ImageUnionPluginOverride `json:",inline"` +} + type LabeledCommandPluginOverride struct { BaseCommandPluginOverride `json:",inline"` @@ -440,6 +458,21 @@ type K8sLikeComponentLocationPluginOverride struct { Inlined string `json:"inlined,omitempty"` } +// +union +type ImageUnionPluginOverride struct { + + // +kubebuilder:validation:Enum=Dockerfile + // Type of image + // + // +unionDiscriminator + // +optional + ImageType ImageTypePluginOverride `json:"imageType,omitempty"` + + // Allows specifying dockerfile type build + // +optional + Dockerfile *DockerfileImagePluginOverride `json:"dockerfile,omitempty"` +} + type BaseCommandPluginOverride struct { // +optional @@ -452,6 +485,27 @@ type BaseCommandPluginOverride struct { // Only one of the following component type may be specified. type K8sLikeComponentLocationTypePluginOverride string +// ImageType describes the type of image. +// Only one of the following image type may be specified. +type ImageTypePluginOverride string + +// Dockerfile Image type to specify the outerloop build using a Dockerfile +type DockerfileImagePluginOverride struct { + BaseImagePluginOverride `json:",inline"` + DockerfileLocationPluginOverride `json:",inline"` + DockerfilePluginOverride `json:",inline"` + + // Registry URL to pull the Dockerfile from when using id as Dockerfile src. + // To ensure the dockerfile gets resolved consistently in different environments, + // it is recommended to always specify the `regsitryURL` when `Id` is used. + // +optional + RegistryUrl string `json:"registryUrl,omitempty"` + + // Location of the Dockerfile in the Git repository when using git as Dockerfile src. + // +optional + GitLocation string `json:"gitLocation,omitempty"` +} + type CommandGroupPluginOverride struct { // +optional @@ -463,8 +517,88 @@ type CommandGroupPluginOverride struct { IsDefault *bool `json:"isDefault,omitempty"` } +type BaseImagePluginOverride struct { +} + +// +union +type DockerfileLocationPluginOverride struct { + + // +kubebuilder:validation:Enum=Uri;Id;Git + // Type of Dockerfile location + // + + // +unionDiscriminator + // +optional + LocationType DockerfileLocationTypePluginOverride `json:"locationType,omitempty"` + + // URI Reference of a Dockerfile. + // It can be a full URL or a relative URI from the current devfile as the base URI. + // +optional + Uri string `json:"uri,omitempty"` + + // Id in a registry that contains a Dockerfile + // +optional + Id string `json:"id,omitempty"` + + // Project's Git source + // +optional + Git *GitProjectSourcePluginOverride `json:"git,omitempty"` +} + +type DockerfilePluginOverride struct { + + // Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container + // +optional + BuildContext string `json:"buildContext,omitempty"` + + // The arguments to supply to the dockerfile build. + // +optional + Args []string `json:"args,omitempty" patchStrategy:"replace"` + + // Specify if a privileged builder pod is required. + // + // Default value is `false` + // +optional + RootRequired bool `json:"rootRequired,omitempty"` +} + // CommandGroupKind describes the kind of command group. -// +kubebuilder:validation:Enum=build;run;test;debug +// +kubebuilder:validation:Enum=build;run;test;debug;deploy type CommandGroupKindPluginOverride string +// DockerfileLocationType describes the type of +// the location for the Dockerfile outerloop build. +// Only one of the following location type may be specified. +type DockerfileLocationTypePluginOverride string + +type GitProjectSourcePluginOverride struct { + GitLikeProjectSourcePluginOverride `json:",inline"` +} + +type GitLikeProjectSourcePluginOverride struct { + CommonProjectSourcePluginOverride `json:",inline"` + + // Defines from what the project should be checked out. Required if there are more than one remote configured + // +optional + CheckoutFrom *CheckoutFromPluginOverride `json:"checkoutFrom,omitempty"` + + // +optional + // The remotes map which should be initialized in the git project. Must have at least one remote configured + Remotes map[string]string `json:"remotes,omitempty"` +} + +type CommonProjectSourcePluginOverride struct { +} + +type CheckoutFromPluginOverride struct { + + // The revision to checkout from. Should be branch name, tag or commit id. + // Default branch is used if missing or specified revision is not found. + // +optional + Revision string `json:"revision,omitempty"` + + // The remote name should be used as init. Required if there are more than one remote configured + // +optional + Remote string `json:"remote,omitempty"` +} + func (overrides PluginOverrides) isOverride() {} diff --git a/pkg/apis/workspaces/v1alpha2/zz_generated.union_definitions.go b/pkg/apis/workspaces/v1alpha2/zz_generated.union_definitions.go index 50116cb1b..5d26f3bcf 100644 --- a/pkg/apis/workspaces/v1alpha2/zz_generated.union_definitions.go +++ b/pkg/apis/workspaces/v1alpha2/zz_generated.union_definitions.go @@ -27,6 +27,48 @@ type CommandUnionVisitor struct { Custom func(*CustomCommand) error } +var imageUnion reflect.Type = reflect.TypeOf(ImageUnionVisitor{}) + +func (union ImageUnion) Visit(visitor ImageUnionVisitor) error { + return visitUnion(union, visitor) +} +func (union *ImageUnion) discriminator() *string { + return (*string)(&union.ImageType) +} +func (union *ImageUnion) Normalize() error { + return normalizeUnion(union, imageUnion) +} +func (union *ImageUnion) Simplify() { + simplifyUnion(union, imageUnion) +} + +// +k8s:deepcopy-gen=false +type ImageUnionVisitor struct { + Dockerfile func(*DockerfileImage) error +} + +var dockerfileLocation reflect.Type = reflect.TypeOf(DockerfileLocationVisitor{}) + +func (union DockerfileLocation) Visit(visitor DockerfileLocationVisitor) error { + return visitUnion(union, visitor) +} +func (union *DockerfileLocation) discriminator() *string { + return (*string)(&union.LocationType) +} +func (union *DockerfileLocation) Normalize() error { + return normalizeUnion(union, dockerfileLocation) +} +func (union *DockerfileLocation) Simplify() { + simplifyUnion(union, dockerfileLocation) +} + +// +k8s:deepcopy-gen=false +type DockerfileLocationVisitor struct { + Uri func(string) error + Id func(string) error + Git func(*GitProjectSource) error +} + var k8sLikeComponentLocation reflect.Type = reflect.TypeOf(K8sLikeComponentLocationVisitor{}) func (union K8sLikeComponentLocation) Visit(visitor K8sLikeComponentLocationVisitor) error { @@ -69,6 +111,7 @@ type ComponentUnionVisitor struct { Kubernetes func(*KubernetesComponent) error Openshift func(*OpenshiftComponent) error Volume func(*VolumeComponent) error + Image func(*ImageComponent) error Plugin func(*PluginComponent) error Custom func(*CustomComponent) error } @@ -138,6 +181,7 @@ type ComponentUnionParentOverrideVisitor struct { Kubernetes func(*KubernetesComponentParentOverride) error Openshift func(*OpenshiftComponentParentOverride) error Volume func(*VolumeComponentParentOverride) error + Image func(*ImageComponentParentOverride) error Plugin func(*PluginComponentParentOverride) error } @@ -205,6 +249,26 @@ type K8sLikeComponentLocationParentOverrideVisitor struct { Inlined func(string) error } +var imageUnionParentOverride reflect.Type = reflect.TypeOf(ImageUnionParentOverrideVisitor{}) + +func (union ImageUnionParentOverride) Visit(visitor ImageUnionParentOverrideVisitor) error { + return visitUnion(union, visitor) +} +func (union *ImageUnionParentOverride) discriminator() *string { + return (*string)(&union.ImageType) +} +func (union *ImageUnionParentOverride) Normalize() error { + return normalizeUnion(union, imageUnionParentOverride) +} +func (union *ImageUnionParentOverride) Simplify() { + simplifyUnion(union, imageUnionParentOverride) +} + +// +k8s:deepcopy-gen=false +type ImageUnionParentOverrideVisitor struct { + Dockerfile func(*DockerfileImageParentOverride) error +} + var importReferenceUnionParentOverride reflect.Type = reflect.TypeOf(ImportReferenceUnionParentOverrideVisitor{}) func (union ImportReferenceUnionParentOverride) Visit(visitor ImportReferenceUnionParentOverrideVisitor) error { @@ -248,6 +312,7 @@ type ComponentUnionPluginOverrideParentOverrideVisitor struct { Kubernetes func(*KubernetesComponentPluginOverrideParentOverride) error Openshift func(*OpenshiftComponentPluginOverrideParentOverride) error Volume func(*VolumeComponentPluginOverrideParentOverride) error + Image func(*ImageComponentPluginOverrideParentOverride) error } var commandUnionPluginOverrideParentOverride reflect.Type = reflect.TypeOf(CommandUnionPluginOverrideParentOverrideVisitor{}) @@ -272,6 +337,28 @@ type CommandUnionPluginOverrideParentOverrideVisitor struct { Composite func(*CompositeCommandPluginOverrideParentOverride) error } +var dockerfileLocationParentOverride reflect.Type = reflect.TypeOf(DockerfileLocationParentOverrideVisitor{}) + +func (union DockerfileLocationParentOverride) Visit(visitor DockerfileLocationParentOverrideVisitor) error { + return visitUnion(union, visitor) +} +func (union *DockerfileLocationParentOverride) discriminator() *string { + return (*string)(&union.LocationType) +} +func (union *DockerfileLocationParentOverride) Normalize() error { + return normalizeUnion(union, dockerfileLocationParentOverride) +} +func (union *DockerfileLocationParentOverride) Simplify() { + simplifyUnion(union, dockerfileLocationParentOverride) +} + +// +k8s:deepcopy-gen=false +type DockerfileLocationParentOverrideVisitor struct { + Uri func(string) error + Id func(string) error + Git func(*GitProjectSourceParentOverride) error +} + var k8sLikeComponentLocationPluginOverrideParentOverride reflect.Type = reflect.TypeOf(K8sLikeComponentLocationPluginOverrideParentOverrideVisitor{}) func (union K8sLikeComponentLocationPluginOverrideParentOverride) Visit(visitor K8sLikeComponentLocationPluginOverrideParentOverrideVisitor) error { @@ -293,6 +380,48 @@ type K8sLikeComponentLocationPluginOverrideParentOverrideVisitor struct { Inlined func(string) error } +var imageUnionPluginOverrideParentOverride reflect.Type = reflect.TypeOf(ImageUnionPluginOverrideParentOverrideVisitor{}) + +func (union ImageUnionPluginOverrideParentOverride) Visit(visitor ImageUnionPluginOverrideParentOverrideVisitor) error { + return visitUnion(union, visitor) +} +func (union *ImageUnionPluginOverrideParentOverride) discriminator() *string { + return (*string)(&union.ImageType) +} +func (union *ImageUnionPluginOverrideParentOverride) Normalize() error { + return normalizeUnion(union, imageUnionPluginOverrideParentOverride) +} +func (union *ImageUnionPluginOverrideParentOverride) Simplify() { + simplifyUnion(union, imageUnionPluginOverrideParentOverride) +} + +// +k8s:deepcopy-gen=false +type ImageUnionPluginOverrideParentOverrideVisitor struct { + Dockerfile func(*DockerfileImagePluginOverrideParentOverride) error +} + +var dockerfileLocationPluginOverrideParentOverride reflect.Type = reflect.TypeOf(DockerfileLocationPluginOverrideParentOverrideVisitor{}) + +func (union DockerfileLocationPluginOverrideParentOverride) Visit(visitor DockerfileLocationPluginOverrideParentOverrideVisitor) error { + return visitUnion(union, visitor) +} +func (union *DockerfileLocationPluginOverrideParentOverride) discriminator() *string { + return (*string)(&union.LocationType) +} +func (union *DockerfileLocationPluginOverrideParentOverride) Normalize() error { + return normalizeUnion(union, dockerfileLocationPluginOverrideParentOverride) +} +func (union *DockerfileLocationPluginOverrideParentOverride) Simplify() { + simplifyUnion(union, dockerfileLocationPluginOverrideParentOverride) +} + +// +k8s:deepcopy-gen=false +type DockerfileLocationPluginOverrideParentOverrideVisitor struct { + Uri func(string) error + Id func(string) error + Git func(*GitProjectSourcePluginOverrideParentOverride) error +} + var componentUnionPluginOverride reflect.Type = reflect.TypeOf(ComponentUnionPluginOverrideVisitor{}) func (union ComponentUnionPluginOverride) Visit(visitor ComponentUnionPluginOverrideVisitor) error { @@ -314,6 +443,7 @@ type ComponentUnionPluginOverrideVisitor struct { Kubernetes func(*KubernetesComponentPluginOverride) error Openshift func(*OpenshiftComponentPluginOverride) error Volume func(*VolumeComponentPluginOverride) error + Image func(*ImageComponentPluginOverride) error } var commandUnionPluginOverride reflect.Type = reflect.TypeOf(CommandUnionPluginOverrideVisitor{}) @@ -358,3 +488,45 @@ type K8sLikeComponentLocationPluginOverrideVisitor struct { Uri func(string) error Inlined func(string) error } + +var imageUnionPluginOverride reflect.Type = reflect.TypeOf(ImageUnionPluginOverrideVisitor{}) + +func (union ImageUnionPluginOverride) Visit(visitor ImageUnionPluginOverrideVisitor) error { + return visitUnion(union, visitor) +} +func (union *ImageUnionPluginOverride) discriminator() *string { + return (*string)(&union.ImageType) +} +func (union *ImageUnionPluginOverride) Normalize() error { + return normalizeUnion(union, imageUnionPluginOverride) +} +func (union *ImageUnionPluginOverride) Simplify() { + simplifyUnion(union, imageUnionPluginOverride) +} + +// +k8s:deepcopy-gen=false +type ImageUnionPluginOverrideVisitor struct { + Dockerfile func(*DockerfileImagePluginOverride) error +} + +var dockerfileLocationPluginOverride reflect.Type = reflect.TypeOf(DockerfileLocationPluginOverrideVisitor{}) + +func (union DockerfileLocationPluginOverride) Visit(visitor DockerfileLocationPluginOverrideVisitor) error { + return visitUnion(union, visitor) +} +func (union *DockerfileLocationPluginOverride) discriminator() *string { + return (*string)(&union.LocationType) +} +func (union *DockerfileLocationPluginOverride) Normalize() error { + return normalizeUnion(union, dockerfileLocationPluginOverride) +} +func (union *DockerfileLocationPluginOverride) Simplify() { + simplifyUnion(union, dockerfileLocationPluginOverride) +} + +// +k8s:deepcopy-gen=false +type DockerfileLocationPluginOverrideVisitor struct { + Uri func(string) error + Id func(string) error + Git func(*GitProjectSourcePluginOverride) error +} diff --git a/schemas/latest/dev-workspace-template-spec.json b/schemas/latest/dev-workspace-template-spec.json index bce6f373e..37b22324c 100644 --- a/schemas/latest/dev-workspace-template-spec.json +++ b/schemas/latest/dev-workspace-template-spec.json @@ -68,7 +68,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ] } }, @@ -115,7 +116,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ] } }, @@ -167,7 +169,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ] } }, @@ -234,7 +237,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ] } }, @@ -294,6 +298,11 @@ "volume" ] }, + { + "required": [ + "image" + ] + }, { "required": [ "plugin" @@ -484,6 +493,114 @@ }, "additionalProperties": false }, + "image": { + "description": "Allows specifying the definition of an image for outer loop builds", + "type": "object", + "required": [ + "imageName" + ], + "oneOf": [ + { + "required": [ + "dockerfile" + ] + } + ], + "properties": { + "dockerfile": { + "description": "Allows specifying dockerfile type build", + "type": "object", + "oneOf": [ + { + "required": [ + "uri" + ] + }, + { + "required": [ + "id" + ] + }, + { + "required": [ + "git" + ] + } + ], + "properties": { + "args": { + "description": "The arguments to supply to the dockerfile build.", + "type": "array", + "items": { + "type": "string" + } + }, + "buildContext": { + "description": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container", + "type": "string" + }, + "git": { + "description": "Project's Git source", + "type": "object", + "required": [ + "remotes" + ], + "properties": { + "checkoutFrom": { + "description": "Defines from what the project should be checked out. Required if there are more than one remote configured", + "type": "object", + "properties": { + "remote": { + "description": "The remote name should be used as init. Required if there are more than one remote configured", + "type": "string" + }, + "revision": { + "description": "The revision to checkout from. Should be branch name, tag or commit id. Default branch is used if missing or specified revision is not found.", + "type": "string" + } + }, + "additionalProperties": false + }, + "remotes": { + "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string" + }, + "id": { + "description": "Id in a registry that contains a Dockerfile", + "type": "string" + }, + "registryUrl": { + "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", + "type": "string" + }, + "rootRequired": { + "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", + "type": "boolean" + }, + "uri": { + "description": "URI Reference of a Dockerfile. It can be a full URL or a relative URI from the current devfile as the base URI.", + "type": "string" + } + }, + "additionalProperties": false + }, + "imageName": { + "description": "Name of the image for the resulting outerloop build", + "type": "string" + } + }, + "additionalProperties": false + }, "kubernetes": { "description": "Allows importing into the devworkspace the Kubernetes resources defined in a given manifest. For example this allows reusing the Kubernetes definitions used to deploy some runtime components in production.", "type": "object", @@ -728,7 +845,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ] } }, @@ -772,7 +890,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ] } }, @@ -835,7 +954,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ] } }, @@ -894,6 +1014,11 @@ "required": [ "volume" ] + }, + { + "required": [ + "image" + ] } ], "properties": { @@ -1047,6 +1172,108 @@ }, "additionalProperties": false }, + "image": { + "description": "Allows specifying the definition of an image for outer loop builds", + "type": "object", + "oneOf": [ + { + "required": [ + "dockerfile" + ] + } + ], + "properties": { + "dockerfile": { + "description": "Allows specifying dockerfile type build", + "type": "object", + "oneOf": [ + { + "required": [ + "uri" + ] + }, + { + "required": [ + "id" + ] + }, + { + "required": [ + "git" + ] + } + ], + "properties": { + "args": { + "description": "The arguments to supply to the dockerfile build.", + "type": "array", + "items": { + "type": "string" + } + }, + "buildContext": { + "description": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container", + "type": "string" + }, + "git": { + "description": "Project's Git source", + "type": "object", + "properties": { + "checkoutFrom": { + "description": "Defines from what the project should be checked out. Required if there are more than one remote configured", + "type": "object", + "properties": { + "remote": { + "description": "The remote name should be used as init. Required if there are more than one remote configured", + "type": "string" + }, + "revision": { + "description": "The revision to checkout from. Should be branch name, tag or commit id. Default branch is used if missing or specified revision is not found.", + "type": "string" + } + }, + "additionalProperties": false + }, + "remotes": { + "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string" + }, + "id": { + "description": "Id in a registry that contains a Dockerfile", + "type": "string" + }, + "registryUrl": { + "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", + "type": "string" + }, + "rootRequired": { + "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", + "type": "boolean" + }, + "uri": { + "description": "URI Reference of a Dockerfile. It can be a full URL or a relative URI from the current devfile as the base URI.", + "type": "string" + } + }, + "additionalProperties": false + }, + "imageName": { + "description": "Name of the image for the resulting outerloop build", + "type": "string" + } + }, + "additionalProperties": false + }, "kubernetes": { "description": "Allows importing into the devworkspace the Kubernetes resources defined in a given manifest. For example this allows reusing the Kubernetes definitions used to deploy some runtime components in production.", "type": "object", @@ -1394,7 +1621,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ] } }, @@ -1438,7 +1666,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ] } }, @@ -1501,7 +1730,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ] } }, @@ -1561,6 +1791,11 @@ "volume" ] }, + { + "required": [ + "image" + ] + }, { "required": [ "plugin" @@ -1718,6 +1953,108 @@ }, "additionalProperties": false }, + "image": { + "description": "Allows specifying the definition of an image for outer loop builds", + "type": "object", + "oneOf": [ + { + "required": [ + "dockerfile" + ] + } + ], + "properties": { + "dockerfile": { + "description": "Allows specifying dockerfile type build", + "type": "object", + "oneOf": [ + { + "required": [ + "uri" + ] + }, + { + "required": [ + "id" + ] + }, + { + "required": [ + "git" + ] + } + ], + "properties": { + "args": { + "description": "The arguments to supply to the dockerfile build.", + "type": "array", + "items": { + "type": "string" + } + }, + "buildContext": { + "description": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container", + "type": "string" + }, + "git": { + "description": "Project's Git source", + "type": "object", + "properties": { + "checkoutFrom": { + "description": "Defines from what the project should be checked out. Required if there are more than one remote configured", + "type": "object", + "properties": { + "remote": { + "description": "The remote name should be used as init. Required if there are more than one remote configured", + "type": "string" + }, + "revision": { + "description": "The revision to checkout from. Should be branch name, tag or commit id. Default branch is used if missing or specified revision is not found.", + "type": "string" + } + }, + "additionalProperties": false + }, + "remotes": { + "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string" + }, + "id": { + "description": "Id in a registry that contains a Dockerfile", + "type": "string" + }, + "registryUrl": { + "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", + "type": "string" + }, + "rootRequired": { + "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", + "type": "boolean" + }, + "uri": { + "description": "URI Reference of a Dockerfile. It can be a full URL or a relative URI from the current devfile as the base URI.", + "type": "string" + } + }, + "additionalProperties": false + }, + "imageName": { + "description": "Name of the image for the resulting outerloop build", + "type": "string" + } + }, + "additionalProperties": false + }, "kubernetes": { "description": "Allows importing into the devworkspace the Kubernetes resources defined in a given manifest. For example this allows reusing the Kubernetes definitions used to deploy some runtime components in production.", "type": "object", @@ -1956,7 +2293,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ] } }, @@ -2000,7 +2338,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ] } }, @@ -2063,7 +2402,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ] } }, @@ -2122,6 +2462,11 @@ "required": [ "volume" ] + }, + { + "required": [ + "image" + ] } ], "properties": { @@ -2275,6 +2620,108 @@ }, "additionalProperties": false }, + "image": { + "description": "Allows specifying the definition of an image for outer loop builds", + "type": "object", + "oneOf": [ + { + "required": [ + "dockerfile" + ] + } + ], + "properties": { + "dockerfile": { + "description": "Allows specifying dockerfile type build", + "type": "object", + "oneOf": [ + { + "required": [ + "uri" + ] + }, + { + "required": [ + "id" + ] + }, + { + "required": [ + "git" + ] + } + ], + "properties": { + "args": { + "description": "The arguments to supply to the dockerfile build.", + "type": "array", + "items": { + "type": "string" + } + }, + "buildContext": { + "description": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container", + "type": "string" + }, + "git": { + "description": "Project's Git source", + "type": "object", + "properties": { + "checkoutFrom": { + "description": "Defines from what the project should be checked out. Required if there are more than one remote configured", + "type": "object", + "properties": { + "remote": { + "description": "The remote name should be used as init. Required if there are more than one remote configured", + "type": "string" + }, + "revision": { + "description": "The revision to checkout from. Should be branch name, tag or commit id. Default branch is used if missing or specified revision is not found.", + "type": "string" + } + }, + "additionalProperties": false + }, + "remotes": { + "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string" + }, + "id": { + "description": "Id in a registry that contains a Dockerfile", + "type": "string" + }, + "registryUrl": { + "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", + "type": "string" + }, + "rootRequired": { + "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", + "type": "boolean" + }, + "uri": { + "description": "URI Reference of a Dockerfile. It can be a full URL or a relative URI from the current devfile as the base URI.", + "type": "string" + } + }, + "additionalProperties": false + }, + "imageName": { + "description": "Name of the image for the resulting outerloop build", + "type": "string" + } + }, + "additionalProperties": false + }, "kubernetes": { "description": "Allows importing into the devworkspace the Kubernetes resources defined in a given manifest. For example this allows reusing the Kubernetes definitions used to deploy some runtime components in production.", "type": "object", diff --git a/schemas/latest/dev-workspace-template.json b/schemas/latest/dev-workspace-template.json index 51b86bddb..0ef085b29 100644 --- a/schemas/latest/dev-workspace-template.json +++ b/schemas/latest/dev-workspace-template.json @@ -234,7 +234,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ] } }, @@ -281,7 +282,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ] } }, @@ -333,7 +335,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ] } }, @@ -400,7 +403,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ] } }, @@ -460,6 +464,11 @@ "volume" ] }, + { + "required": [ + "image" + ] + }, { "required": [ "plugin" @@ -650,6 +659,114 @@ }, "additionalProperties": false }, + "image": { + "description": "Allows specifying the definition of an image for outer loop builds", + "type": "object", + "required": [ + "imageName" + ], + "oneOf": [ + { + "required": [ + "dockerfile" + ] + } + ], + "properties": { + "dockerfile": { + "description": "Allows specifying dockerfile type build", + "type": "object", + "oneOf": [ + { + "required": [ + "uri" + ] + }, + { + "required": [ + "id" + ] + }, + { + "required": [ + "git" + ] + } + ], + "properties": { + "args": { + "description": "The arguments to supply to the dockerfile build.", + "type": "array", + "items": { + "type": "string" + } + }, + "buildContext": { + "description": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container", + "type": "string" + }, + "git": { + "description": "Project's Git source", + "type": "object", + "required": [ + "remotes" + ], + "properties": { + "checkoutFrom": { + "description": "Defines from what the project should be checked out. Required if there are more than one remote configured", + "type": "object", + "properties": { + "remote": { + "description": "The remote name should be used as init. Required if there are more than one remote configured", + "type": "string" + }, + "revision": { + "description": "The revision to checkout from. Should be branch name, tag or commit id. Default branch is used if missing or specified revision is not found.", + "type": "string" + } + }, + "additionalProperties": false + }, + "remotes": { + "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string" + }, + "id": { + "description": "Id in a registry that contains a Dockerfile", + "type": "string" + }, + "registryUrl": { + "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", + "type": "string" + }, + "rootRequired": { + "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", + "type": "boolean" + }, + "uri": { + "description": "URI Reference of a Dockerfile. It can be a full URL or a relative URI from the current devfile as the base URI.", + "type": "string" + } + }, + "additionalProperties": false + }, + "imageName": { + "description": "Name of the image for the resulting outerloop build", + "type": "string" + } + }, + "additionalProperties": false + }, "kubernetes": { "description": "Allows importing into the devworkspace the Kubernetes resources defined in a given manifest. For example this allows reusing the Kubernetes definitions used to deploy some runtime components in production.", "type": "object", @@ -894,7 +1011,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ] } }, @@ -938,7 +1056,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ] } }, @@ -1001,7 +1120,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ] } }, @@ -1060,6 +1180,11 @@ "required": [ "volume" ] + }, + { + "required": [ + "image" + ] } ], "properties": { @@ -1213,6 +1338,108 @@ }, "additionalProperties": false }, + "image": { + "description": "Allows specifying the definition of an image for outer loop builds", + "type": "object", + "oneOf": [ + { + "required": [ + "dockerfile" + ] + } + ], + "properties": { + "dockerfile": { + "description": "Allows specifying dockerfile type build", + "type": "object", + "oneOf": [ + { + "required": [ + "uri" + ] + }, + { + "required": [ + "id" + ] + }, + { + "required": [ + "git" + ] + } + ], + "properties": { + "args": { + "description": "The arguments to supply to the dockerfile build.", + "type": "array", + "items": { + "type": "string" + } + }, + "buildContext": { + "description": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container", + "type": "string" + }, + "git": { + "description": "Project's Git source", + "type": "object", + "properties": { + "checkoutFrom": { + "description": "Defines from what the project should be checked out. Required if there are more than one remote configured", + "type": "object", + "properties": { + "remote": { + "description": "The remote name should be used as init. Required if there are more than one remote configured", + "type": "string" + }, + "revision": { + "description": "The revision to checkout from. Should be branch name, tag or commit id. Default branch is used if missing or specified revision is not found.", + "type": "string" + } + }, + "additionalProperties": false + }, + "remotes": { + "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string" + }, + "id": { + "description": "Id in a registry that contains a Dockerfile", + "type": "string" + }, + "registryUrl": { + "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", + "type": "string" + }, + "rootRequired": { + "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", + "type": "boolean" + }, + "uri": { + "description": "URI Reference of a Dockerfile. It can be a full URL or a relative URI from the current devfile as the base URI.", + "type": "string" + } + }, + "additionalProperties": false + }, + "imageName": { + "description": "Name of the image for the resulting outerloop build", + "type": "string" + } + }, + "additionalProperties": false + }, "kubernetes": { "description": "Allows importing into the devworkspace the Kubernetes resources defined in a given manifest. For example this allows reusing the Kubernetes definitions used to deploy some runtime components in production.", "type": "object", @@ -1560,7 +1787,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ] } }, @@ -1604,7 +1832,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ] } }, @@ -1667,7 +1896,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ] } }, @@ -1727,6 +1957,11 @@ "volume" ] }, + { + "required": [ + "image" + ] + }, { "required": [ "plugin" @@ -1884,6 +2119,108 @@ }, "additionalProperties": false }, + "image": { + "description": "Allows specifying the definition of an image for outer loop builds", + "type": "object", + "oneOf": [ + { + "required": [ + "dockerfile" + ] + } + ], + "properties": { + "dockerfile": { + "description": "Allows specifying dockerfile type build", + "type": "object", + "oneOf": [ + { + "required": [ + "uri" + ] + }, + { + "required": [ + "id" + ] + }, + { + "required": [ + "git" + ] + } + ], + "properties": { + "args": { + "description": "The arguments to supply to the dockerfile build.", + "type": "array", + "items": { + "type": "string" + } + }, + "buildContext": { + "description": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container", + "type": "string" + }, + "git": { + "description": "Project's Git source", + "type": "object", + "properties": { + "checkoutFrom": { + "description": "Defines from what the project should be checked out. Required if there are more than one remote configured", + "type": "object", + "properties": { + "remote": { + "description": "The remote name should be used as init. Required if there are more than one remote configured", + "type": "string" + }, + "revision": { + "description": "The revision to checkout from. Should be branch name, tag or commit id. Default branch is used if missing or specified revision is not found.", + "type": "string" + } + }, + "additionalProperties": false + }, + "remotes": { + "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string" + }, + "id": { + "description": "Id in a registry that contains a Dockerfile", + "type": "string" + }, + "registryUrl": { + "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", + "type": "string" + }, + "rootRequired": { + "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", + "type": "boolean" + }, + "uri": { + "description": "URI Reference of a Dockerfile. It can be a full URL or a relative URI from the current devfile as the base URI.", + "type": "string" + } + }, + "additionalProperties": false + }, + "imageName": { + "description": "Name of the image for the resulting outerloop build", + "type": "string" + } + }, + "additionalProperties": false + }, "kubernetes": { "description": "Allows importing into the devworkspace the Kubernetes resources defined in a given manifest. For example this allows reusing the Kubernetes definitions used to deploy some runtime components in production.", "type": "object", @@ -2122,7 +2459,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ] } }, @@ -2166,7 +2504,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ] } }, @@ -2229,7 +2568,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ] } }, @@ -2288,6 +2628,11 @@ "required": [ "volume" ] + }, + { + "required": [ + "image" + ] } ], "properties": { @@ -2441,6 +2786,108 @@ }, "additionalProperties": false }, + "image": { + "description": "Allows specifying the definition of an image for outer loop builds", + "type": "object", + "oneOf": [ + { + "required": [ + "dockerfile" + ] + } + ], + "properties": { + "dockerfile": { + "description": "Allows specifying dockerfile type build", + "type": "object", + "oneOf": [ + { + "required": [ + "uri" + ] + }, + { + "required": [ + "id" + ] + }, + { + "required": [ + "git" + ] + } + ], + "properties": { + "args": { + "description": "The arguments to supply to the dockerfile build.", + "type": "array", + "items": { + "type": "string" + } + }, + "buildContext": { + "description": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container", + "type": "string" + }, + "git": { + "description": "Project's Git source", + "type": "object", + "properties": { + "checkoutFrom": { + "description": "Defines from what the project should be checked out. Required if there are more than one remote configured", + "type": "object", + "properties": { + "remote": { + "description": "The remote name should be used as init. Required if there are more than one remote configured", + "type": "string" + }, + "revision": { + "description": "The revision to checkout from. Should be branch name, tag or commit id. Default branch is used if missing or specified revision is not found.", + "type": "string" + } + }, + "additionalProperties": false + }, + "remotes": { + "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string" + }, + "id": { + "description": "Id in a registry that contains a Dockerfile", + "type": "string" + }, + "registryUrl": { + "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", + "type": "string" + }, + "rootRequired": { + "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", + "type": "boolean" + }, + "uri": { + "description": "URI Reference of a Dockerfile. It can be a full URL or a relative URI from the current devfile as the base URI.", + "type": "string" + } + }, + "additionalProperties": false + }, + "imageName": { + "description": "Name of the image for the resulting outerloop build", + "type": "string" + } + }, + "additionalProperties": false + }, "kubernetes": { "description": "Allows importing into the devworkspace the Kubernetes resources defined in a given manifest. For example this allows reusing the Kubernetes definitions used to deploy some runtime components in production.", "type": "object", diff --git a/schemas/latest/dev-workspace.json b/schemas/latest/dev-workspace.json index 7e5fb3da1..67308765f 100644 --- a/schemas/latest/dev-workspace.json +++ b/schemas/latest/dev-workspace.json @@ -247,7 +247,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ] } }, @@ -294,7 +295,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ] } }, @@ -346,7 +348,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ] } }, @@ -413,7 +416,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ] } }, @@ -473,6 +477,11 @@ "volume" ] }, + { + "required": [ + "image" + ] + }, { "required": [ "plugin" @@ -663,6 +672,114 @@ }, "additionalProperties": false }, + "image": { + "description": "Allows specifying the definition of an image for outer loop builds", + "type": "object", + "required": [ + "imageName" + ], + "oneOf": [ + { + "required": [ + "dockerfile" + ] + } + ], + "properties": { + "dockerfile": { + "description": "Allows specifying dockerfile type build", + "type": "object", + "oneOf": [ + { + "required": [ + "uri" + ] + }, + { + "required": [ + "id" + ] + }, + { + "required": [ + "git" + ] + } + ], + "properties": { + "args": { + "description": "The arguments to supply to the dockerfile build.", + "type": "array", + "items": { + "type": "string" + } + }, + "buildContext": { + "description": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container", + "type": "string" + }, + "git": { + "description": "Project's Git source", + "type": "object", + "required": [ + "remotes" + ], + "properties": { + "checkoutFrom": { + "description": "Defines from what the project should be checked out. Required if there are more than one remote configured", + "type": "object", + "properties": { + "remote": { + "description": "The remote name should be used as init. Required if there are more than one remote configured", + "type": "string" + }, + "revision": { + "description": "The revision to checkout from. Should be branch name, tag or commit id. Default branch is used if missing or specified revision is not found.", + "type": "string" + } + }, + "additionalProperties": false + }, + "remotes": { + "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string" + }, + "id": { + "description": "Id in a registry that contains a Dockerfile", + "type": "string" + }, + "registryUrl": { + "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", + "type": "string" + }, + "rootRequired": { + "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", + "type": "boolean" + }, + "uri": { + "description": "URI Reference of a Dockerfile. It can be a full URL or a relative URI from the current devfile as the base URI.", + "type": "string" + } + }, + "additionalProperties": false + }, + "imageName": { + "description": "Name of the image for the resulting outerloop build", + "type": "string" + } + }, + "additionalProperties": false + }, "kubernetes": { "description": "Allows importing into the devworkspace the Kubernetes resources defined in a given manifest. For example this allows reusing the Kubernetes definitions used to deploy some runtime components in production.", "type": "object", @@ -907,7 +1024,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ] } }, @@ -951,7 +1069,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ] } }, @@ -1014,7 +1133,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ] } }, @@ -1073,6 +1193,11 @@ "required": [ "volume" ] + }, + { + "required": [ + "image" + ] } ], "properties": { @@ -1226,6 +1351,108 @@ }, "additionalProperties": false }, + "image": { + "description": "Allows specifying the definition of an image for outer loop builds", + "type": "object", + "oneOf": [ + { + "required": [ + "dockerfile" + ] + } + ], + "properties": { + "dockerfile": { + "description": "Allows specifying dockerfile type build", + "type": "object", + "oneOf": [ + { + "required": [ + "uri" + ] + }, + { + "required": [ + "id" + ] + }, + { + "required": [ + "git" + ] + } + ], + "properties": { + "args": { + "description": "The arguments to supply to the dockerfile build.", + "type": "array", + "items": { + "type": "string" + } + }, + "buildContext": { + "description": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container", + "type": "string" + }, + "git": { + "description": "Project's Git source", + "type": "object", + "properties": { + "checkoutFrom": { + "description": "Defines from what the project should be checked out. Required if there are more than one remote configured", + "type": "object", + "properties": { + "remote": { + "description": "The remote name should be used as init. Required if there are more than one remote configured", + "type": "string" + }, + "revision": { + "description": "The revision to checkout from. Should be branch name, tag or commit id. Default branch is used if missing or specified revision is not found.", + "type": "string" + } + }, + "additionalProperties": false + }, + "remotes": { + "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string" + }, + "id": { + "description": "Id in a registry that contains a Dockerfile", + "type": "string" + }, + "registryUrl": { + "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", + "type": "string" + }, + "rootRequired": { + "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", + "type": "boolean" + }, + "uri": { + "description": "URI Reference of a Dockerfile. It can be a full URL or a relative URI from the current devfile as the base URI.", + "type": "string" + } + }, + "additionalProperties": false + }, + "imageName": { + "description": "Name of the image for the resulting outerloop build", + "type": "string" + } + }, + "additionalProperties": false + }, "kubernetes": { "description": "Allows importing into the devworkspace the Kubernetes resources defined in a given manifest. For example this allows reusing the Kubernetes definitions used to deploy some runtime components in production.", "type": "object", @@ -1573,7 +1800,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ] } }, @@ -1617,7 +1845,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ] } }, @@ -1680,7 +1909,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ] } }, @@ -1740,6 +1970,11 @@ "volume" ] }, + { + "required": [ + "image" + ] + }, { "required": [ "plugin" @@ -1897,6 +2132,108 @@ }, "additionalProperties": false }, + "image": { + "description": "Allows specifying the definition of an image for outer loop builds", + "type": "object", + "oneOf": [ + { + "required": [ + "dockerfile" + ] + } + ], + "properties": { + "dockerfile": { + "description": "Allows specifying dockerfile type build", + "type": "object", + "oneOf": [ + { + "required": [ + "uri" + ] + }, + { + "required": [ + "id" + ] + }, + { + "required": [ + "git" + ] + } + ], + "properties": { + "args": { + "description": "The arguments to supply to the dockerfile build.", + "type": "array", + "items": { + "type": "string" + } + }, + "buildContext": { + "description": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container", + "type": "string" + }, + "git": { + "description": "Project's Git source", + "type": "object", + "properties": { + "checkoutFrom": { + "description": "Defines from what the project should be checked out. Required if there are more than one remote configured", + "type": "object", + "properties": { + "remote": { + "description": "The remote name should be used as init. Required if there are more than one remote configured", + "type": "string" + }, + "revision": { + "description": "The revision to checkout from. Should be branch name, tag or commit id. Default branch is used if missing or specified revision is not found.", + "type": "string" + } + }, + "additionalProperties": false + }, + "remotes": { + "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string" + }, + "id": { + "description": "Id in a registry that contains a Dockerfile", + "type": "string" + }, + "registryUrl": { + "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", + "type": "string" + }, + "rootRequired": { + "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", + "type": "boolean" + }, + "uri": { + "description": "URI Reference of a Dockerfile. It can be a full URL or a relative URI from the current devfile as the base URI.", + "type": "string" + } + }, + "additionalProperties": false + }, + "imageName": { + "description": "Name of the image for the resulting outerloop build", + "type": "string" + } + }, + "additionalProperties": false + }, "kubernetes": { "description": "Allows importing into the devworkspace the Kubernetes resources defined in a given manifest. For example this allows reusing the Kubernetes definitions used to deploy some runtime components in production.", "type": "object", @@ -2135,7 +2472,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ] } }, @@ -2179,7 +2517,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ] } }, @@ -2242,7 +2581,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ] } }, @@ -2301,6 +2641,11 @@ "required": [ "volume" ] + }, + { + "required": [ + "image" + ] } ], "properties": { @@ -2454,6 +2799,108 @@ }, "additionalProperties": false }, + "image": { + "description": "Allows specifying the definition of an image for outer loop builds", + "type": "object", + "oneOf": [ + { + "required": [ + "dockerfile" + ] + } + ], + "properties": { + "dockerfile": { + "description": "Allows specifying dockerfile type build", + "type": "object", + "oneOf": [ + { + "required": [ + "uri" + ] + }, + { + "required": [ + "id" + ] + }, + { + "required": [ + "git" + ] + } + ], + "properties": { + "args": { + "description": "The arguments to supply to the dockerfile build.", + "type": "array", + "items": { + "type": "string" + } + }, + "buildContext": { + "description": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container", + "type": "string" + }, + "git": { + "description": "Project's Git source", + "type": "object", + "properties": { + "checkoutFrom": { + "description": "Defines from what the project should be checked out. Required if there are more than one remote configured", + "type": "object", + "properties": { + "remote": { + "description": "The remote name should be used as init. Required if there are more than one remote configured", + "type": "string" + }, + "revision": { + "description": "The revision to checkout from. Should be branch name, tag or commit id. Default branch is used if missing or specified revision is not found.", + "type": "string" + } + }, + "additionalProperties": false + }, + "remotes": { + "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string" + }, + "id": { + "description": "Id in a registry that contains a Dockerfile", + "type": "string" + }, + "registryUrl": { + "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", + "type": "string" + }, + "rootRequired": { + "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", + "type": "boolean" + }, + "uri": { + "description": "URI Reference of a Dockerfile. It can be a full URL or a relative URI from the current devfile as the base URI.", + "type": "string" + } + }, + "additionalProperties": false + }, + "imageName": { + "description": "Name of the image for the resulting outerloop build", + "type": "string" + } + }, + "additionalProperties": false + }, "kubernetes": { "description": "Allows importing into the devworkspace the Kubernetes resources defined in a given manifest. For example this allows reusing the Kubernetes definitions used to deploy some runtime components in production.", "type": "object", diff --git a/schemas/latest/devfile.json b/schemas/latest/devfile.json index 802fddb9c..1039162b9 100644 --- a/schemas/latest/devfile.json +++ b/schemas/latest/devfile.json @@ -66,7 +66,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ] } }, @@ -113,7 +114,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ] } }, @@ -184,7 +186,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ] } }, @@ -243,6 +246,11 @@ "required": [ "volume" ] + }, + { + "required": [ + "image" + ] } ], "properties": { @@ -404,6 +412,114 @@ }, "additionalProperties": false }, + "image": { + "description": "Allows specifying the definition of an image for outer loop builds", + "type": "object", + "required": [ + "imageName" + ], + "oneOf": [ + { + "required": [ + "dockerfile" + ] + } + ], + "properties": { + "dockerfile": { + "description": "Allows specifying dockerfile type build", + "type": "object", + "oneOf": [ + { + "required": [ + "uri" + ] + }, + { + "required": [ + "id" + ] + }, + { + "required": [ + "git" + ] + } + ], + "properties": { + "args": { + "description": "The arguments to supply to the dockerfile build.", + "type": "array", + "items": { + "type": "string" + } + }, + "buildContext": { + "description": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container", + "type": "string" + }, + "git": { + "description": "Project's Git source", + "type": "object", + "required": [ + "remotes" + ], + "properties": { + "checkoutFrom": { + "description": "Defines from what the project should be checked out. Required if there are more than one remote configured", + "type": "object", + "properties": { + "remote": { + "description": "The remote name should be used as init. Required if there are more than one remote configured", + "type": "string" + }, + "revision": { + "description": "The revision to checkout from. Should be branch name, tag or commit id. Default branch is used if missing or specified revision is not found.", + "type": "string" + } + }, + "additionalProperties": false + }, + "remotes": { + "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string" + }, + "id": { + "description": "Id in a registry that contains a Dockerfile", + "type": "string" + }, + "registryUrl": { + "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", + "type": "string" + }, + "rootRequired": { + "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", + "type": "boolean" + }, + "uri": { + "description": "URI Reference of a Dockerfile. It can be a full URL or a relative URI from the current devfile as the base URI.", + "type": "string" + } + }, + "additionalProperties": false + }, + "imageName": { + "description": "Name of the image for the resulting outerloop build", + "type": "string" + } + }, + "additionalProperties": false + }, "kubernetes": { "description": "Allows importing into the devworkspace the Kubernetes resources defined in a given manifest. For example this allows reusing the Kubernetes definitions used to deploy some runtime components in production.", "type": "object", @@ -786,7 +902,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ] } }, @@ -830,7 +947,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ] } }, @@ -893,7 +1011,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ] } }, @@ -952,6 +1071,11 @@ "required": [ "volume" ] + }, + { + "required": [ + "image" + ] } ], "properties": { @@ -1105,6 +1229,108 @@ }, "additionalProperties": false }, + "image": { + "description": "Allows specifying the definition of an image for outer loop builds", + "type": "object", + "oneOf": [ + { + "required": [ + "dockerfile" + ] + } + ], + "properties": { + "dockerfile": { + "description": "Allows specifying dockerfile type build", + "type": "object", + "oneOf": [ + { + "required": [ + "uri" + ] + }, + { + "required": [ + "id" + ] + }, + { + "required": [ + "git" + ] + } + ], + "properties": { + "args": { + "description": "The arguments to supply to the dockerfile build.", + "type": "array", + "items": { + "type": "string" + } + }, + "buildContext": { + "description": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container", + "type": "string" + }, + "git": { + "description": "Project's Git source", + "type": "object", + "properties": { + "checkoutFrom": { + "description": "Defines from what the project should be checked out. Required if there are more than one remote configured", + "type": "object", + "properties": { + "remote": { + "description": "The remote name should be used as init. Required if there are more than one remote configured", + "type": "string" + }, + "revision": { + "description": "The revision to checkout from. Should be branch name, tag or commit id. Default branch is used if missing or specified revision is not found.", + "type": "string" + } + }, + "additionalProperties": false + }, + "remotes": { + "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string" + }, + "id": { + "description": "Id in a registry that contains a Dockerfile", + "type": "string" + }, + "registryUrl": { + "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", + "type": "string" + }, + "rootRequired": { + "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", + "type": "boolean" + }, + "uri": { + "description": "URI Reference of a Dockerfile. It can be a full URL or a relative URI from the current devfile as the base URI.", + "type": "string" + } + }, + "additionalProperties": false + }, + "imageName": { + "description": "Name of the image for the resulting outerloop build", + "type": "string" + } + }, + "additionalProperties": false + }, "kubernetes": { "description": "Allows importing into the devworkspace the Kubernetes resources defined in a given manifest. For example this allows reusing the Kubernetes definitions used to deploy some runtime components in production.", "type": "object", diff --git a/schemas/latest/ide-targeted/dev-workspace-template-spec.json b/schemas/latest/ide-targeted/dev-workspace-template-spec.json index d93083551..3205995f7 100644 --- a/schemas/latest/ide-targeted/dev-workspace-template-spec.json +++ b/schemas/latest/ide-targeted/dev-workspace-template-spec.json @@ -71,7 +71,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ], "markdownDescription": "Kind of group the command is part of" } @@ -125,7 +126,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ], "markdownDescription": "Kind of group the command is part of" } @@ -185,7 +187,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ], "markdownDescription": "Kind of group the command is part of" } @@ -260,7 +263,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ], "markdownDescription": "Kind of group the command is part of" } @@ -328,6 +332,11 @@ "volume" ] }, + { + "required": [ + "image" + ] + }, { "required": [ "plugin" @@ -535,6 +544,129 @@ "additionalProperties": false, "markdownDescription": "Custom component whose logic is implementation-dependant and should be provided by the user possibly through some dedicated controller" }, + "image": { + "description": "Allows specifying the definition of an image for outer loop builds", + "type": "object", + "required": [ + "imageName" + ], + "oneOf": [ + { + "required": [ + "dockerfile" + ] + } + ], + "properties": { + "dockerfile": { + "description": "Allows specifying dockerfile type build", + "type": "object", + "oneOf": [ + { + "required": [ + "uri" + ] + }, + { + "required": [ + "id" + ] + }, + { + "required": [ + "git" + ] + } + ], + "properties": { + "args": { + "description": "The arguments to supply to the dockerfile build.", + "type": "array", + "items": { + "type": "string" + }, + "markdownDescription": "The arguments to supply to the dockerfile build." + }, + "buildContext": { + "description": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container", + "type": "string", + "markdownDescription": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container" + }, + "git": { + "description": "Project's Git source", + "type": "object", + "required": [ + "remotes" + ], + "properties": { + "checkoutFrom": { + "description": "Defines from what the project should be checked out. Required if there are more than one remote configured", + "type": "object", + "properties": { + "remote": { + "description": "The remote name should be used as init. Required if there are more than one remote configured", + "type": "string", + "markdownDescription": "The remote name should be used as init. Required if there are more than one remote configured" + }, + "revision": { + "description": "The revision to checkout from. Should be branch name, tag or commit id. Default branch is used if missing or specified revision is not found.", + "type": "string", + "markdownDescription": "The revision to checkout from. Should be branch name, tag or commit id. Default branch is used if missing or specified revision is not found." + } + }, + "additionalProperties": false, + "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" + }, + "remotes": { + "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "markdownDescription": "The remotes map which should be initialized in the git project. Must have at least one remote configured" + } + }, + "additionalProperties": false, + "markdownDescription": "Project's Git source" + }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string", + "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." + }, + "id": { + "description": "Id in a registry that contains a Dockerfile", + "type": "string", + "markdownDescription": "Id in a registry that contains a Dockerfile" + }, + "registryUrl": { + "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", + "type": "string", + "markdownDescription": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used." + }, + "rootRequired": { + "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", + "type": "boolean", + "markdownDescription": "Specify if a privileged builder pod is required.\n\nDefault value is `false`" + }, + "uri": { + "description": "URI Reference of a Dockerfile. It can be a full URL or a relative URI from the current devfile as the base URI.", + "type": "string", + "markdownDescription": "URI Reference of a Dockerfile. It can be a full URL or a relative URI from the current devfile as the base URI." + } + }, + "additionalProperties": false, + "markdownDescription": "Allows specifying dockerfile type build" + }, + "imageName": { + "description": "Name of the image for the resulting outerloop build", + "type": "string", + "markdownDescription": "Name of the image for the resulting outerloop build" + } + }, + "additionalProperties": false, + "markdownDescription": "Allows specifying the definition of an image for outer loop builds" + }, "kubernetes": { "description": "Allows importing into the devworkspace the Kubernetes resources defined in a given manifest. For example this allows reusing the Kubernetes definitions used to deploy some runtime components in production.", "type": "object", @@ -794,7 +926,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ], "markdownDescription": "Kind of group the command is part of" } @@ -845,7 +978,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ], "markdownDescription": "Kind of group the command is part of" } @@ -917,7 +1051,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ], "markdownDescription": "Kind of group the command is part of" } @@ -984,6 +1119,11 @@ "required": [ "volume" ] + }, + { + "required": [ + "image" + ] } ], "properties": { @@ -1154,6 +1294,123 @@ "additionalProperties": false, "markdownDescription": "Allows adding and configuring devworkspace-related containers" }, + "image": { + "description": "Allows specifying the definition of an image for outer loop builds", + "type": "object", + "oneOf": [ + { + "required": [ + "dockerfile" + ] + } + ], + "properties": { + "dockerfile": { + "description": "Allows specifying dockerfile type build", + "type": "object", + "oneOf": [ + { + "required": [ + "uri" + ] + }, + { + "required": [ + "id" + ] + }, + { + "required": [ + "git" + ] + } + ], + "properties": { + "args": { + "description": "The arguments to supply to the dockerfile build.", + "type": "array", + "items": { + "type": "string" + }, + "markdownDescription": "The arguments to supply to the dockerfile build." + }, + "buildContext": { + "description": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container", + "type": "string", + "markdownDescription": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container" + }, + "git": { + "description": "Project's Git source", + "type": "object", + "properties": { + "checkoutFrom": { + "description": "Defines from what the project should be checked out. Required if there are more than one remote configured", + "type": "object", + "properties": { + "remote": { + "description": "The remote name should be used as init. Required if there are more than one remote configured", + "type": "string", + "markdownDescription": "The remote name should be used as init. Required if there are more than one remote configured" + }, + "revision": { + "description": "The revision to checkout from. Should be branch name, tag or commit id. Default branch is used if missing or specified revision is not found.", + "type": "string", + "markdownDescription": "The revision to checkout from. Should be branch name, tag or commit id. Default branch is used if missing or specified revision is not found." + } + }, + "additionalProperties": false, + "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" + }, + "remotes": { + "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "markdownDescription": "The remotes map which should be initialized in the git project. Must have at least one remote configured" + } + }, + "additionalProperties": false, + "markdownDescription": "Project's Git source" + }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string", + "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." + }, + "id": { + "description": "Id in a registry that contains a Dockerfile", + "type": "string", + "markdownDescription": "Id in a registry that contains a Dockerfile" + }, + "registryUrl": { + "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", + "type": "string", + "markdownDescription": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used." + }, + "rootRequired": { + "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", + "type": "boolean", + "markdownDescription": "Specify if a privileged builder pod is required.\n\nDefault value is `false`" + }, + "uri": { + "description": "URI Reference of a Dockerfile. It can be a full URL or a relative URI from the current devfile as the base URI.", + "type": "string", + "markdownDescription": "URI Reference of a Dockerfile. It can be a full URL or a relative URI from the current devfile as the base URI." + } + }, + "additionalProperties": false, + "markdownDescription": "Allows specifying dockerfile type build" + }, + "imageName": { + "description": "Name of the image for the resulting outerloop build", + "type": "string", + "markdownDescription": "Name of the image for the resulting outerloop build" + } + }, + "additionalProperties": false, + "markdownDescription": "Allows specifying the definition of an image for outer loop builds" + }, "kubernetes": { "description": "Allows importing into the devworkspace the Kubernetes resources defined in a given manifest. For example this allows reusing the Kubernetes definitions used to deploy some runtime components in production.", "type": "object", @@ -1539,7 +1796,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ], "markdownDescription": "Kind of group the command is part of" } @@ -1590,7 +1848,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ], "markdownDescription": "Kind of group the command is part of" } @@ -1662,7 +1921,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ], "markdownDescription": "Kind of group the command is part of" } @@ -1730,6 +1990,11 @@ "volume" ] }, + { + "required": [ + "image" + ] + }, { "required": [ "plugin" @@ -1904,6 +2169,123 @@ "additionalProperties": false, "markdownDescription": "Allows adding and configuring devworkspace-related containers" }, + "image": { + "description": "Allows specifying the definition of an image for outer loop builds", + "type": "object", + "oneOf": [ + { + "required": [ + "dockerfile" + ] + } + ], + "properties": { + "dockerfile": { + "description": "Allows specifying dockerfile type build", + "type": "object", + "oneOf": [ + { + "required": [ + "uri" + ] + }, + { + "required": [ + "id" + ] + }, + { + "required": [ + "git" + ] + } + ], + "properties": { + "args": { + "description": "The arguments to supply to the dockerfile build.", + "type": "array", + "items": { + "type": "string" + }, + "markdownDescription": "The arguments to supply to the dockerfile build." + }, + "buildContext": { + "description": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container", + "type": "string", + "markdownDescription": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container" + }, + "git": { + "description": "Project's Git source", + "type": "object", + "properties": { + "checkoutFrom": { + "description": "Defines from what the project should be checked out. Required if there are more than one remote configured", + "type": "object", + "properties": { + "remote": { + "description": "The remote name should be used as init. Required if there are more than one remote configured", + "type": "string", + "markdownDescription": "The remote name should be used as init. Required if there are more than one remote configured" + }, + "revision": { + "description": "The revision to checkout from. Should be branch name, tag or commit id. Default branch is used if missing or specified revision is not found.", + "type": "string", + "markdownDescription": "The revision to checkout from. Should be branch name, tag or commit id. Default branch is used if missing or specified revision is not found." + } + }, + "additionalProperties": false, + "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" + }, + "remotes": { + "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "markdownDescription": "The remotes map which should be initialized in the git project. Must have at least one remote configured" + } + }, + "additionalProperties": false, + "markdownDescription": "Project's Git source" + }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string", + "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." + }, + "id": { + "description": "Id in a registry that contains a Dockerfile", + "type": "string", + "markdownDescription": "Id in a registry that contains a Dockerfile" + }, + "registryUrl": { + "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", + "type": "string", + "markdownDescription": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used." + }, + "rootRequired": { + "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", + "type": "boolean", + "markdownDescription": "Specify if a privileged builder pod is required.\n\nDefault value is `false`" + }, + "uri": { + "description": "URI Reference of a Dockerfile. It can be a full URL or a relative URI from the current devfile as the base URI.", + "type": "string", + "markdownDescription": "URI Reference of a Dockerfile. It can be a full URL or a relative URI from the current devfile as the base URI." + } + }, + "additionalProperties": false, + "markdownDescription": "Allows specifying dockerfile type build" + }, + "imageName": { + "description": "Name of the image for the resulting outerloop build", + "type": "string", + "markdownDescription": "Name of the image for the resulting outerloop build" + } + }, + "additionalProperties": false, + "markdownDescription": "Allows specifying the definition of an image for outer loop builds" + }, "kubernetes": { "description": "Allows importing into the devworkspace the Kubernetes resources defined in a given manifest. For example this allows reusing the Kubernetes definitions used to deploy some runtime components in production.", "type": "object", @@ -2161,7 +2543,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ], "markdownDescription": "Kind of group the command is part of" } @@ -2212,7 +2595,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ], "markdownDescription": "Kind of group the command is part of" } @@ -2284,7 +2668,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ], "markdownDescription": "Kind of group the command is part of" } @@ -2351,6 +2736,11 @@ "required": [ "volume" ] + }, + { + "required": [ + "image" + ] } ], "properties": { @@ -2521,6 +2911,123 @@ "additionalProperties": false, "markdownDescription": "Allows adding and configuring devworkspace-related containers" }, + "image": { + "description": "Allows specifying the definition of an image for outer loop builds", + "type": "object", + "oneOf": [ + { + "required": [ + "dockerfile" + ] + } + ], + "properties": { + "dockerfile": { + "description": "Allows specifying dockerfile type build", + "type": "object", + "oneOf": [ + { + "required": [ + "uri" + ] + }, + { + "required": [ + "id" + ] + }, + { + "required": [ + "git" + ] + } + ], + "properties": { + "args": { + "description": "The arguments to supply to the dockerfile build.", + "type": "array", + "items": { + "type": "string" + }, + "markdownDescription": "The arguments to supply to the dockerfile build." + }, + "buildContext": { + "description": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container", + "type": "string", + "markdownDescription": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container" + }, + "git": { + "description": "Project's Git source", + "type": "object", + "properties": { + "checkoutFrom": { + "description": "Defines from what the project should be checked out. Required if there are more than one remote configured", + "type": "object", + "properties": { + "remote": { + "description": "The remote name should be used as init. Required if there are more than one remote configured", + "type": "string", + "markdownDescription": "The remote name should be used as init. Required if there are more than one remote configured" + }, + "revision": { + "description": "The revision to checkout from. Should be branch name, tag or commit id. Default branch is used if missing or specified revision is not found.", + "type": "string", + "markdownDescription": "The revision to checkout from. Should be branch name, tag or commit id. Default branch is used if missing or specified revision is not found." + } + }, + "additionalProperties": false, + "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" + }, + "remotes": { + "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "markdownDescription": "The remotes map which should be initialized in the git project. Must have at least one remote configured" + } + }, + "additionalProperties": false, + "markdownDescription": "Project's Git source" + }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string", + "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." + }, + "id": { + "description": "Id in a registry that contains a Dockerfile", + "type": "string", + "markdownDescription": "Id in a registry that contains a Dockerfile" + }, + "registryUrl": { + "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", + "type": "string", + "markdownDescription": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used." + }, + "rootRequired": { + "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", + "type": "boolean", + "markdownDescription": "Specify if a privileged builder pod is required.\n\nDefault value is `false`" + }, + "uri": { + "description": "URI Reference of a Dockerfile. It can be a full URL or a relative URI from the current devfile as the base URI.", + "type": "string", + "markdownDescription": "URI Reference of a Dockerfile. It can be a full URL or a relative URI from the current devfile as the base URI." + } + }, + "additionalProperties": false, + "markdownDescription": "Allows specifying dockerfile type build" + }, + "imageName": { + "description": "Name of the image for the resulting outerloop build", + "type": "string", + "markdownDescription": "Name of the image for the resulting outerloop build" + } + }, + "additionalProperties": false, + "markdownDescription": "Allows specifying the definition of an image for outer loop builds" + }, "kubernetes": { "description": "Allows importing into the devworkspace the Kubernetes resources defined in a given manifest. For example this allows reusing the Kubernetes definitions used to deploy some runtime components in production.", "type": "object", diff --git a/schemas/latest/ide-targeted/dev-workspace-template.json b/schemas/latest/ide-targeted/dev-workspace-template.json index 95effe91b..5781411aa 100644 --- a/schemas/latest/ide-targeted/dev-workspace-template.json +++ b/schemas/latest/ide-targeted/dev-workspace-template.json @@ -270,7 +270,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ], "markdownDescription": "Kind of group the command is part of" } @@ -324,7 +325,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ], "markdownDescription": "Kind of group the command is part of" } @@ -384,7 +386,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ], "markdownDescription": "Kind of group the command is part of" } @@ -459,7 +462,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ], "markdownDescription": "Kind of group the command is part of" } @@ -527,6 +531,11 @@ "volume" ] }, + { + "required": [ + "image" + ] + }, { "required": [ "plugin" @@ -734,6 +743,129 @@ "additionalProperties": false, "markdownDescription": "Custom component whose logic is implementation-dependant and should be provided by the user possibly through some dedicated controller" }, + "image": { + "description": "Allows specifying the definition of an image for outer loop builds", + "type": "object", + "required": [ + "imageName" + ], + "oneOf": [ + { + "required": [ + "dockerfile" + ] + } + ], + "properties": { + "dockerfile": { + "description": "Allows specifying dockerfile type build", + "type": "object", + "oneOf": [ + { + "required": [ + "uri" + ] + }, + { + "required": [ + "id" + ] + }, + { + "required": [ + "git" + ] + } + ], + "properties": { + "args": { + "description": "The arguments to supply to the dockerfile build.", + "type": "array", + "items": { + "type": "string" + }, + "markdownDescription": "The arguments to supply to the dockerfile build." + }, + "buildContext": { + "description": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container", + "type": "string", + "markdownDescription": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container" + }, + "git": { + "description": "Project's Git source", + "type": "object", + "required": [ + "remotes" + ], + "properties": { + "checkoutFrom": { + "description": "Defines from what the project should be checked out. Required if there are more than one remote configured", + "type": "object", + "properties": { + "remote": { + "description": "The remote name should be used as init. Required if there are more than one remote configured", + "type": "string", + "markdownDescription": "The remote name should be used as init. Required if there are more than one remote configured" + }, + "revision": { + "description": "The revision to checkout from. Should be branch name, tag or commit id. Default branch is used if missing or specified revision is not found.", + "type": "string", + "markdownDescription": "The revision to checkout from. Should be branch name, tag or commit id. Default branch is used if missing or specified revision is not found." + } + }, + "additionalProperties": false, + "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" + }, + "remotes": { + "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "markdownDescription": "The remotes map which should be initialized in the git project. Must have at least one remote configured" + } + }, + "additionalProperties": false, + "markdownDescription": "Project's Git source" + }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string", + "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." + }, + "id": { + "description": "Id in a registry that contains a Dockerfile", + "type": "string", + "markdownDescription": "Id in a registry that contains a Dockerfile" + }, + "registryUrl": { + "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", + "type": "string", + "markdownDescription": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used." + }, + "rootRequired": { + "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", + "type": "boolean", + "markdownDescription": "Specify if a privileged builder pod is required.\n\nDefault value is `false`" + }, + "uri": { + "description": "URI Reference of a Dockerfile. It can be a full URL or a relative URI from the current devfile as the base URI.", + "type": "string", + "markdownDescription": "URI Reference of a Dockerfile. It can be a full URL or a relative URI from the current devfile as the base URI." + } + }, + "additionalProperties": false, + "markdownDescription": "Allows specifying dockerfile type build" + }, + "imageName": { + "description": "Name of the image for the resulting outerloop build", + "type": "string", + "markdownDescription": "Name of the image for the resulting outerloop build" + } + }, + "additionalProperties": false, + "markdownDescription": "Allows specifying the definition of an image for outer loop builds" + }, "kubernetes": { "description": "Allows importing into the devworkspace the Kubernetes resources defined in a given manifest. For example this allows reusing the Kubernetes definitions used to deploy some runtime components in production.", "type": "object", @@ -993,7 +1125,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ], "markdownDescription": "Kind of group the command is part of" } @@ -1044,7 +1177,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ], "markdownDescription": "Kind of group the command is part of" } @@ -1116,7 +1250,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ], "markdownDescription": "Kind of group the command is part of" } @@ -1183,6 +1318,11 @@ "required": [ "volume" ] + }, + { + "required": [ + "image" + ] } ], "properties": { @@ -1353,6 +1493,123 @@ "additionalProperties": false, "markdownDescription": "Allows adding and configuring devworkspace-related containers" }, + "image": { + "description": "Allows specifying the definition of an image for outer loop builds", + "type": "object", + "oneOf": [ + { + "required": [ + "dockerfile" + ] + } + ], + "properties": { + "dockerfile": { + "description": "Allows specifying dockerfile type build", + "type": "object", + "oneOf": [ + { + "required": [ + "uri" + ] + }, + { + "required": [ + "id" + ] + }, + { + "required": [ + "git" + ] + } + ], + "properties": { + "args": { + "description": "The arguments to supply to the dockerfile build.", + "type": "array", + "items": { + "type": "string" + }, + "markdownDescription": "The arguments to supply to the dockerfile build." + }, + "buildContext": { + "description": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container", + "type": "string", + "markdownDescription": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container" + }, + "git": { + "description": "Project's Git source", + "type": "object", + "properties": { + "checkoutFrom": { + "description": "Defines from what the project should be checked out. Required if there are more than one remote configured", + "type": "object", + "properties": { + "remote": { + "description": "The remote name should be used as init. Required if there are more than one remote configured", + "type": "string", + "markdownDescription": "The remote name should be used as init. Required if there are more than one remote configured" + }, + "revision": { + "description": "The revision to checkout from. Should be branch name, tag or commit id. Default branch is used if missing or specified revision is not found.", + "type": "string", + "markdownDescription": "The revision to checkout from. Should be branch name, tag or commit id. Default branch is used if missing or specified revision is not found." + } + }, + "additionalProperties": false, + "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" + }, + "remotes": { + "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "markdownDescription": "The remotes map which should be initialized in the git project. Must have at least one remote configured" + } + }, + "additionalProperties": false, + "markdownDescription": "Project's Git source" + }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string", + "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." + }, + "id": { + "description": "Id in a registry that contains a Dockerfile", + "type": "string", + "markdownDescription": "Id in a registry that contains a Dockerfile" + }, + "registryUrl": { + "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", + "type": "string", + "markdownDescription": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used." + }, + "rootRequired": { + "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", + "type": "boolean", + "markdownDescription": "Specify if a privileged builder pod is required.\n\nDefault value is `false`" + }, + "uri": { + "description": "URI Reference of a Dockerfile. It can be a full URL or a relative URI from the current devfile as the base URI.", + "type": "string", + "markdownDescription": "URI Reference of a Dockerfile. It can be a full URL or a relative URI from the current devfile as the base URI." + } + }, + "additionalProperties": false, + "markdownDescription": "Allows specifying dockerfile type build" + }, + "imageName": { + "description": "Name of the image for the resulting outerloop build", + "type": "string", + "markdownDescription": "Name of the image for the resulting outerloop build" + } + }, + "additionalProperties": false, + "markdownDescription": "Allows specifying the definition of an image for outer loop builds" + }, "kubernetes": { "description": "Allows importing into the devworkspace the Kubernetes resources defined in a given manifest. For example this allows reusing the Kubernetes definitions used to deploy some runtime components in production.", "type": "object", @@ -1738,7 +1995,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ], "markdownDescription": "Kind of group the command is part of" } @@ -1789,7 +2047,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ], "markdownDescription": "Kind of group the command is part of" } @@ -1861,7 +2120,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ], "markdownDescription": "Kind of group the command is part of" } @@ -1929,6 +2189,11 @@ "volume" ] }, + { + "required": [ + "image" + ] + }, { "required": [ "plugin" @@ -2103,6 +2368,123 @@ "additionalProperties": false, "markdownDescription": "Allows adding and configuring devworkspace-related containers" }, + "image": { + "description": "Allows specifying the definition of an image for outer loop builds", + "type": "object", + "oneOf": [ + { + "required": [ + "dockerfile" + ] + } + ], + "properties": { + "dockerfile": { + "description": "Allows specifying dockerfile type build", + "type": "object", + "oneOf": [ + { + "required": [ + "uri" + ] + }, + { + "required": [ + "id" + ] + }, + { + "required": [ + "git" + ] + } + ], + "properties": { + "args": { + "description": "The arguments to supply to the dockerfile build.", + "type": "array", + "items": { + "type": "string" + }, + "markdownDescription": "The arguments to supply to the dockerfile build." + }, + "buildContext": { + "description": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container", + "type": "string", + "markdownDescription": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container" + }, + "git": { + "description": "Project's Git source", + "type": "object", + "properties": { + "checkoutFrom": { + "description": "Defines from what the project should be checked out. Required if there are more than one remote configured", + "type": "object", + "properties": { + "remote": { + "description": "The remote name should be used as init. Required if there are more than one remote configured", + "type": "string", + "markdownDescription": "The remote name should be used as init. Required if there are more than one remote configured" + }, + "revision": { + "description": "The revision to checkout from. Should be branch name, tag or commit id. Default branch is used if missing or specified revision is not found.", + "type": "string", + "markdownDescription": "The revision to checkout from. Should be branch name, tag or commit id. Default branch is used if missing or specified revision is not found." + } + }, + "additionalProperties": false, + "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" + }, + "remotes": { + "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "markdownDescription": "The remotes map which should be initialized in the git project. Must have at least one remote configured" + } + }, + "additionalProperties": false, + "markdownDescription": "Project's Git source" + }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string", + "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." + }, + "id": { + "description": "Id in a registry that contains a Dockerfile", + "type": "string", + "markdownDescription": "Id in a registry that contains a Dockerfile" + }, + "registryUrl": { + "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", + "type": "string", + "markdownDescription": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used." + }, + "rootRequired": { + "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", + "type": "boolean", + "markdownDescription": "Specify if a privileged builder pod is required.\n\nDefault value is `false`" + }, + "uri": { + "description": "URI Reference of a Dockerfile. It can be a full URL or a relative URI from the current devfile as the base URI.", + "type": "string", + "markdownDescription": "URI Reference of a Dockerfile. It can be a full URL or a relative URI from the current devfile as the base URI." + } + }, + "additionalProperties": false, + "markdownDescription": "Allows specifying dockerfile type build" + }, + "imageName": { + "description": "Name of the image for the resulting outerloop build", + "type": "string", + "markdownDescription": "Name of the image for the resulting outerloop build" + } + }, + "additionalProperties": false, + "markdownDescription": "Allows specifying the definition of an image for outer loop builds" + }, "kubernetes": { "description": "Allows importing into the devworkspace the Kubernetes resources defined in a given manifest. For example this allows reusing the Kubernetes definitions used to deploy some runtime components in production.", "type": "object", @@ -2360,7 +2742,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ], "markdownDescription": "Kind of group the command is part of" } @@ -2411,7 +2794,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ], "markdownDescription": "Kind of group the command is part of" } @@ -2483,7 +2867,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ], "markdownDescription": "Kind of group the command is part of" } @@ -2550,6 +2935,11 @@ "required": [ "volume" ] + }, + { + "required": [ + "image" + ] } ], "properties": { @@ -2720,6 +3110,123 @@ "additionalProperties": false, "markdownDescription": "Allows adding and configuring devworkspace-related containers" }, + "image": { + "description": "Allows specifying the definition of an image for outer loop builds", + "type": "object", + "oneOf": [ + { + "required": [ + "dockerfile" + ] + } + ], + "properties": { + "dockerfile": { + "description": "Allows specifying dockerfile type build", + "type": "object", + "oneOf": [ + { + "required": [ + "uri" + ] + }, + { + "required": [ + "id" + ] + }, + { + "required": [ + "git" + ] + } + ], + "properties": { + "args": { + "description": "The arguments to supply to the dockerfile build.", + "type": "array", + "items": { + "type": "string" + }, + "markdownDescription": "The arguments to supply to the dockerfile build." + }, + "buildContext": { + "description": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container", + "type": "string", + "markdownDescription": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container" + }, + "git": { + "description": "Project's Git source", + "type": "object", + "properties": { + "checkoutFrom": { + "description": "Defines from what the project should be checked out. Required if there are more than one remote configured", + "type": "object", + "properties": { + "remote": { + "description": "The remote name should be used as init. Required if there are more than one remote configured", + "type": "string", + "markdownDescription": "The remote name should be used as init. Required if there are more than one remote configured" + }, + "revision": { + "description": "The revision to checkout from. Should be branch name, tag or commit id. Default branch is used if missing or specified revision is not found.", + "type": "string", + "markdownDescription": "The revision to checkout from. Should be branch name, tag or commit id. Default branch is used if missing or specified revision is not found." + } + }, + "additionalProperties": false, + "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" + }, + "remotes": { + "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "markdownDescription": "The remotes map which should be initialized in the git project. Must have at least one remote configured" + } + }, + "additionalProperties": false, + "markdownDescription": "Project's Git source" + }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string", + "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." + }, + "id": { + "description": "Id in a registry that contains a Dockerfile", + "type": "string", + "markdownDescription": "Id in a registry that contains a Dockerfile" + }, + "registryUrl": { + "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", + "type": "string", + "markdownDescription": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used." + }, + "rootRequired": { + "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", + "type": "boolean", + "markdownDescription": "Specify if a privileged builder pod is required.\n\nDefault value is `false`" + }, + "uri": { + "description": "URI Reference of a Dockerfile. It can be a full URL or a relative URI from the current devfile as the base URI.", + "type": "string", + "markdownDescription": "URI Reference of a Dockerfile. It can be a full URL or a relative URI from the current devfile as the base URI." + } + }, + "additionalProperties": false, + "markdownDescription": "Allows specifying dockerfile type build" + }, + "imageName": { + "description": "Name of the image for the resulting outerloop build", + "type": "string", + "markdownDescription": "Name of the image for the resulting outerloop build" + } + }, + "additionalProperties": false, + "markdownDescription": "Allows specifying the definition of an image for outer loop builds" + }, "kubernetes": { "description": "Allows importing into the devworkspace the Kubernetes resources defined in a given manifest. For example this allows reusing the Kubernetes definitions used to deploy some runtime components in production.", "type": "object", diff --git a/schemas/latest/ide-targeted/dev-workspace.json b/schemas/latest/ide-targeted/dev-workspace.json index 4f3342230..4f9f8e56d 100644 --- a/schemas/latest/ide-targeted/dev-workspace.json +++ b/schemas/latest/ide-targeted/dev-workspace.json @@ -283,7 +283,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ], "markdownDescription": "Kind of group the command is part of" } @@ -337,7 +338,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ], "markdownDescription": "Kind of group the command is part of" } @@ -397,7 +399,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ], "markdownDescription": "Kind of group the command is part of" } @@ -472,7 +475,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ], "markdownDescription": "Kind of group the command is part of" } @@ -540,6 +544,11 @@ "volume" ] }, + { + "required": [ + "image" + ] + }, { "required": [ "plugin" @@ -747,6 +756,129 @@ "additionalProperties": false, "markdownDescription": "Custom component whose logic is implementation-dependant and should be provided by the user possibly through some dedicated controller" }, + "image": { + "description": "Allows specifying the definition of an image for outer loop builds", + "type": "object", + "required": [ + "imageName" + ], + "oneOf": [ + { + "required": [ + "dockerfile" + ] + } + ], + "properties": { + "dockerfile": { + "description": "Allows specifying dockerfile type build", + "type": "object", + "oneOf": [ + { + "required": [ + "uri" + ] + }, + { + "required": [ + "id" + ] + }, + { + "required": [ + "git" + ] + } + ], + "properties": { + "args": { + "description": "The arguments to supply to the dockerfile build.", + "type": "array", + "items": { + "type": "string" + }, + "markdownDescription": "The arguments to supply to the dockerfile build." + }, + "buildContext": { + "description": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container", + "type": "string", + "markdownDescription": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container" + }, + "git": { + "description": "Project's Git source", + "type": "object", + "required": [ + "remotes" + ], + "properties": { + "checkoutFrom": { + "description": "Defines from what the project should be checked out. Required if there are more than one remote configured", + "type": "object", + "properties": { + "remote": { + "description": "The remote name should be used as init. Required if there are more than one remote configured", + "type": "string", + "markdownDescription": "The remote name should be used as init. Required if there are more than one remote configured" + }, + "revision": { + "description": "The revision to checkout from. Should be branch name, tag or commit id. Default branch is used if missing or specified revision is not found.", + "type": "string", + "markdownDescription": "The revision to checkout from. Should be branch name, tag or commit id. Default branch is used if missing or specified revision is not found." + } + }, + "additionalProperties": false, + "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" + }, + "remotes": { + "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "markdownDescription": "The remotes map which should be initialized in the git project. Must have at least one remote configured" + } + }, + "additionalProperties": false, + "markdownDescription": "Project's Git source" + }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string", + "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." + }, + "id": { + "description": "Id in a registry that contains a Dockerfile", + "type": "string", + "markdownDescription": "Id in a registry that contains a Dockerfile" + }, + "registryUrl": { + "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", + "type": "string", + "markdownDescription": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used." + }, + "rootRequired": { + "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", + "type": "boolean", + "markdownDescription": "Specify if a privileged builder pod is required.\n\nDefault value is `false`" + }, + "uri": { + "description": "URI Reference of a Dockerfile. It can be a full URL or a relative URI from the current devfile as the base URI.", + "type": "string", + "markdownDescription": "URI Reference of a Dockerfile. It can be a full URL or a relative URI from the current devfile as the base URI." + } + }, + "additionalProperties": false, + "markdownDescription": "Allows specifying dockerfile type build" + }, + "imageName": { + "description": "Name of the image for the resulting outerloop build", + "type": "string", + "markdownDescription": "Name of the image for the resulting outerloop build" + } + }, + "additionalProperties": false, + "markdownDescription": "Allows specifying the definition of an image for outer loop builds" + }, "kubernetes": { "description": "Allows importing into the devworkspace the Kubernetes resources defined in a given manifest. For example this allows reusing the Kubernetes definitions used to deploy some runtime components in production.", "type": "object", @@ -1006,7 +1138,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ], "markdownDescription": "Kind of group the command is part of" } @@ -1057,7 +1190,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ], "markdownDescription": "Kind of group the command is part of" } @@ -1129,7 +1263,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ], "markdownDescription": "Kind of group the command is part of" } @@ -1196,6 +1331,11 @@ "required": [ "volume" ] + }, + { + "required": [ + "image" + ] } ], "properties": { @@ -1366,6 +1506,123 @@ "additionalProperties": false, "markdownDescription": "Allows adding and configuring devworkspace-related containers" }, + "image": { + "description": "Allows specifying the definition of an image for outer loop builds", + "type": "object", + "oneOf": [ + { + "required": [ + "dockerfile" + ] + } + ], + "properties": { + "dockerfile": { + "description": "Allows specifying dockerfile type build", + "type": "object", + "oneOf": [ + { + "required": [ + "uri" + ] + }, + { + "required": [ + "id" + ] + }, + { + "required": [ + "git" + ] + } + ], + "properties": { + "args": { + "description": "The arguments to supply to the dockerfile build.", + "type": "array", + "items": { + "type": "string" + }, + "markdownDescription": "The arguments to supply to the dockerfile build." + }, + "buildContext": { + "description": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container", + "type": "string", + "markdownDescription": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container" + }, + "git": { + "description": "Project's Git source", + "type": "object", + "properties": { + "checkoutFrom": { + "description": "Defines from what the project should be checked out. Required if there are more than one remote configured", + "type": "object", + "properties": { + "remote": { + "description": "The remote name should be used as init. Required if there are more than one remote configured", + "type": "string", + "markdownDescription": "The remote name should be used as init. Required if there are more than one remote configured" + }, + "revision": { + "description": "The revision to checkout from. Should be branch name, tag or commit id. Default branch is used if missing or specified revision is not found.", + "type": "string", + "markdownDescription": "The revision to checkout from. Should be branch name, tag or commit id. Default branch is used if missing or specified revision is not found." + } + }, + "additionalProperties": false, + "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" + }, + "remotes": { + "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "markdownDescription": "The remotes map which should be initialized in the git project. Must have at least one remote configured" + } + }, + "additionalProperties": false, + "markdownDescription": "Project's Git source" + }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string", + "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." + }, + "id": { + "description": "Id in a registry that contains a Dockerfile", + "type": "string", + "markdownDescription": "Id in a registry that contains a Dockerfile" + }, + "registryUrl": { + "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", + "type": "string", + "markdownDescription": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used." + }, + "rootRequired": { + "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", + "type": "boolean", + "markdownDescription": "Specify if a privileged builder pod is required.\n\nDefault value is `false`" + }, + "uri": { + "description": "URI Reference of a Dockerfile. It can be a full URL or a relative URI from the current devfile as the base URI.", + "type": "string", + "markdownDescription": "URI Reference of a Dockerfile. It can be a full URL or a relative URI from the current devfile as the base URI." + } + }, + "additionalProperties": false, + "markdownDescription": "Allows specifying dockerfile type build" + }, + "imageName": { + "description": "Name of the image for the resulting outerloop build", + "type": "string", + "markdownDescription": "Name of the image for the resulting outerloop build" + } + }, + "additionalProperties": false, + "markdownDescription": "Allows specifying the definition of an image for outer loop builds" + }, "kubernetes": { "description": "Allows importing into the devworkspace the Kubernetes resources defined in a given manifest. For example this allows reusing the Kubernetes definitions used to deploy some runtime components in production.", "type": "object", @@ -1751,7 +2008,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ], "markdownDescription": "Kind of group the command is part of" } @@ -1802,7 +2060,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ], "markdownDescription": "Kind of group the command is part of" } @@ -1874,7 +2133,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ], "markdownDescription": "Kind of group the command is part of" } @@ -1942,6 +2202,11 @@ "volume" ] }, + { + "required": [ + "image" + ] + }, { "required": [ "plugin" @@ -2116,6 +2381,123 @@ "additionalProperties": false, "markdownDescription": "Allows adding and configuring devworkspace-related containers" }, + "image": { + "description": "Allows specifying the definition of an image for outer loop builds", + "type": "object", + "oneOf": [ + { + "required": [ + "dockerfile" + ] + } + ], + "properties": { + "dockerfile": { + "description": "Allows specifying dockerfile type build", + "type": "object", + "oneOf": [ + { + "required": [ + "uri" + ] + }, + { + "required": [ + "id" + ] + }, + { + "required": [ + "git" + ] + } + ], + "properties": { + "args": { + "description": "The arguments to supply to the dockerfile build.", + "type": "array", + "items": { + "type": "string" + }, + "markdownDescription": "The arguments to supply to the dockerfile build." + }, + "buildContext": { + "description": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container", + "type": "string", + "markdownDescription": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container" + }, + "git": { + "description": "Project's Git source", + "type": "object", + "properties": { + "checkoutFrom": { + "description": "Defines from what the project should be checked out. Required if there are more than one remote configured", + "type": "object", + "properties": { + "remote": { + "description": "The remote name should be used as init. Required if there are more than one remote configured", + "type": "string", + "markdownDescription": "The remote name should be used as init. Required if there are more than one remote configured" + }, + "revision": { + "description": "The revision to checkout from. Should be branch name, tag or commit id. Default branch is used if missing or specified revision is not found.", + "type": "string", + "markdownDescription": "The revision to checkout from. Should be branch name, tag or commit id. Default branch is used if missing or specified revision is not found." + } + }, + "additionalProperties": false, + "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" + }, + "remotes": { + "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "markdownDescription": "The remotes map which should be initialized in the git project. Must have at least one remote configured" + } + }, + "additionalProperties": false, + "markdownDescription": "Project's Git source" + }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string", + "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." + }, + "id": { + "description": "Id in a registry that contains a Dockerfile", + "type": "string", + "markdownDescription": "Id in a registry that contains a Dockerfile" + }, + "registryUrl": { + "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", + "type": "string", + "markdownDescription": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used." + }, + "rootRequired": { + "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", + "type": "boolean", + "markdownDescription": "Specify if a privileged builder pod is required.\n\nDefault value is `false`" + }, + "uri": { + "description": "URI Reference of a Dockerfile. It can be a full URL or a relative URI from the current devfile as the base URI.", + "type": "string", + "markdownDescription": "URI Reference of a Dockerfile. It can be a full URL or a relative URI from the current devfile as the base URI." + } + }, + "additionalProperties": false, + "markdownDescription": "Allows specifying dockerfile type build" + }, + "imageName": { + "description": "Name of the image for the resulting outerloop build", + "type": "string", + "markdownDescription": "Name of the image for the resulting outerloop build" + } + }, + "additionalProperties": false, + "markdownDescription": "Allows specifying the definition of an image for outer loop builds" + }, "kubernetes": { "description": "Allows importing into the devworkspace the Kubernetes resources defined in a given manifest. For example this allows reusing the Kubernetes definitions used to deploy some runtime components in production.", "type": "object", @@ -2373,7 +2755,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ], "markdownDescription": "Kind of group the command is part of" } @@ -2424,7 +2807,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ], "markdownDescription": "Kind of group the command is part of" } @@ -2496,7 +2880,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ], "markdownDescription": "Kind of group the command is part of" } @@ -2563,6 +2948,11 @@ "required": [ "volume" ] + }, + { + "required": [ + "image" + ] } ], "properties": { @@ -2733,6 +3123,123 @@ "additionalProperties": false, "markdownDescription": "Allows adding and configuring devworkspace-related containers" }, + "image": { + "description": "Allows specifying the definition of an image for outer loop builds", + "type": "object", + "oneOf": [ + { + "required": [ + "dockerfile" + ] + } + ], + "properties": { + "dockerfile": { + "description": "Allows specifying dockerfile type build", + "type": "object", + "oneOf": [ + { + "required": [ + "uri" + ] + }, + { + "required": [ + "id" + ] + }, + { + "required": [ + "git" + ] + } + ], + "properties": { + "args": { + "description": "The arguments to supply to the dockerfile build.", + "type": "array", + "items": { + "type": "string" + }, + "markdownDescription": "The arguments to supply to the dockerfile build." + }, + "buildContext": { + "description": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container", + "type": "string", + "markdownDescription": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container" + }, + "git": { + "description": "Project's Git source", + "type": "object", + "properties": { + "checkoutFrom": { + "description": "Defines from what the project should be checked out. Required if there are more than one remote configured", + "type": "object", + "properties": { + "remote": { + "description": "The remote name should be used as init. Required if there are more than one remote configured", + "type": "string", + "markdownDescription": "The remote name should be used as init. Required if there are more than one remote configured" + }, + "revision": { + "description": "The revision to checkout from. Should be branch name, tag or commit id. Default branch is used if missing or specified revision is not found.", + "type": "string", + "markdownDescription": "The revision to checkout from. Should be branch name, tag or commit id. Default branch is used if missing or specified revision is not found." + } + }, + "additionalProperties": false, + "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" + }, + "remotes": { + "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "markdownDescription": "The remotes map which should be initialized in the git project. Must have at least one remote configured" + } + }, + "additionalProperties": false, + "markdownDescription": "Project's Git source" + }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string", + "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." + }, + "id": { + "description": "Id in a registry that contains a Dockerfile", + "type": "string", + "markdownDescription": "Id in a registry that contains a Dockerfile" + }, + "registryUrl": { + "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", + "type": "string", + "markdownDescription": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used." + }, + "rootRequired": { + "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", + "type": "boolean", + "markdownDescription": "Specify if a privileged builder pod is required.\n\nDefault value is `false`" + }, + "uri": { + "description": "URI Reference of a Dockerfile. It can be a full URL or a relative URI from the current devfile as the base URI.", + "type": "string", + "markdownDescription": "URI Reference of a Dockerfile. It can be a full URL or a relative URI from the current devfile as the base URI." + } + }, + "additionalProperties": false, + "markdownDescription": "Allows specifying dockerfile type build" + }, + "imageName": { + "description": "Name of the image for the resulting outerloop build", + "type": "string", + "markdownDescription": "Name of the image for the resulting outerloop build" + } + }, + "additionalProperties": false, + "markdownDescription": "Allows specifying the definition of an image for outer loop builds" + }, "kubernetes": { "description": "Allows importing into the devworkspace the Kubernetes resources defined in a given manifest. For example this allows reusing the Kubernetes definitions used to deploy some runtime components in production.", "type": "object", diff --git a/schemas/latest/ide-targeted/devfile.json b/schemas/latest/ide-targeted/devfile.json index 3cae454fb..badcdfc04 100644 --- a/schemas/latest/ide-targeted/devfile.json +++ b/schemas/latest/ide-targeted/devfile.json @@ -69,7 +69,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ], "markdownDescription": "Kind of group the command is part of" } @@ -123,7 +124,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ], "markdownDescription": "Kind of group the command is part of" } @@ -203,7 +205,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ], "markdownDescription": "Kind of group the command is part of" } @@ -270,6 +273,11 @@ "required": [ "volume" ] + }, + { + "required": [ + "image" + ] } ], "properties": { @@ -445,6 +453,129 @@ "additionalProperties": false, "markdownDescription": "Allows adding and configuring devworkspace-related containers" }, + "image": { + "description": "Allows specifying the definition of an image for outer loop builds", + "type": "object", + "required": [ + "imageName" + ], + "oneOf": [ + { + "required": [ + "dockerfile" + ] + } + ], + "properties": { + "dockerfile": { + "description": "Allows specifying dockerfile type build", + "type": "object", + "oneOf": [ + { + "required": [ + "uri" + ] + }, + { + "required": [ + "id" + ] + }, + { + "required": [ + "git" + ] + } + ], + "properties": { + "args": { + "description": "The arguments to supply to the dockerfile build.", + "type": "array", + "items": { + "type": "string" + }, + "markdownDescription": "The arguments to supply to the dockerfile build." + }, + "buildContext": { + "description": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container", + "type": "string", + "markdownDescription": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container" + }, + "git": { + "description": "Project's Git source", + "type": "object", + "required": [ + "remotes" + ], + "properties": { + "checkoutFrom": { + "description": "Defines from what the project should be checked out. Required if there are more than one remote configured", + "type": "object", + "properties": { + "remote": { + "description": "The remote name should be used as init. Required if there are more than one remote configured", + "type": "string", + "markdownDescription": "The remote name should be used as init. Required if there are more than one remote configured" + }, + "revision": { + "description": "The revision to checkout from. Should be branch name, tag or commit id. Default branch is used if missing or specified revision is not found.", + "type": "string", + "markdownDescription": "The revision to checkout from. Should be branch name, tag or commit id. Default branch is used if missing or specified revision is not found." + } + }, + "additionalProperties": false, + "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" + }, + "remotes": { + "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "markdownDescription": "The remotes map which should be initialized in the git project. Must have at least one remote configured" + } + }, + "additionalProperties": false, + "markdownDescription": "Project's Git source" + }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string", + "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." + }, + "id": { + "description": "Id in a registry that contains a Dockerfile", + "type": "string", + "markdownDescription": "Id in a registry that contains a Dockerfile" + }, + "registryUrl": { + "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", + "type": "string", + "markdownDescription": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used." + }, + "rootRequired": { + "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", + "type": "boolean", + "markdownDescription": "Specify if a privileged builder pod is required.\n\nDefault value is `false`" + }, + "uri": { + "description": "URI Reference of a Dockerfile. It can be a full URL or a relative URI from the current devfile as the base URI.", + "type": "string", + "markdownDescription": "URI Reference of a Dockerfile. It can be a full URL or a relative URI from the current devfile as the base URI." + } + }, + "additionalProperties": false, + "markdownDescription": "Allows specifying dockerfile type build" + }, + "imageName": { + "description": "Name of the image for the resulting outerloop build", + "type": "string", + "markdownDescription": "Name of the image for the resulting outerloop build" + } + }, + "additionalProperties": false, + "markdownDescription": "Allows specifying the definition of an image for outer loop builds" + }, "kubernetes": { "description": "Allows importing into the devworkspace the Kubernetes resources defined in a given manifest. For example this allows reusing the Kubernetes definitions used to deploy some runtime components in production.", "type": "object", @@ -868,7 +999,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ], "markdownDescription": "Kind of group the command is part of" } @@ -919,7 +1051,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ], "markdownDescription": "Kind of group the command is part of" } @@ -991,7 +1124,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ], "markdownDescription": "Kind of group the command is part of" } @@ -1058,6 +1192,11 @@ "required": [ "volume" ] + }, + { + "required": [ + "image" + ] } ], "properties": { @@ -1228,6 +1367,123 @@ "additionalProperties": false, "markdownDescription": "Allows adding and configuring devworkspace-related containers" }, + "image": { + "description": "Allows specifying the definition of an image for outer loop builds", + "type": "object", + "oneOf": [ + { + "required": [ + "dockerfile" + ] + } + ], + "properties": { + "dockerfile": { + "description": "Allows specifying dockerfile type build", + "type": "object", + "oneOf": [ + { + "required": [ + "uri" + ] + }, + { + "required": [ + "id" + ] + }, + { + "required": [ + "git" + ] + } + ], + "properties": { + "args": { + "description": "The arguments to supply to the dockerfile build.", + "type": "array", + "items": { + "type": "string" + }, + "markdownDescription": "The arguments to supply to the dockerfile build." + }, + "buildContext": { + "description": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container", + "type": "string", + "markdownDescription": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container" + }, + "git": { + "description": "Project's Git source", + "type": "object", + "properties": { + "checkoutFrom": { + "description": "Defines from what the project should be checked out. Required if there are more than one remote configured", + "type": "object", + "properties": { + "remote": { + "description": "The remote name should be used as init. Required if there are more than one remote configured", + "type": "string", + "markdownDescription": "The remote name should be used as init. Required if there are more than one remote configured" + }, + "revision": { + "description": "The revision to checkout from. Should be branch name, tag or commit id. Default branch is used if missing or specified revision is not found.", + "type": "string", + "markdownDescription": "The revision to checkout from. Should be branch name, tag or commit id. Default branch is used if missing or specified revision is not found." + } + }, + "additionalProperties": false, + "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" + }, + "remotes": { + "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "markdownDescription": "The remotes map which should be initialized in the git project. Must have at least one remote configured" + } + }, + "additionalProperties": false, + "markdownDescription": "Project's Git source" + }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string", + "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." + }, + "id": { + "description": "Id in a registry that contains a Dockerfile", + "type": "string", + "markdownDescription": "Id in a registry that contains a Dockerfile" + }, + "registryUrl": { + "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", + "type": "string", + "markdownDescription": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used." + }, + "rootRequired": { + "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", + "type": "boolean", + "markdownDescription": "Specify if a privileged builder pod is required.\n\nDefault value is `false`" + }, + "uri": { + "description": "URI Reference of a Dockerfile. It can be a full URL or a relative URI from the current devfile as the base URI.", + "type": "string", + "markdownDescription": "URI Reference of a Dockerfile. It can be a full URL or a relative URI from the current devfile as the base URI." + } + }, + "additionalProperties": false, + "markdownDescription": "Allows specifying dockerfile type build" + }, + "imageName": { + "description": "Name of the image for the resulting outerloop build", + "type": "string", + "markdownDescription": "Name of the image for the resulting outerloop build" + } + }, + "additionalProperties": false, + "markdownDescription": "Allows specifying the definition of an image for outer loop builds" + }, "kubernetes": { "description": "Allows importing into the devworkspace the Kubernetes resources defined in a given manifest. For example this allows reusing the Kubernetes definitions used to deploy some runtime components in production.", "type": "object", diff --git a/schemas/latest/ide-targeted/parent-overrides.json b/schemas/latest/ide-targeted/parent-overrides.json index a95eea44c..3c5f83425 100644 --- a/schemas/latest/ide-targeted/parent-overrides.json +++ b/schemas/latest/ide-targeted/parent-overrides.json @@ -60,7 +60,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ], "markdownDescription": "Kind of group the command is part of" } @@ -111,7 +112,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ], "markdownDescription": "Kind of group the command is part of" } @@ -183,7 +185,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ], "markdownDescription": "Kind of group the command is part of" } @@ -251,6 +254,11 @@ "volume" ] }, + { + "required": [ + "image" + ] + }, { "required": [ "plugin" @@ -425,6 +433,123 @@ "additionalProperties": false, "markdownDescription": "Allows adding and configuring devworkspace-related containers" }, + "image": { + "description": "Allows specifying the definition of an image for outer loop builds", + "type": "object", + "oneOf": [ + { + "required": [ + "dockerfile" + ] + } + ], + "properties": { + "dockerfile": { + "description": "Allows specifying dockerfile type build", + "type": "object", + "oneOf": [ + { + "required": [ + "uri" + ] + }, + { + "required": [ + "id" + ] + }, + { + "required": [ + "git" + ] + } + ], + "properties": { + "args": { + "description": "The arguments to supply to the dockerfile build.", + "type": "array", + "items": { + "type": "string" + }, + "markdownDescription": "The arguments to supply to the dockerfile build." + }, + "buildContext": { + "description": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container", + "type": "string", + "markdownDescription": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container" + }, + "git": { + "description": "Project's Git source", + "type": "object", + "properties": { + "checkoutFrom": { + "description": "Defines from what the project should be checked out. Required if there are more than one remote configured", + "type": "object", + "properties": { + "remote": { + "description": "The remote name should be used as init. Required if there are more than one remote configured", + "type": "string", + "markdownDescription": "The remote name should be used as init. Required if there are more than one remote configured" + }, + "revision": { + "description": "The revision to checkout from. Should be branch name, tag or commit id. Default branch is used if missing or specified revision is not found.", + "type": "string", + "markdownDescription": "The revision to checkout from. Should be branch name, tag or commit id. Default branch is used if missing or specified revision is not found." + } + }, + "additionalProperties": false, + "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" + }, + "remotes": { + "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "markdownDescription": "The remotes map which should be initialized in the git project. Must have at least one remote configured" + } + }, + "additionalProperties": false, + "markdownDescription": "Project's Git source" + }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string", + "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." + }, + "id": { + "description": "Id in a registry that contains a Dockerfile", + "type": "string", + "markdownDescription": "Id in a registry that contains a Dockerfile" + }, + "registryUrl": { + "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", + "type": "string", + "markdownDescription": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used." + }, + "rootRequired": { + "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", + "type": "boolean", + "markdownDescription": "Specify if a privileged builder pod is required.\n\nDefault value is `false`" + }, + "uri": { + "description": "URI Reference of a Dockerfile. It can be a full URL or a relative URI from the current devfile as the base URI.", + "type": "string", + "markdownDescription": "URI Reference of a Dockerfile. It can be a full URL or a relative URI from the current devfile as the base URI." + } + }, + "additionalProperties": false, + "markdownDescription": "Allows specifying dockerfile type build" + }, + "imageName": { + "description": "Name of the image for the resulting outerloop build", + "type": "string", + "markdownDescription": "Name of the image for the resulting outerloop build" + } + }, + "additionalProperties": false, + "markdownDescription": "Allows specifying the definition of an image for outer loop builds" + }, "kubernetes": { "description": "Allows importing into the devworkspace the Kubernetes resources defined in a given manifest. For example this allows reusing the Kubernetes definitions used to deploy some runtime components in production.", "type": "object", @@ -682,7 +807,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ], "markdownDescription": "Kind of group the command is part of" } @@ -733,7 +859,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ], "markdownDescription": "Kind of group the command is part of" } @@ -805,7 +932,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ], "markdownDescription": "Kind of group the command is part of" } @@ -872,6 +1000,11 @@ "required": [ "volume" ] + }, + { + "required": [ + "image" + ] } ], "properties": { @@ -1042,6 +1175,123 @@ "additionalProperties": false, "markdownDescription": "Allows adding and configuring devworkspace-related containers" }, + "image": { + "description": "Allows specifying the definition of an image for outer loop builds", + "type": "object", + "oneOf": [ + { + "required": [ + "dockerfile" + ] + } + ], + "properties": { + "dockerfile": { + "description": "Allows specifying dockerfile type build", + "type": "object", + "oneOf": [ + { + "required": [ + "uri" + ] + }, + { + "required": [ + "id" + ] + }, + { + "required": [ + "git" + ] + } + ], + "properties": { + "args": { + "description": "The arguments to supply to the dockerfile build.", + "type": "array", + "items": { + "type": "string" + }, + "markdownDescription": "The arguments to supply to the dockerfile build." + }, + "buildContext": { + "description": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container", + "type": "string", + "markdownDescription": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container" + }, + "git": { + "description": "Project's Git source", + "type": "object", + "properties": { + "checkoutFrom": { + "description": "Defines from what the project should be checked out. Required if there are more than one remote configured", + "type": "object", + "properties": { + "remote": { + "description": "The remote name should be used as init. Required if there are more than one remote configured", + "type": "string", + "markdownDescription": "The remote name should be used as init. Required if there are more than one remote configured" + }, + "revision": { + "description": "The revision to checkout from. Should be branch name, tag or commit id. Default branch is used if missing or specified revision is not found.", + "type": "string", + "markdownDescription": "The revision to checkout from. Should be branch name, tag or commit id. Default branch is used if missing or specified revision is not found." + } + }, + "additionalProperties": false, + "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" + }, + "remotes": { + "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "markdownDescription": "The remotes map which should be initialized in the git project. Must have at least one remote configured" + } + }, + "additionalProperties": false, + "markdownDescription": "Project's Git source" + }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string", + "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." + }, + "id": { + "description": "Id in a registry that contains a Dockerfile", + "type": "string", + "markdownDescription": "Id in a registry that contains a Dockerfile" + }, + "registryUrl": { + "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", + "type": "string", + "markdownDescription": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used." + }, + "rootRequired": { + "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", + "type": "boolean", + "markdownDescription": "Specify if a privileged builder pod is required.\n\nDefault value is `false`" + }, + "uri": { + "description": "URI Reference of a Dockerfile. It can be a full URL or a relative URI from the current devfile as the base URI.", + "type": "string", + "markdownDescription": "URI Reference of a Dockerfile. It can be a full URL or a relative URI from the current devfile as the base URI." + } + }, + "additionalProperties": false, + "markdownDescription": "Allows specifying dockerfile type build" + }, + "imageName": { + "description": "Name of the image for the resulting outerloop build", + "type": "string", + "markdownDescription": "Name of the image for the resulting outerloop build" + } + }, + "additionalProperties": false, + "markdownDescription": "Allows specifying the definition of an image for outer loop builds" + }, "kubernetes": { "description": "Allows importing into the devworkspace the Kubernetes resources defined in a given manifest. For example this allows reusing the Kubernetes definitions used to deploy some runtime components in production.", "type": "object", diff --git a/schemas/latest/ide-targeted/plugin-overrides.json b/schemas/latest/ide-targeted/plugin-overrides.json index 4229e8f0d..823d8398a 100644 --- a/schemas/latest/ide-targeted/plugin-overrides.json +++ b/schemas/latest/ide-targeted/plugin-overrides.json @@ -54,7 +54,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ], "markdownDescription": "Kind of group the command is part of" } @@ -105,7 +106,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ], "markdownDescription": "Kind of group the command is part of" } @@ -177,7 +179,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ], "markdownDescription": "Kind of group the command is part of" } @@ -244,6 +247,11 @@ "required": [ "volume" ] + }, + { + "required": [ + "image" + ] } ], "properties": { @@ -414,6 +422,123 @@ "additionalProperties": false, "markdownDescription": "Allows adding and configuring devworkspace-related containers" }, + "image": { + "description": "Allows specifying the definition of an image for outer loop builds", + "type": "object", + "oneOf": [ + { + "required": [ + "dockerfile" + ] + } + ], + "properties": { + "dockerfile": { + "description": "Allows specifying dockerfile type build", + "type": "object", + "oneOf": [ + { + "required": [ + "uri" + ] + }, + { + "required": [ + "id" + ] + }, + { + "required": [ + "git" + ] + } + ], + "properties": { + "args": { + "description": "The arguments to supply to the dockerfile build.", + "type": "array", + "items": { + "type": "string" + }, + "markdownDescription": "The arguments to supply to the dockerfile build." + }, + "buildContext": { + "description": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container", + "type": "string", + "markdownDescription": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container" + }, + "git": { + "description": "Project's Git source", + "type": "object", + "properties": { + "checkoutFrom": { + "description": "Defines from what the project should be checked out. Required if there are more than one remote configured", + "type": "object", + "properties": { + "remote": { + "description": "The remote name should be used as init. Required if there are more than one remote configured", + "type": "string", + "markdownDescription": "The remote name should be used as init. Required if there are more than one remote configured" + }, + "revision": { + "description": "The revision to checkout from. Should be branch name, tag or commit id. Default branch is used if missing or specified revision is not found.", + "type": "string", + "markdownDescription": "The revision to checkout from. Should be branch name, tag or commit id. Default branch is used if missing or specified revision is not found." + } + }, + "additionalProperties": false, + "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" + }, + "remotes": { + "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "markdownDescription": "The remotes map which should be initialized in the git project. Must have at least one remote configured" + } + }, + "additionalProperties": false, + "markdownDescription": "Project's Git source" + }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string", + "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." + }, + "id": { + "description": "Id in a registry that contains a Dockerfile", + "type": "string", + "markdownDescription": "Id in a registry that contains a Dockerfile" + }, + "registryUrl": { + "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", + "type": "string", + "markdownDescription": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used." + }, + "rootRequired": { + "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", + "type": "boolean", + "markdownDescription": "Specify if a privileged builder pod is required.\n\nDefault value is `false`" + }, + "uri": { + "description": "URI Reference of a Dockerfile. It can be a full URL or a relative URI from the current devfile as the base URI.", + "type": "string", + "markdownDescription": "URI Reference of a Dockerfile. It can be a full URL or a relative URI from the current devfile as the base URI." + } + }, + "additionalProperties": false, + "markdownDescription": "Allows specifying dockerfile type build" + }, + "imageName": { + "description": "Name of the image for the resulting outerloop build", + "type": "string", + "markdownDescription": "Name of the image for the resulting outerloop build" + } + }, + "additionalProperties": false, + "markdownDescription": "Allows specifying the definition of an image for outer loop builds" + }, "kubernetes": { "description": "Allows importing into the devworkspace the Kubernetes resources defined in a given manifest. For example this allows reusing the Kubernetes definitions used to deploy some runtime components in production.", "type": "object", diff --git a/schemas/latest/parent-overrides.json b/schemas/latest/parent-overrides.json index a1b84fe11..44b722b5a 100644 --- a/schemas/latest/parent-overrides.json +++ b/schemas/latest/parent-overrides.json @@ -56,7 +56,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ] } }, @@ -100,7 +101,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ] } }, @@ -163,7 +165,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ] } }, @@ -223,6 +226,11 @@ "volume" ] }, + { + "required": [ + "image" + ] + }, { "required": [ "plugin" @@ -380,6 +388,108 @@ }, "additionalProperties": false }, + "image": { + "description": "Allows specifying the definition of an image for outer loop builds", + "type": "object", + "oneOf": [ + { + "required": [ + "dockerfile" + ] + } + ], + "properties": { + "dockerfile": { + "description": "Allows specifying dockerfile type build", + "type": "object", + "oneOf": [ + { + "required": [ + "uri" + ] + }, + { + "required": [ + "id" + ] + }, + { + "required": [ + "git" + ] + } + ], + "properties": { + "args": { + "description": "The arguments to supply to the dockerfile build.", + "type": "array", + "items": { + "type": "string" + } + }, + "buildContext": { + "description": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container", + "type": "string" + }, + "git": { + "description": "Project's Git source", + "type": "object", + "properties": { + "checkoutFrom": { + "description": "Defines from what the project should be checked out. Required if there are more than one remote configured", + "type": "object", + "properties": { + "remote": { + "description": "The remote name should be used as init. Required if there are more than one remote configured", + "type": "string" + }, + "revision": { + "description": "The revision to checkout from. Should be branch name, tag or commit id. Default branch is used if missing or specified revision is not found.", + "type": "string" + } + }, + "additionalProperties": false + }, + "remotes": { + "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string" + }, + "id": { + "description": "Id in a registry that contains a Dockerfile", + "type": "string" + }, + "registryUrl": { + "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", + "type": "string" + }, + "rootRequired": { + "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", + "type": "boolean" + }, + "uri": { + "description": "URI Reference of a Dockerfile. It can be a full URL or a relative URI from the current devfile as the base URI.", + "type": "string" + } + }, + "additionalProperties": false + }, + "imageName": { + "description": "Name of the image for the resulting outerloop build", + "type": "string" + } + }, + "additionalProperties": false + }, "kubernetes": { "description": "Allows importing into the devworkspace the Kubernetes resources defined in a given manifest. For example this allows reusing the Kubernetes definitions used to deploy some runtime components in production.", "type": "object", @@ -618,7 +728,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ] } }, @@ -662,7 +773,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ] } }, @@ -725,7 +837,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ] } }, @@ -784,6 +897,11 @@ "required": [ "volume" ] + }, + { + "required": [ + "image" + ] } ], "properties": { @@ -937,6 +1055,108 @@ }, "additionalProperties": false }, + "image": { + "description": "Allows specifying the definition of an image for outer loop builds", + "type": "object", + "oneOf": [ + { + "required": [ + "dockerfile" + ] + } + ], + "properties": { + "dockerfile": { + "description": "Allows specifying dockerfile type build", + "type": "object", + "oneOf": [ + { + "required": [ + "uri" + ] + }, + { + "required": [ + "id" + ] + }, + { + "required": [ + "git" + ] + } + ], + "properties": { + "args": { + "description": "The arguments to supply to the dockerfile build.", + "type": "array", + "items": { + "type": "string" + } + }, + "buildContext": { + "description": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container", + "type": "string" + }, + "git": { + "description": "Project's Git source", + "type": "object", + "properties": { + "checkoutFrom": { + "description": "Defines from what the project should be checked out. Required if there are more than one remote configured", + "type": "object", + "properties": { + "remote": { + "description": "The remote name should be used as init. Required if there are more than one remote configured", + "type": "string" + }, + "revision": { + "description": "The revision to checkout from. Should be branch name, tag or commit id. Default branch is used if missing or specified revision is not found.", + "type": "string" + } + }, + "additionalProperties": false + }, + "remotes": { + "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string" + }, + "id": { + "description": "Id in a registry that contains a Dockerfile", + "type": "string" + }, + "registryUrl": { + "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", + "type": "string" + }, + "rootRequired": { + "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", + "type": "boolean" + }, + "uri": { + "description": "URI Reference of a Dockerfile. It can be a full URL or a relative URI from the current devfile as the base URI.", + "type": "string" + } + }, + "additionalProperties": false + }, + "imageName": { + "description": "Name of the image for the resulting outerloop build", + "type": "string" + } + }, + "additionalProperties": false + }, "kubernetes": { "description": "Allows importing into the devworkspace the Kubernetes resources defined in a given manifest. For example this allows reusing the Kubernetes definitions used to deploy some runtime components in production.", "type": "object", diff --git a/schemas/latest/plugin-overrides.json b/schemas/latest/plugin-overrides.json index 740ac699d..d5a7c5d10 100644 --- a/schemas/latest/plugin-overrides.json +++ b/schemas/latest/plugin-overrides.json @@ -51,7 +51,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ] } }, @@ -95,7 +96,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ] } }, @@ -158,7 +160,8 @@ "build", "run", "test", - "debug" + "debug", + "deploy" ] } }, @@ -217,6 +220,11 @@ "required": [ "volume" ] + }, + { + "required": [ + "image" + ] } ], "properties": { @@ -370,6 +378,108 @@ }, "additionalProperties": false }, + "image": { + "description": "Allows specifying the definition of an image for outer loop builds", + "type": "object", + "oneOf": [ + { + "required": [ + "dockerfile" + ] + } + ], + "properties": { + "dockerfile": { + "description": "Allows specifying dockerfile type build", + "type": "object", + "oneOf": [ + { + "required": [ + "uri" + ] + }, + { + "required": [ + "id" + ] + }, + { + "required": [ + "git" + ] + } + ], + "properties": { + "args": { + "description": "The arguments to supply to the dockerfile build.", + "type": "array", + "items": { + "type": "string" + } + }, + "buildContext": { + "description": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container", + "type": "string" + }, + "git": { + "description": "Project's Git source", + "type": "object", + "properties": { + "checkoutFrom": { + "description": "Defines from what the project should be checked out. Required if there are more than one remote configured", + "type": "object", + "properties": { + "remote": { + "description": "The remote name should be used as init. Required if there are more than one remote configured", + "type": "string" + }, + "revision": { + "description": "The revision to checkout from. Should be branch name, tag or commit id. Default branch is used if missing or specified revision is not found.", + "type": "string" + } + }, + "additionalProperties": false + }, + "remotes": { + "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string" + }, + "id": { + "description": "Id in a registry that contains a Dockerfile", + "type": "string" + }, + "registryUrl": { + "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", + "type": "string" + }, + "rootRequired": { + "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", + "type": "boolean" + }, + "uri": { + "description": "URI Reference of a Dockerfile. It can be a full URL or a relative URI from the current devfile as the base URI.", + "type": "string" + } + }, + "additionalProperties": false + }, + "imageName": { + "description": "Name of the image for the resulting outerloop build", + "type": "string" + } + }, + "additionalProperties": false + }, "kubernetes": { "description": "Allows importing into the devworkspace the Kubernetes resources defined in a given manifest. For example this allows reusing the Kubernetes definitions used to deploy some runtime components in production.", "type": "object", From b0da5116fb027b0d839cb0674ed07579997251d9 Mon Sep 17 00:00:00 2001 From: Angel Misevski Date: Tue, 10 Aug 2021 09:30:14 -0400 Subject: [PATCH 2/7] Move GitLocation into Git project source Moves GitLocation in DockerfileImage Image component type under the Git struct to make clear that this field is intended only for use when specifying a git repo. (Files not regenerated for readability) Signed-off-by: Angel Misevski --- .../v1alpha2/component_image_dockerfile.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/pkg/apis/workspaces/v1alpha2/component_image_dockerfile.go b/pkg/apis/workspaces/v1alpha2/component_image_dockerfile.go index cca3349ac..e5b408ce2 100644 --- a/pkg/apis/workspaces/v1alpha2/component_image_dockerfile.go +++ b/pkg/apis/workspaces/v1alpha2/component_image_dockerfile.go @@ -23,10 +23,6 @@ type DockerfileImage struct { // it is recommended to always specify the `regsitryURL` when `Id` is used. // +optional RegistryUrl string `json:"registryUrl,omitempty"` - - // Location of the Dockerfile in the Git repository when using git as Dockerfile src. - // +optional - GitLocation string `json:"gitLocation,omitempty"` } // +union @@ -48,7 +44,7 @@ type DockerfileLocation struct { // Project's Git source // +optional - Git *GitProjectSource `json:"git,omitempty"` + Git *DockerfileGitProjectSource `json:"git,omitempty"` } type Dockerfile struct { @@ -66,3 +62,11 @@ type Dockerfile struct { // +optional RootRequired bool `json:"rootRequired,omitempty"` } + +type DockerfileGitProjectSource struct { + GitProjectSource `json:",inline"` + + // Location of the Dockerfile in the Git repository when using git as Dockerfile src. + // +optional + GitLocation string `json:"gitLocation,omitempty"` +} From 2c6e19434e01986ce7ca336dfb8ffebfe28394c9 Mon Sep 17 00:00:00 2001 From: Maysun J Faisal Date: Wed, 18 Aug 2021 15:17:39 -0400 Subject: [PATCH 3/7] Address PR reviews, update src Signed-off-by: Maysun J Faisal --- ...pace.devfile.io_devworkspaces.v1beta1.yaml | 184 ++++++++++-------- crds/workspace.devfile.io_devworkspaces.yaml | 184 ++++++++++-------- ...file.io_devworkspacetemplates.v1beta1.yaml | 176 ++++++++++------- ...pace.devfile.io_devworkspacetemplates.yaml | 176 ++++++++++------- .../v1alpha1/commands_conversion.go | 83 +++++--- .../v1alpha1/commands_conversion_test.go | 27 +++ .../v1alpha1/components_conversion.go | 3 + .../v1alpha1/components_conversion_test.go | 22 +++ pkg/apis/workspaces/v1alpha1/conversion.go | 13 +- .../v1alpha2/component_image_dockerfile.go | 33 ++-- .../v1alpha2/zz_generated.deepcopy.go | 172 +++++++++++++++- .../v1alpha2/zz_generated.parent_overrides.go | 86 +++++--- .../v1alpha2/zz_generated.plugin_overrides.go | 43 ++-- .../zz_generated.union_definitions.go | 24 +-- .../latest/dev-workspace-template-spec.json | 135 ++++++++----- schemas/latest/dev-workspace-template.json | 135 ++++++++----- schemas/latest/dev-workspace.json | 135 ++++++++----- schemas/latest/devfile.json | 69 ++++--- .../dev-workspace-template-spec.json | 171 +++++++++------- .../ide-targeted/dev-workspace-template.json | 171 +++++++++------- .../latest/ide-targeted/dev-workspace.json | 171 +++++++++------- schemas/latest/ide-targeted/devfile.json | 87 +++++---- .../latest/ide-targeted/parent-overrides.json | 84 ++++---- .../latest/ide-targeted/plugin-overrides.json | 42 ++-- schemas/latest/parent-overrides.json | 66 ++++--- schemas/latest/plugin-overrides.json | 33 ++-- 26 files changed, 1597 insertions(+), 928 deletions(-) diff --git a/crds/workspace.devfile.io_devworkspaces.v1beta1.yaml b/crds/workspace.devfile.io_devworkspaces.v1beta1.yaml index 152ec4969..a89a2c730 100644 --- a/crds/workspace.devfile.io_devworkspaces.v1beta1.yaml +++ b/crds/workspace.devfile.io_devworkspaces.v1beta1.yaml @@ -4624,7 +4624,7 @@ spec: - required: - uri - required: - - id + - registry - required: - git properties: @@ -4640,7 +4640,7 @@ spec: the container type: string git: - description: Project's Git source + description: Dockerfile's Git source properties: checkoutFrom: description: Defines from what the project should @@ -4659,6 +4659,11 @@ spec: revision is not found. type: string type: object + gitLocation: + description: Location of the Dockerfile in the + Git repository when using git as Dockerfile + src. + type: string remotes: additionalProperties: type: string @@ -4669,27 +4674,31 @@ spec: required: - remotes type: object - gitLocation: - description: Location of the Dockerfile in the Git - repository when using git as Dockerfile src. - type: string - id: - description: Id in a registry that contains a Dockerfile - type: string locationType: description: Type of Dockerfile location enum: - Uri - - Id + - Registry - Git type: string - registryUrl: - description: Registry URL to pull the Dockerfile - from when using id as Dockerfile src. To ensure - the dockerfile gets resolved consistently in different - environments, it is recommended to always specify - the `regsitryURL` when `Id` is used. - type: string + registry: + description: Dockerfile's Devfile Registry source + properties: + devfileRegistryUrl: + description: Devfile Registry URL to pull the + Dockerfile from when using the Devfile Registry + as Dockerfile src. To ensure the Dockerfile + gets resolved consistently in different environments, + it is recommended to always specify the `devfileRegistryUrl` + when `Id` is used. + type: string + id: + description: Id in a devfile registry that contains + a Dockerfile + type: string + required: + - id + type: object rootRequired: description: "Specify if a privileged builder pod is required. \n Default value is `false`" @@ -5356,7 +5365,7 @@ spec: - required: - uri - required: - - id + - registry - required: - git properties: @@ -5372,7 +5381,7 @@ spec: to ${PROJECT_ROOT} in the container type: string git: - description: Project's Git source + description: Dockerfile's Git source properties: checkoutFrom: description: Defines from what the @@ -5394,6 +5403,11 @@ spec: revision is not found. type: string type: object + gitLocation: + description: Location of the Dockerfile + in the Git repository when using + git as Dockerfile src. + type: string remotes: additionalProperties: type: string @@ -5403,30 +5417,32 @@ spec: remote configured type: object type: object - gitLocation: - description: Location of the Dockerfile - in the Git repository when using git - as Dockerfile src. - type: string - id: - description: Id in a registry that contains - a Dockerfile - type: string locationType: description: Type of Dockerfile location enum: - Uri - - Id + - Registry - Git type: string - registryUrl: - description: Registry URL to pull the - Dockerfile from when using id as Dockerfile - src. To ensure the dockerfile gets resolved - consistently in different environments, - it is recommended to always specify - the `regsitryURL` when `Id` is used. - type: string + registry: + description: Dockerfile's Devfile Registry + source + properties: + devfileRegistryUrl: + description: Devfile Registry URL + to pull the Dockerfile from when + using the Devfile Registry as Dockerfile + src. To ensure the Dockerfile gets + resolved consistently in different + environments, it is recommended + to always specify the `devfileRegistryUrl` + when `Id` is used. + type: string + id: + description: Id in a devfile registry + that contains a Dockerfile + type: string + type: object rootRequired: description: "Specify if a privileged builder pod is required. \n Default @@ -6208,7 +6224,7 @@ spec: - required: - uri - required: - - id + - registry - required: - git properties: @@ -6224,7 +6240,7 @@ spec: in the container type: string git: - description: Project's Git source + description: Dockerfile's Git source properties: checkoutFrom: description: Defines from what the project @@ -6244,6 +6260,11 @@ spec: not found. type: string type: object + gitLocation: + description: Location of the Dockerfile + in the Git repository when using git as + Dockerfile src. + type: string remotes: additionalProperties: type: string @@ -6252,30 +6273,30 @@ spec: have at least one remote configured type: object type: object - gitLocation: - description: Location of the Dockerfile in the - Git repository when using git as Dockerfile - src. - type: string - id: - description: Id in a registry that contains - a Dockerfile - type: string locationType: description: Type of Dockerfile location enum: - Uri - - Id + - Registry - Git type: string - registryUrl: - description: Registry URL to pull the Dockerfile - from when using id as Dockerfile src. To ensure - the dockerfile gets resolved consistently - in different environments, it is recommended - to always specify the `regsitryURL` when `Id` - is used. - type: string + registry: + description: Dockerfile's Devfile Registry source + properties: + devfileRegistryUrl: + description: Devfile Registry URL to pull + the Dockerfile from when using the Devfile + Registry as Dockerfile src. To ensure + the Dockerfile gets resolved consistently + in different environments, it is recommended + to always specify the `devfileRegistryUrl` + when `Id` is used. + type: string + id: + description: Id in a devfile registry that + contains a Dockerfile + type: string + type: object rootRequired: description: "Specify if a privileged builder pod is required. \n Default value is `false`" @@ -6963,7 +6984,7 @@ spec: - required: - uri - required: - - id + - registry - required: - git properties: @@ -6979,7 +7000,7 @@ spec: to ${PROJECT_ROOT} in the container type: string git: - description: Project's Git source + description: Dockerfile's Git source properties: checkoutFrom: description: Defines from what @@ -7002,6 +7023,11 @@ spec: revision is not found. type: string type: object + gitLocation: + description: Location of the Dockerfile + in the Git repository when using + git as Dockerfile src. + type: string remotes: additionalProperties: type: string @@ -7011,31 +7037,33 @@ spec: one remote configured type: object type: object - gitLocation: - description: Location of the Dockerfile - in the Git repository when using - git as Dockerfile src. - type: string - id: - description: Id in a registry that - contains a Dockerfile - type: string locationType: description: Type of Dockerfile location enum: - Uri - - Id + - Registry - Git type: string - registryUrl: - description: Registry URL to pull - the Dockerfile from when using id - as Dockerfile src. To ensure the - dockerfile gets resolved consistently - in different environments, it is - recommended to always specify the - `regsitryURL` when `Id` is used. - type: string + registry: + description: Dockerfile's Devfile + Registry source + properties: + devfileRegistryUrl: + description: Devfile Registry + URL to pull the Dockerfile from + when using the Devfile Registry + as Dockerfile src. To ensure + the Dockerfile gets resolved + consistently in different environments, + it is recommended to always + specify the `devfileRegistryUrl` + when `Id` is used. + type: string + id: + description: Id in a devfile registry + that contains a Dockerfile + type: string + type: object rootRequired: description: "Specify if a privileged builder pod is required. \n Default diff --git a/crds/workspace.devfile.io_devworkspaces.yaml b/crds/workspace.devfile.io_devworkspaces.yaml index cf9583814..06b46e15d 100644 --- a/crds/workspace.devfile.io_devworkspaces.yaml +++ b/crds/workspace.devfile.io_devworkspaces.yaml @@ -4625,7 +4625,7 @@ spec: - required: - uri - required: - - id + - registry - required: - git properties: @@ -4641,7 +4641,7 @@ spec: the container type: string git: - description: Project's Git source + description: Dockerfile's Git source properties: checkoutFrom: description: Defines from what the project should @@ -4660,6 +4660,11 @@ spec: revision is not found. type: string type: object + gitLocation: + description: Location of the Dockerfile in the + Git repository when using git as Dockerfile + src. + type: string remotes: additionalProperties: type: string @@ -4670,27 +4675,31 @@ spec: required: - remotes type: object - gitLocation: - description: Location of the Dockerfile in the Git - repository when using git as Dockerfile src. - type: string - id: - description: Id in a registry that contains a Dockerfile - type: string locationType: description: Type of Dockerfile location enum: - Uri - - Id + - Registry - Git type: string - registryUrl: - description: Registry URL to pull the Dockerfile - from when using id as Dockerfile src. To ensure - the dockerfile gets resolved consistently in different - environments, it is recommended to always specify - the `regsitryURL` when `Id` is used. - type: string + registry: + description: Dockerfile's Devfile Registry source + properties: + devfileRegistryUrl: + description: Devfile Registry URL to pull the + Dockerfile from when using the Devfile Registry + as Dockerfile src. To ensure the Dockerfile + gets resolved consistently in different environments, + it is recommended to always specify the `devfileRegistryUrl` + when `Id` is used. + type: string + id: + description: Id in a devfile registry that contains + a Dockerfile + type: string + required: + - id + type: object rootRequired: description: "Specify if a privileged builder pod is required. \n Default value is `false`" @@ -5361,7 +5370,7 @@ spec: - required: - uri - required: - - id + - registry - required: - git properties: @@ -5377,7 +5386,7 @@ spec: to ${PROJECT_ROOT} in the container type: string git: - description: Project's Git source + description: Dockerfile's Git source properties: checkoutFrom: description: Defines from what the @@ -5399,6 +5408,11 @@ spec: revision is not found. type: string type: object + gitLocation: + description: Location of the Dockerfile + in the Git repository when using + git as Dockerfile src. + type: string remotes: additionalProperties: type: string @@ -5408,30 +5422,32 @@ spec: remote configured type: object type: object - gitLocation: - description: Location of the Dockerfile - in the Git repository when using git - as Dockerfile src. - type: string - id: - description: Id in a registry that contains - a Dockerfile - type: string locationType: description: Type of Dockerfile location enum: - Uri - - Id + - Registry - Git type: string - registryUrl: - description: Registry URL to pull the - Dockerfile from when using id as Dockerfile - src. To ensure the dockerfile gets resolved - consistently in different environments, - it is recommended to always specify - the `regsitryURL` when `Id` is used. - type: string + registry: + description: Dockerfile's Devfile Registry + source + properties: + devfileRegistryUrl: + description: Devfile Registry URL + to pull the Dockerfile from when + using the Devfile Registry as Dockerfile + src. To ensure the Dockerfile gets + resolved consistently in different + environments, it is recommended + to always specify the `devfileRegistryUrl` + when `Id` is used. + type: string + id: + description: Id in a devfile registry + that contains a Dockerfile + type: string + type: object rootRequired: description: "Specify if a privileged builder pod is required. \n Default @@ -6213,7 +6229,7 @@ spec: - required: - uri - required: - - id + - registry - required: - git properties: @@ -6229,7 +6245,7 @@ spec: in the container type: string git: - description: Project's Git source + description: Dockerfile's Git source properties: checkoutFrom: description: Defines from what the project @@ -6249,6 +6265,11 @@ spec: not found. type: string type: object + gitLocation: + description: Location of the Dockerfile + in the Git repository when using git as + Dockerfile src. + type: string remotes: additionalProperties: type: string @@ -6257,30 +6278,30 @@ spec: have at least one remote configured type: object type: object - gitLocation: - description: Location of the Dockerfile in the - Git repository when using git as Dockerfile - src. - type: string - id: - description: Id in a registry that contains - a Dockerfile - type: string locationType: description: Type of Dockerfile location enum: - Uri - - Id + - Registry - Git type: string - registryUrl: - description: Registry URL to pull the Dockerfile - from when using id as Dockerfile src. To ensure - the dockerfile gets resolved consistently - in different environments, it is recommended - to always specify the `regsitryURL` when `Id` - is used. - type: string + registry: + description: Dockerfile's Devfile Registry source + properties: + devfileRegistryUrl: + description: Devfile Registry URL to pull + the Dockerfile from when using the Devfile + Registry as Dockerfile src. To ensure + the Dockerfile gets resolved consistently + in different environments, it is recommended + to always specify the `devfileRegistryUrl` + when `Id` is used. + type: string + id: + description: Id in a devfile registry that + contains a Dockerfile + type: string + type: object rootRequired: description: "Specify if a privileged builder pod is required. \n Default value is `false`" @@ -6968,7 +6989,7 @@ spec: - required: - uri - required: - - id + - registry - required: - git properties: @@ -6984,7 +7005,7 @@ spec: to ${PROJECT_ROOT} in the container type: string git: - description: Project's Git source + description: Dockerfile's Git source properties: checkoutFrom: description: Defines from what @@ -7007,6 +7028,11 @@ spec: revision is not found. type: string type: object + gitLocation: + description: Location of the Dockerfile + in the Git repository when using + git as Dockerfile src. + type: string remotes: additionalProperties: type: string @@ -7016,31 +7042,33 @@ spec: one remote configured type: object type: object - gitLocation: - description: Location of the Dockerfile - in the Git repository when using - git as Dockerfile src. - type: string - id: - description: Id in a registry that - contains a Dockerfile - type: string locationType: description: Type of Dockerfile location enum: - Uri - - Id + - Registry - Git type: string - registryUrl: - description: Registry URL to pull - the Dockerfile from when using id - as Dockerfile src. To ensure the - dockerfile gets resolved consistently - in different environments, it is - recommended to always specify the - `regsitryURL` when `Id` is used. - type: string + registry: + description: Dockerfile's Devfile + Registry source + properties: + devfileRegistryUrl: + description: Devfile Registry + URL to pull the Dockerfile from + when using the Devfile Registry + as Dockerfile src. To ensure + the Dockerfile gets resolved + consistently in different environments, + it is recommended to always + specify the `devfileRegistryUrl` + when `Id` is used. + type: string + id: + description: Id in a devfile registry + that contains a Dockerfile + type: string + type: object rootRequired: description: "Specify if a privileged builder pod is required. \n Default diff --git a/crds/workspace.devfile.io_devworkspacetemplates.v1beta1.yaml b/crds/workspace.devfile.io_devworkspacetemplates.v1beta1.yaml index ae3fd397d..fad194462 100644 --- a/crds/workspace.devfile.io_devworkspacetemplates.v1beta1.yaml +++ b/crds/workspace.devfile.io_devworkspacetemplates.v1beta1.yaml @@ -4381,7 +4381,7 @@ spec: - required: - uri - required: - - id + - registry - required: - git properties: @@ -4396,7 +4396,7 @@ spec: context. Defaults to ${PROJECT_ROOT} in the container type: string git: - description: Project's Git source + description: Dockerfile's Git source properties: checkoutFrom: description: Defines from what the project should @@ -4415,6 +4415,10 @@ spec: is not found. type: string type: object + gitLocation: + description: Location of the Dockerfile in the Git + repository when using git as Dockerfile src. + type: string remotes: additionalProperties: type: string @@ -4425,27 +4429,31 @@ spec: required: - remotes type: object - gitLocation: - description: Location of the Dockerfile in the Git repository - when using git as Dockerfile src. - type: string - id: - description: Id in a registry that contains a Dockerfile - type: string locationType: description: Type of Dockerfile location enum: - Uri - - Id + - Registry - Git type: string - registryUrl: - description: Registry URL to pull the Dockerfile from - when using id as Dockerfile src. To ensure the dockerfile - gets resolved consistently in different environments, - it is recommended to always specify the `regsitryURL` - when `Id` is used. - type: string + registry: + description: Dockerfile's Devfile Registry source + properties: + devfileRegistryUrl: + description: Devfile Registry URL to pull the Dockerfile + from when using the Devfile Registry as Dockerfile + src. To ensure the Dockerfile gets resolved consistently + in different environments, it is recommended to + always specify the `devfileRegistryUrl` when `Id` + is used. + type: string + id: + description: Id in a devfile registry that contains + a Dockerfile + type: string + required: + - id + type: object rootRequired: description: "Specify if a privileged builder pod is required. \n Default value is `false`" @@ -5094,7 +5102,7 @@ spec: - required: - uri - required: - - id + - registry - required: - git properties: @@ -5110,7 +5118,7 @@ spec: in the container type: string git: - description: Project's Git source + description: Dockerfile's Git source properties: checkoutFrom: description: Defines from what the project @@ -5130,6 +5138,11 @@ spec: is not found. type: string type: object + gitLocation: + description: Location of the Dockerfile + in the Git repository when using git + as Dockerfile src. + type: string remotes: additionalProperties: type: string @@ -5138,30 +5151,31 @@ spec: have at least one remote configured type: object type: object - gitLocation: - description: Location of the Dockerfile in - the Git repository when using git as Dockerfile - src. - type: string - id: - description: Id in a registry that contains - a Dockerfile - type: string locationType: description: Type of Dockerfile location enum: - Uri - - Id + - Registry - Git type: string - registryUrl: - description: Registry URL to pull the Dockerfile - from when using id as Dockerfile src. To - ensure the dockerfile gets resolved consistently - in different environments, it is recommended - to always specify the `regsitryURL` when - `Id` is used. - type: string + registry: + description: Dockerfile's Devfile Registry + source + properties: + devfileRegistryUrl: + description: Devfile Registry URL to pull + the Dockerfile from when using the Devfile + Registry as Dockerfile src. To ensure + the Dockerfile gets resolved consistently + in different environments, it is recommended + to always specify the `devfileRegistryUrl` + when `Id` is used. + type: string + id: + description: Id in a devfile registry + that contains a Dockerfile + type: string + type: object rootRequired: description: "Specify if a privileged builder pod is required. \n Default value is `false`" @@ -5911,7 +5925,7 @@ spec: - required: - uri - required: - - id + - registry - required: - git properties: @@ -5927,7 +5941,7 @@ spec: the container type: string git: - description: Project's Git source + description: Dockerfile's Git source properties: checkoutFrom: description: Defines from what the project should @@ -5946,6 +5960,11 @@ spec: revision is not found. type: string type: object + gitLocation: + description: Location of the Dockerfile in the + Git repository when using git as Dockerfile + src. + type: string remotes: additionalProperties: type: string @@ -5954,27 +5973,29 @@ spec: at least one remote configured type: object type: object - gitLocation: - description: Location of the Dockerfile in the Git - repository when using git as Dockerfile src. - type: string - id: - description: Id in a registry that contains a Dockerfile - type: string locationType: description: Type of Dockerfile location enum: - Uri - - Id + - Registry - Git type: string - registryUrl: - description: Registry URL to pull the Dockerfile - from when using id as Dockerfile src. To ensure - the dockerfile gets resolved consistently in different - environments, it is recommended to always specify - the `regsitryURL` when `Id` is used. - type: string + registry: + description: Dockerfile's Devfile Registry source + properties: + devfileRegistryUrl: + description: Devfile Registry URL to pull the + Dockerfile from when using the Devfile Registry + as Dockerfile src. To ensure the Dockerfile + gets resolved consistently in different environments, + it is recommended to always specify the `devfileRegistryUrl` + when `Id` is used. + type: string + id: + description: Id in a devfile registry that contains + a Dockerfile + type: string + type: object rootRequired: description: "Specify if a privileged builder pod is required. \n Default value is `false`" @@ -6637,7 +6658,7 @@ spec: - required: - uri - required: - - id + - registry - required: - git properties: @@ -6653,7 +6674,7 @@ spec: to ${PROJECT_ROOT} in the container type: string git: - description: Project's Git source + description: Dockerfile's Git source properties: checkoutFrom: description: Defines from what the @@ -6675,6 +6696,11 @@ spec: revision is not found. type: string type: object + gitLocation: + description: Location of the Dockerfile + in the Git repository when using + git as Dockerfile src. + type: string remotes: additionalProperties: type: string @@ -6684,30 +6710,32 @@ spec: remote configured type: object type: object - gitLocation: - description: Location of the Dockerfile - in the Git repository when using git - as Dockerfile src. - type: string - id: - description: Id in a registry that contains - a Dockerfile - type: string locationType: description: Type of Dockerfile location enum: - Uri - - Id + - Registry - Git type: string - registryUrl: - description: Registry URL to pull the - Dockerfile from when using id as Dockerfile - src. To ensure the dockerfile gets resolved - consistently in different environments, - it is recommended to always specify - the `regsitryURL` when `Id` is used. - type: string + registry: + description: Dockerfile's Devfile Registry + source + properties: + devfileRegistryUrl: + description: Devfile Registry URL + to pull the Dockerfile from when + using the Devfile Registry as Dockerfile + src. To ensure the Dockerfile gets + resolved consistently in different + environments, it is recommended + to always specify the `devfileRegistryUrl` + when `Id` is used. + type: string + id: + description: Id in a devfile registry + that contains a Dockerfile + type: string + type: object rootRequired: description: "Specify if a privileged builder pod is required. \n Default diff --git a/crds/workspace.devfile.io_devworkspacetemplates.yaml b/crds/workspace.devfile.io_devworkspacetemplates.yaml index d3e4aa203..ea7ecd7b4 100644 --- a/crds/workspace.devfile.io_devworkspacetemplates.yaml +++ b/crds/workspace.devfile.io_devworkspacetemplates.yaml @@ -4382,7 +4382,7 @@ spec: - required: - uri - required: - - id + - registry - required: - git properties: @@ -4397,7 +4397,7 @@ spec: context. Defaults to ${PROJECT_ROOT} in the container type: string git: - description: Project's Git source + description: Dockerfile's Git source properties: checkoutFrom: description: Defines from what the project should @@ -4416,6 +4416,10 @@ spec: is not found. type: string type: object + gitLocation: + description: Location of the Dockerfile in the Git + repository when using git as Dockerfile src. + type: string remotes: additionalProperties: type: string @@ -4426,27 +4430,31 @@ spec: required: - remotes type: object - gitLocation: - description: Location of the Dockerfile in the Git repository - when using git as Dockerfile src. - type: string - id: - description: Id in a registry that contains a Dockerfile - type: string locationType: description: Type of Dockerfile location enum: - Uri - - Id + - Registry - Git type: string - registryUrl: - description: Registry URL to pull the Dockerfile from - when using id as Dockerfile src. To ensure the dockerfile - gets resolved consistently in different environments, - it is recommended to always specify the `regsitryURL` - when `Id` is used. - type: string + registry: + description: Dockerfile's Devfile Registry source + properties: + devfileRegistryUrl: + description: Devfile Registry URL to pull the Dockerfile + from when using the Devfile Registry as Dockerfile + src. To ensure the Dockerfile gets resolved consistently + in different environments, it is recommended to + always specify the `devfileRegistryUrl` when `Id` + is used. + type: string + id: + description: Id in a devfile registry that contains + a Dockerfile + type: string + required: + - id + type: object rootRequired: description: "Specify if a privileged builder pod is required. \n Default value is `false`" @@ -5099,7 +5107,7 @@ spec: - required: - uri - required: - - id + - registry - required: - git properties: @@ -5115,7 +5123,7 @@ spec: in the container type: string git: - description: Project's Git source + description: Dockerfile's Git source properties: checkoutFrom: description: Defines from what the project @@ -5135,6 +5143,11 @@ spec: is not found. type: string type: object + gitLocation: + description: Location of the Dockerfile + in the Git repository when using git + as Dockerfile src. + type: string remotes: additionalProperties: type: string @@ -5143,30 +5156,31 @@ spec: have at least one remote configured type: object type: object - gitLocation: - description: Location of the Dockerfile in - the Git repository when using git as Dockerfile - src. - type: string - id: - description: Id in a registry that contains - a Dockerfile - type: string locationType: description: Type of Dockerfile location enum: - Uri - - Id + - Registry - Git type: string - registryUrl: - description: Registry URL to pull the Dockerfile - from when using id as Dockerfile src. To - ensure the dockerfile gets resolved consistently - in different environments, it is recommended - to always specify the `regsitryURL` when - `Id` is used. - type: string + registry: + description: Dockerfile's Devfile Registry + source + properties: + devfileRegistryUrl: + description: Devfile Registry URL to pull + the Dockerfile from when using the Devfile + Registry as Dockerfile src. To ensure + the Dockerfile gets resolved consistently + in different environments, it is recommended + to always specify the `devfileRegistryUrl` + when `Id` is used. + type: string + id: + description: Id in a devfile registry + that contains a Dockerfile + type: string + type: object rootRequired: description: "Specify if a privileged builder pod is required. \n Default value is `false`" @@ -5916,7 +5930,7 @@ spec: - required: - uri - required: - - id + - registry - required: - git properties: @@ -5932,7 +5946,7 @@ spec: the container type: string git: - description: Project's Git source + description: Dockerfile's Git source properties: checkoutFrom: description: Defines from what the project should @@ -5951,6 +5965,11 @@ spec: revision is not found. type: string type: object + gitLocation: + description: Location of the Dockerfile in the + Git repository when using git as Dockerfile + src. + type: string remotes: additionalProperties: type: string @@ -5959,27 +5978,29 @@ spec: at least one remote configured type: object type: object - gitLocation: - description: Location of the Dockerfile in the Git - repository when using git as Dockerfile src. - type: string - id: - description: Id in a registry that contains a Dockerfile - type: string locationType: description: Type of Dockerfile location enum: - Uri - - Id + - Registry - Git type: string - registryUrl: - description: Registry URL to pull the Dockerfile - from when using id as Dockerfile src. To ensure - the dockerfile gets resolved consistently in different - environments, it is recommended to always specify - the `regsitryURL` when `Id` is used. - type: string + registry: + description: Dockerfile's Devfile Registry source + properties: + devfileRegistryUrl: + description: Devfile Registry URL to pull the + Dockerfile from when using the Devfile Registry + as Dockerfile src. To ensure the Dockerfile + gets resolved consistently in different environments, + it is recommended to always specify the `devfileRegistryUrl` + when `Id` is used. + type: string + id: + description: Id in a devfile registry that contains + a Dockerfile + type: string + type: object rootRequired: description: "Specify if a privileged builder pod is required. \n Default value is `false`" @@ -6642,7 +6663,7 @@ spec: - required: - uri - required: - - id + - registry - required: - git properties: @@ -6658,7 +6679,7 @@ spec: to ${PROJECT_ROOT} in the container type: string git: - description: Project's Git source + description: Dockerfile's Git source properties: checkoutFrom: description: Defines from what the @@ -6680,6 +6701,11 @@ spec: revision is not found. type: string type: object + gitLocation: + description: Location of the Dockerfile + in the Git repository when using + git as Dockerfile src. + type: string remotes: additionalProperties: type: string @@ -6689,30 +6715,32 @@ spec: remote configured type: object type: object - gitLocation: - description: Location of the Dockerfile - in the Git repository when using git - as Dockerfile src. - type: string - id: - description: Id in a registry that contains - a Dockerfile - type: string locationType: description: Type of Dockerfile location enum: - Uri - - Id + - Registry - Git type: string - registryUrl: - description: Registry URL to pull the - Dockerfile from when using id as Dockerfile - src. To ensure the dockerfile gets resolved - consistently in different environments, - it is recommended to always specify - the `regsitryURL` when `Id` is used. - type: string + registry: + description: Dockerfile's Devfile Registry + source + properties: + devfileRegistryUrl: + description: Devfile Registry URL + to pull the Dockerfile from when + using the Devfile Registry as Dockerfile + src. To ensure the Dockerfile gets + resolved consistently in different + environments, it is recommended + to always specify the `devfileRegistryUrl` + when `Id` is used. + type: string + id: + description: Id in a devfile registry + that contains a Dockerfile + type: string + type: object rootRequired: description: "Specify if a privileged builder pod is required. \n Default diff --git a/pkg/apis/workspaces/v1alpha1/commands_conversion.go b/pkg/apis/workspaces/v1alpha1/commands_conversion.go index 90afd7dd7..b48e3f2ce 100644 --- a/pkg/apis/workspaces/v1alpha1/commands_conversion.go +++ b/pkg/apis/workspaces/v1alpha1/commands_conversion.go @@ -40,38 +40,65 @@ func convertCommandTo_v1alpha2(src *Command, dest *v1alpha2.Command) error { return nil } -func convertCommandFrom_v1alpha2(src *v1alpha2.Command, dest *Command) error { - id := src.Key() - jsonCommand, err := json.Marshal(src) - if err != nil { - return err - } - err = json.Unmarshal(jsonCommand, dest) - if err != nil { - return err +// getGroup returns the group the command belongs to +func getGroup(dc v1alpha2.Command) *v1alpha2.CommandGroup { + switch { + case dc.Composite != nil: + return dc.Composite.Group + case dc.Exec != nil: + return dc.Exec.Group + case dc.Apply != nil: + return dc.Apply.Group + case dc.Custom != nil: + return dc.Custom.Group + + default: + return nil } - var destAttributes map[string]string - if src.Attributes != nil { - destAttributes = make(map[string]string) - err = convertAttributesFrom_v1alpha2(&src.Attributes, destAttributes) +} + +func convertCommandFrom_v1alpha2(src *v1alpha2.Command, dest *Command) error { + if src != nil { + id := src.Key() + + srcCmdGroup := getGroup(*src) + if srcCmdGroup != nil && srcCmdGroup.Kind == v1alpha2.DeployCommandGroupKind { + // skip converting deploy kind commands as deploy kind commands are not supported in v1alpha1 + return nil + } + + jsonCommand, err := json.Marshal(src) if err != nil { return err } - } + err = json.Unmarshal(jsonCommand, dest) + if err != nil { + return err + } + var destAttributes map[string]string + if src.Attributes != nil { + destAttributes = make(map[string]string) + err = convertAttributesFrom_v1alpha2(&src.Attributes, destAttributes) + if err != nil { + return err + } + } - switch { - case dest.Apply != nil: - dest.Apply.Attributes = destAttributes - dest.Apply.Id = id - case dest.Composite != nil: - dest.Composite.Attributes = destAttributes - dest.Composite.Id = id - case dest.Custom != nil: - dest.Custom.Attributes = destAttributes - dest.Custom.Id = id - case dest.Exec != nil: - dest.Exec.Attributes = destAttributes - dest.Exec.Id = id + switch { + case dest.Apply != nil: + dest.Apply.Attributes = destAttributes + dest.Apply.Id = id + case dest.Composite != nil: + dest.Composite.Attributes = destAttributes + dest.Composite.Id = id + case dest.Custom != nil: + dest.Custom.Attributes = destAttributes + dest.Custom.Id = id + case dest.Exec != nil: + dest.Exec.Attributes = destAttributes + dest.Exec.Id = id + } + return err } - return err + return nil } diff --git a/pkg/apis/workspaces/v1alpha1/commands_conversion_test.go b/pkg/apis/workspaces/v1alpha1/commands_conversion_test.go index 24cb00957..d33e6e801 100644 --- a/pkg/apis/workspaces/v1alpha1/commands_conversion_test.go +++ b/pkg/apis/workspaces/v1alpha1/commands_conversion_test.go @@ -33,3 +33,30 @@ func TestCommandConversion_v1alpha1(t *testing.T) { } } } + +func TestCommandConversionFrom_v1alpha2(t *testing.T) { + + src := &v1alpha2.Command{ + Id: "test1", + CommandUnion: v1alpha2.CommandUnion{ + Exec: &v1alpha2.ExecCommand{ + LabeledCommand: v1alpha2.LabeledCommand{ + BaseCommand: v1alpha2.BaseCommand{ + Group: &v1alpha2.CommandGroup{ + Kind: v1alpha2.DeployCommandGroupKind, + }, + }, + }, + }, + }, + } + + output := &Command{} + + err := convertCommandFrom_v1alpha2(src, output) + if !assert.NoError(t, err, "Should not return error when converting from v1alpha2") { + return + } + + assert.Equal(t, &Command{}, output, "Conversion from v1alpha2 should be skipped for deploy kind command") +} diff --git a/pkg/apis/workspaces/v1alpha1/components_conversion.go b/pkg/apis/workspaces/v1alpha1/components_conversion.go index 566f7193e..0398eb256 100644 --- a/pkg/apis/workspaces/v1alpha1/components_conversion.go +++ b/pkg/apis/workspaces/v1alpha1/components_conversion.go @@ -31,6 +31,9 @@ func convertComponentFrom_v1alpha2(src *v1alpha2.Component, dest *Component) err if src.Plugin != nil { // Need to handle plugin components separately. return convertPluginComponentFrom_v1alpha2(src, dest) + } else if src.Image != nil { + // Skip converting an Image component since v1alpha1 does not have an Image component + return nil } name := src.Key() jsonComponent, err := json.Marshal(src) diff --git a/pkg/apis/workspaces/v1alpha1/components_conversion_test.go b/pkg/apis/workspaces/v1alpha1/components_conversion_test.go index e658b7ab6..95be9ca7b 100644 --- a/pkg/apis/workspaces/v1alpha1/components_conversion_test.go +++ b/pkg/apis/workspaces/v1alpha1/components_conversion_test.go @@ -36,3 +36,25 @@ func TestComponentConversion_v1alpha1(t *testing.T) { } } } + +func TestComponentConversionFrom_v1alpha2(t *testing.T) { + + src := &v1alpha2.Component{ + Name: "test1", + ComponentUnion: v1alpha2.ComponentUnion{ + Image: &v1alpha2.ImageComponent{ + Image: v1alpha2.Image{ + ImageName: "image:latest", + }, + }, + }, + } + output := &Component{} + + err := convertComponentFrom_v1alpha2(src, output) + if !assert.NoError(t, err, "Should not return error when converting from v1alpha2") { + return + } + + assert.Equal(t, &Component{}, output, "Conversion from v1alpha2 should be skipped for Image Component") +} diff --git a/pkg/apis/workspaces/v1alpha1/conversion.go b/pkg/apis/workspaces/v1alpha1/conversion.go index 6dadbfce5..f244d80a6 100644 --- a/pkg/apis/workspaces/v1alpha1/conversion.go +++ b/pkg/apis/workspaces/v1alpha1/conversion.go @@ -105,15 +105,12 @@ func convertDevWorkspaceTemplateSpecFrom_v1alpha2(src *v1alpha2.DevWorkspaceTemp } } for _, srcComponent := range src.Components { - // Image Component is not present in v1alpha1 - if srcComponent.Image == nil { - destComponent := Component{} - err := convertComponentFrom_v1alpha2(&srcComponent, &destComponent) - if err != nil { - return err - } - dest.Components = append(dest.Components, destComponent) + destComponent := Component{} + err := convertComponentFrom_v1alpha2(&srcComponent, &destComponent) + if err != nil { + return err } + dest.Components = append(dest.Components, destComponent) } for _, srcProject := range src.Projects { destProject := Project{} diff --git a/pkg/apis/workspaces/v1alpha2/component_image_dockerfile.go b/pkg/apis/workspaces/v1alpha2/component_image_dockerfile.go index e5b408ce2..0eb7e8921 100644 --- a/pkg/apis/workspaces/v1alpha2/component_image_dockerfile.go +++ b/pkg/apis/workspaces/v1alpha2/component_image_dockerfile.go @@ -3,13 +3,13 @@ package v1alpha2 // DockerfileLocationType describes the type of // the location for the Dockerfile outerloop build. // Only one of the following location type may be specified. -// +kubebuilder:validation:Enum=Uri;Id;Git +// +kubebuilder:validation:Enum=Uri;Registry;Git type DockerfileLocationType string const ( - UriLikeDockerfileLocationType DockerfileLocationType = "Uri" - IdLikeDockerfileLocationType DockerfileLocationType = "Id" - GitLikeDockerfileLocationType DockerfileLocationType = "Git" + UriLikeDockerfileLocationType DockerfileLocationType = "Uri" + RegistryLikeDockerfileLocationType DockerfileLocationType = "Registry" + GitLikeDockerfileLocationType DockerfileLocationType = "Git" ) // Dockerfile Image type to specify the outerloop build using a Dockerfile @@ -17,12 +17,6 @@ type DockerfileImage struct { BaseImage `json:",inline"` DockerfileLocation `json:",inline"` Dockerfile `json:",inline"` - - // Registry URL to pull the Dockerfile from when using id as Dockerfile src. - // To ensure the dockerfile gets resolved consistently in different environments, - // it is recommended to always specify the `regsitryURL` when `Id` is used. - // +optional - RegistryUrl string `json:"registryUrl,omitempty"` } // +union @@ -38,11 +32,11 @@ type DockerfileLocation struct { // +optional Uri string `json:"uri,omitempty"` - // Id in a registry that contains a Dockerfile + // Dockerfile's Devfile Registry source // +optional - Id string `json:"id,omitempty"` + Registry *DockerfileDevfileRegistrySource `json:"registry,omitempty"` - // Project's Git source + // Dockerfile's Git source // +optional Git *DockerfileGitProjectSource `json:"git,omitempty"` } @@ -60,7 +54,18 @@ type Dockerfile struct { // // Default value is `false` // +optional - RootRequired bool `json:"rootRequired,omitempty"` + RootRequired *bool `json:"rootRequired,omitempty"` +} + +type DockerfileDevfileRegistrySource struct { + // Id in a devfile registry that contains a Dockerfile + Id string `json:"id"` + + // Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. + // To ensure the Dockerfile gets resolved consistently in different environments, + // it is recommended to always specify the `devfileRegistryUrl` when `Id` is used. + // +optional + DevfileRegistryUrl string `json:"devfileRegistryUrl,omitempty"` } type DockerfileGitProjectSource struct { diff --git a/pkg/apis/workspaces/v1alpha2/zz_generated.deepcopy.go b/pkg/apis/workspaces/v1alpha2/zz_generated.deepcopy.go index 3cc9a602f..20c9ce0cf 100644 --- a/pkg/apis/workspaces/v1alpha2/zz_generated.deepcopy.go +++ b/pkg/apis/workspaces/v1alpha2/zz_generated.deepcopy.go @@ -1683,6 +1683,11 @@ func (in *Dockerfile) DeepCopyInto(out *Dockerfile) { *out = make([]string, len(*in)) copy(*out, *in) } + if in.RootRequired != nil { + in, out := &in.RootRequired, &out.RootRequired + *out = new(bool) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Dockerfile. @@ -1695,6 +1700,130 @@ func (in *Dockerfile) DeepCopy() *Dockerfile { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DockerfileDevfileRegistrySource) DeepCopyInto(out *DockerfileDevfileRegistrySource) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerfileDevfileRegistrySource. +func (in *DockerfileDevfileRegistrySource) DeepCopy() *DockerfileDevfileRegistrySource { + if in == nil { + return nil + } + out := new(DockerfileDevfileRegistrySource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DockerfileDevfileRegistrySourceParentOverride) DeepCopyInto(out *DockerfileDevfileRegistrySourceParentOverride) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerfileDevfileRegistrySourceParentOverride. +func (in *DockerfileDevfileRegistrySourceParentOverride) DeepCopy() *DockerfileDevfileRegistrySourceParentOverride { + if in == nil { + return nil + } + out := new(DockerfileDevfileRegistrySourceParentOverride) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DockerfileDevfileRegistrySourcePluginOverride) DeepCopyInto(out *DockerfileDevfileRegistrySourcePluginOverride) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerfileDevfileRegistrySourcePluginOverride. +func (in *DockerfileDevfileRegistrySourcePluginOverride) DeepCopy() *DockerfileDevfileRegistrySourcePluginOverride { + if in == nil { + return nil + } + out := new(DockerfileDevfileRegistrySourcePluginOverride) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DockerfileDevfileRegistrySourcePluginOverrideParentOverride) DeepCopyInto(out *DockerfileDevfileRegistrySourcePluginOverrideParentOverride) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerfileDevfileRegistrySourcePluginOverrideParentOverride. +func (in *DockerfileDevfileRegistrySourcePluginOverrideParentOverride) DeepCopy() *DockerfileDevfileRegistrySourcePluginOverrideParentOverride { + if in == nil { + return nil + } + out := new(DockerfileDevfileRegistrySourcePluginOverrideParentOverride) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DockerfileGitProjectSource) DeepCopyInto(out *DockerfileGitProjectSource) { + *out = *in + in.GitProjectSource.DeepCopyInto(&out.GitProjectSource) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerfileGitProjectSource. +func (in *DockerfileGitProjectSource) DeepCopy() *DockerfileGitProjectSource { + if in == nil { + return nil + } + out := new(DockerfileGitProjectSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DockerfileGitProjectSourceParentOverride) DeepCopyInto(out *DockerfileGitProjectSourceParentOverride) { + *out = *in + in.GitProjectSourceParentOverride.DeepCopyInto(&out.GitProjectSourceParentOverride) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerfileGitProjectSourceParentOverride. +func (in *DockerfileGitProjectSourceParentOverride) DeepCopy() *DockerfileGitProjectSourceParentOverride { + if in == nil { + return nil + } + out := new(DockerfileGitProjectSourceParentOverride) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DockerfileGitProjectSourcePluginOverride) DeepCopyInto(out *DockerfileGitProjectSourcePluginOverride) { + *out = *in + in.GitProjectSourcePluginOverride.DeepCopyInto(&out.GitProjectSourcePluginOverride) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerfileGitProjectSourcePluginOverride. +func (in *DockerfileGitProjectSourcePluginOverride) DeepCopy() *DockerfileGitProjectSourcePluginOverride { + if in == nil { + return nil + } + out := new(DockerfileGitProjectSourcePluginOverride) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DockerfileGitProjectSourcePluginOverrideParentOverride) DeepCopyInto(out *DockerfileGitProjectSourcePluginOverrideParentOverride) { + *out = *in + in.GitProjectSourcePluginOverrideParentOverride.DeepCopyInto(&out.GitProjectSourcePluginOverrideParentOverride) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerfileGitProjectSourcePluginOverrideParentOverride. +func (in *DockerfileGitProjectSourcePluginOverrideParentOverride) DeepCopy() *DockerfileGitProjectSourcePluginOverrideParentOverride { + if in == nil { + return nil + } + out := new(DockerfileGitProjectSourcePluginOverrideParentOverride) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DockerfileImage) DeepCopyInto(out *DockerfileImage) { *out = *in @@ -1770,9 +1899,14 @@ func (in *DockerfileImagePluginOverrideParentOverride) DeepCopy() *DockerfileIma // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DockerfileLocation) DeepCopyInto(out *DockerfileLocation) { *out = *in + if in.Registry != nil { + in, out := &in.Registry, &out.Registry + *out = new(DockerfileDevfileRegistrySource) + **out = **in + } if in.Git != nil { in, out := &in.Git, &out.Git - *out = new(GitProjectSource) + *out = new(DockerfileGitProjectSource) (*in).DeepCopyInto(*out) } } @@ -1790,9 +1924,14 @@ func (in *DockerfileLocation) DeepCopy() *DockerfileLocation { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DockerfileLocationParentOverride) DeepCopyInto(out *DockerfileLocationParentOverride) { *out = *in + if in.Registry != nil { + in, out := &in.Registry, &out.Registry + *out = new(DockerfileDevfileRegistrySourceParentOverride) + **out = **in + } if in.Git != nil { in, out := &in.Git, &out.Git - *out = new(GitProjectSourceParentOverride) + *out = new(DockerfileGitProjectSourceParentOverride) (*in).DeepCopyInto(*out) } } @@ -1810,9 +1949,14 @@ func (in *DockerfileLocationParentOverride) DeepCopy() *DockerfileLocationParent // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DockerfileLocationPluginOverride) DeepCopyInto(out *DockerfileLocationPluginOverride) { *out = *in + if in.Registry != nil { + in, out := &in.Registry, &out.Registry + *out = new(DockerfileDevfileRegistrySourcePluginOverride) + **out = **in + } if in.Git != nil { in, out := &in.Git, &out.Git - *out = new(GitProjectSourcePluginOverride) + *out = new(DockerfileGitProjectSourcePluginOverride) (*in).DeepCopyInto(*out) } } @@ -1830,9 +1974,14 @@ func (in *DockerfileLocationPluginOverride) DeepCopy() *DockerfileLocationPlugin // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DockerfileLocationPluginOverrideParentOverride) DeepCopyInto(out *DockerfileLocationPluginOverrideParentOverride) { *out = *in + if in.Registry != nil { + in, out := &in.Registry, &out.Registry + *out = new(DockerfileDevfileRegistrySourcePluginOverrideParentOverride) + **out = **in + } if in.Git != nil { in, out := &in.Git, &out.Git - *out = new(GitProjectSourcePluginOverrideParentOverride) + *out = new(DockerfileGitProjectSourcePluginOverrideParentOverride) (*in).DeepCopyInto(*out) } } @@ -1855,6 +2004,11 @@ func (in *DockerfileParentOverride) DeepCopyInto(out *DockerfileParentOverride) *out = make([]string, len(*in)) copy(*out, *in) } + if in.RootRequired != nil { + in, out := &in.RootRequired, &out.RootRequired + *out = new(bool) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerfileParentOverride. @@ -1875,6 +2029,11 @@ func (in *DockerfilePluginOverride) DeepCopyInto(out *DockerfilePluginOverride) *out = make([]string, len(*in)) copy(*out, *in) } + if in.RootRequired != nil { + in, out := &in.RootRequired, &out.RootRequired + *out = new(bool) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerfilePluginOverride. @@ -1895,6 +2054,11 @@ func (in *DockerfilePluginOverrideParentOverride) DeepCopyInto(out *DockerfilePl *out = make([]string, len(*in)) copy(*out, *in) } + if in.RootRequired != nil { + in, out := &in.RootRequired, &out.RootRequired + *out = new(bool) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerfilePluginOverrideParentOverride. diff --git a/pkg/apis/workspaces/v1alpha2/zz_generated.parent_overrides.go b/pkg/apis/workspaces/v1alpha2/zz_generated.parent_overrides.go index a51c2fde3..fe73d5705 100644 --- a/pkg/apis/workspaces/v1alpha2/zz_generated.parent_overrides.go +++ b/pkg/apis/workspaces/v1alpha2/zz_generated.parent_overrides.go @@ -748,16 +748,6 @@ type DockerfileImageParentOverride struct { BaseImageParentOverride `json:",inline"` DockerfileLocationParentOverride `json:",inline"` DockerfileParentOverride `json:",inline"` - - // Registry URL to pull the Dockerfile from when using id as Dockerfile src. - // To ensure the dockerfile gets resolved consistently in different environments, - // it is recommended to always specify the `regsitryURL` when `Id` is used. - // +optional - RegistryUrl string `json:"registryUrl,omitempty"` - - // Location of the Dockerfile in the Git repository when using git as Dockerfile src. - // +optional - GitLocation string `json:"gitLocation,omitempty"` } // ImportReferenceType describes the type of location @@ -861,7 +851,7 @@ type BaseImageParentOverride struct { // +union type DockerfileLocationParentOverride struct { - // +kubebuilder:validation:Enum=Uri;Id;Git + // +kubebuilder:validation:Enum=Uri;Registry;Git // Type of Dockerfile location // + // +unionDiscriminator @@ -873,13 +863,13 @@ type DockerfileLocationParentOverride struct { // +optional Uri string `json:"uri,omitempty"` - // Id in a registry that contains a Dockerfile + // Dockerfile's Devfile Registry source // +optional - Id string `json:"id,omitempty"` + Registry *DockerfileDevfileRegistrySourceParentOverride `json:"registry,omitempty"` - // Project's Git source + // Dockerfile's Git source // +optional - Git *GitProjectSourceParentOverride `json:"git,omitempty"` + Git *DockerfileGitProjectSourceParentOverride `json:"git,omitempty"` } type DockerfileParentOverride struct { @@ -896,7 +886,7 @@ type DockerfileParentOverride struct { // // Default value is `false` // +optional - RootRequired bool `json:"rootRequired,omitempty"` + RootRequired *bool `json:"rootRequired,omitempty"` } // ComponentType describes the type of component. @@ -1008,6 +998,27 @@ type CommandGroupKindParentOverride string // Only one of the following location type may be specified. type DockerfileLocationTypeParentOverride string +type DockerfileDevfileRegistrySourceParentOverride struct { + + // +optional + // Id in a devfile registry that contains a Dockerfile + Id string `json:"id,omitempty"` + + // Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. + // To ensure the Dockerfile gets resolved consistently in different environments, + // it is recommended to always specify the `devfileRegistryUrl` when `Id` is used. + // +optional + DevfileRegistryUrl string `json:"devfileRegistryUrl,omitempty"` +} + +type DockerfileGitProjectSourceParentOverride struct { + GitProjectSourceParentOverride `json:",inline"` + + // Location of the Dockerfile in the Git repository when using git as Dockerfile src. + // +optional + GitLocation string `json:"gitLocation,omitempty"` +} + // DevWorkspace component: Anything that will bring additional features / tooling / behaviour / context // to the devworkspace, in order to make working in it easier. type BaseComponentPluginOverrideParentOverride struct { @@ -1271,16 +1282,6 @@ type DockerfileImagePluginOverrideParentOverride struct { BaseImagePluginOverrideParentOverride `json:",inline"` DockerfileLocationPluginOverrideParentOverride `json:",inline"` DockerfilePluginOverrideParentOverride `json:",inline"` - - // Registry URL to pull the Dockerfile from when using id as Dockerfile src. - // To ensure the dockerfile gets resolved consistently in different environments, - // it is recommended to always specify the `regsitryURL` when `Id` is used. - // +optional - RegistryUrl string `json:"registryUrl,omitempty"` - - // Location of the Dockerfile in the Git repository when using git as Dockerfile src. - // +optional - GitLocation string `json:"gitLocation,omitempty"` } type CommandGroupPluginOverrideParentOverride struct { @@ -1300,7 +1301,7 @@ type BaseImagePluginOverrideParentOverride struct { // +union type DockerfileLocationPluginOverrideParentOverride struct { - // +kubebuilder:validation:Enum=Uri;Id;Git + // +kubebuilder:validation:Enum=Uri;Registry;Git // Type of Dockerfile location // + // +unionDiscriminator @@ -1312,13 +1313,13 @@ type DockerfileLocationPluginOverrideParentOverride struct { // +optional Uri string `json:"uri,omitempty"` - // Id in a registry that contains a Dockerfile + // Dockerfile's Devfile Registry source // +optional - Id string `json:"id,omitempty"` + Registry *DockerfileDevfileRegistrySourcePluginOverrideParentOverride `json:"registry,omitempty"` - // Project's Git source + // Dockerfile's Git source // +optional - Git *GitProjectSourcePluginOverrideParentOverride `json:"git,omitempty"` + Git *DockerfileGitProjectSourcePluginOverrideParentOverride `json:"git,omitempty"` } type DockerfilePluginOverrideParentOverride struct { @@ -1335,7 +1336,7 @@ type DockerfilePluginOverrideParentOverride struct { // // Default value is `false` // +optional - RootRequired bool `json:"rootRequired,omitempty"` + RootRequired *bool `json:"rootRequired,omitempty"` } // CommandGroupKind describes the kind of command group. @@ -1347,6 +1348,27 @@ type CommandGroupKindPluginOverrideParentOverride string // Only one of the following location type may be specified. type DockerfileLocationTypePluginOverrideParentOverride string +type DockerfileDevfileRegistrySourcePluginOverrideParentOverride struct { + + // +optional + // Id in a devfile registry that contains a Dockerfile + Id string `json:"id,omitempty"` + + // Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. + // To ensure the Dockerfile gets resolved consistently in different environments, + // it is recommended to always specify the `devfileRegistryUrl` when `Id` is used. + // +optional + DevfileRegistryUrl string `json:"devfileRegistryUrl,omitempty"` +} + +type DockerfileGitProjectSourcePluginOverrideParentOverride struct { + GitProjectSourcePluginOverrideParentOverride `json:",inline"` + + // Location of the Dockerfile in the Git repository when using git as Dockerfile src. + // +optional + GitLocation string `json:"gitLocation,omitempty"` +} + type GitProjectSourcePluginOverrideParentOverride struct { GitLikeProjectSourcePluginOverrideParentOverride `json:",inline"` } diff --git a/pkg/apis/workspaces/v1alpha2/zz_generated.plugin_overrides.go b/pkg/apis/workspaces/v1alpha2/zz_generated.plugin_overrides.go index 33ce26336..0132b3621 100644 --- a/pkg/apis/workspaces/v1alpha2/zz_generated.plugin_overrides.go +++ b/pkg/apis/workspaces/v1alpha2/zz_generated.plugin_overrides.go @@ -494,16 +494,6 @@ type DockerfileImagePluginOverride struct { BaseImagePluginOverride `json:",inline"` DockerfileLocationPluginOverride `json:",inline"` DockerfilePluginOverride `json:",inline"` - - // Registry URL to pull the Dockerfile from when using id as Dockerfile src. - // To ensure the dockerfile gets resolved consistently in different environments, - // it is recommended to always specify the `regsitryURL` when `Id` is used. - // +optional - RegistryUrl string `json:"registryUrl,omitempty"` - - // Location of the Dockerfile in the Git repository when using git as Dockerfile src. - // +optional - GitLocation string `json:"gitLocation,omitempty"` } type CommandGroupPluginOverride struct { @@ -523,7 +513,7 @@ type BaseImagePluginOverride struct { // +union type DockerfileLocationPluginOverride struct { - // +kubebuilder:validation:Enum=Uri;Id;Git + // +kubebuilder:validation:Enum=Uri;Registry;Git // Type of Dockerfile location // + // +unionDiscriminator @@ -535,13 +525,13 @@ type DockerfileLocationPluginOverride struct { // +optional Uri string `json:"uri,omitempty"` - // Id in a registry that contains a Dockerfile + // Dockerfile's Devfile Registry source // +optional - Id string `json:"id,omitempty"` + Registry *DockerfileDevfileRegistrySourcePluginOverride `json:"registry,omitempty"` - // Project's Git source + // Dockerfile's Git source // +optional - Git *GitProjectSourcePluginOverride `json:"git,omitempty"` + Git *DockerfileGitProjectSourcePluginOverride `json:"git,omitempty"` } type DockerfilePluginOverride struct { @@ -558,7 +548,7 @@ type DockerfilePluginOverride struct { // // Default value is `false` // +optional - RootRequired bool `json:"rootRequired,omitempty"` + RootRequired *bool `json:"rootRequired,omitempty"` } // CommandGroupKind describes the kind of command group. @@ -570,6 +560,27 @@ type CommandGroupKindPluginOverride string // Only one of the following location type may be specified. type DockerfileLocationTypePluginOverride string +type DockerfileDevfileRegistrySourcePluginOverride struct { + + // +optional + // Id in a devfile registry that contains a Dockerfile + Id string `json:"id,omitempty"` + + // Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. + // To ensure the Dockerfile gets resolved consistently in different environments, + // it is recommended to always specify the `devfileRegistryUrl` when `Id` is used. + // +optional + DevfileRegistryUrl string `json:"devfileRegistryUrl,omitempty"` +} + +type DockerfileGitProjectSourcePluginOverride struct { + GitProjectSourcePluginOverride `json:",inline"` + + // Location of the Dockerfile in the Git repository when using git as Dockerfile src. + // +optional + GitLocation string `json:"gitLocation,omitempty"` +} + type GitProjectSourcePluginOverride struct { GitLikeProjectSourcePluginOverride `json:",inline"` } diff --git a/pkg/apis/workspaces/v1alpha2/zz_generated.union_definitions.go b/pkg/apis/workspaces/v1alpha2/zz_generated.union_definitions.go index 5d26f3bcf..58e616440 100644 --- a/pkg/apis/workspaces/v1alpha2/zz_generated.union_definitions.go +++ b/pkg/apis/workspaces/v1alpha2/zz_generated.union_definitions.go @@ -64,9 +64,9 @@ func (union *DockerfileLocation) Simplify() { // +k8s:deepcopy-gen=false type DockerfileLocationVisitor struct { - Uri func(string) error - Id func(string) error - Git func(*GitProjectSource) error + Uri func(string) error + Registry func(*DockerfileDevfileRegistrySource) error + Git func(*DockerfileGitProjectSource) error } var k8sLikeComponentLocation reflect.Type = reflect.TypeOf(K8sLikeComponentLocationVisitor{}) @@ -354,9 +354,9 @@ func (union *DockerfileLocationParentOverride) Simplify() { // +k8s:deepcopy-gen=false type DockerfileLocationParentOverrideVisitor struct { - Uri func(string) error - Id func(string) error - Git func(*GitProjectSourceParentOverride) error + Uri func(string) error + Registry func(*DockerfileDevfileRegistrySourceParentOverride) error + Git func(*DockerfileGitProjectSourceParentOverride) error } var k8sLikeComponentLocationPluginOverrideParentOverride reflect.Type = reflect.TypeOf(K8sLikeComponentLocationPluginOverrideParentOverrideVisitor{}) @@ -417,9 +417,9 @@ func (union *DockerfileLocationPluginOverrideParentOverride) Simplify() { // +k8s:deepcopy-gen=false type DockerfileLocationPluginOverrideParentOverrideVisitor struct { - Uri func(string) error - Id func(string) error - Git func(*GitProjectSourcePluginOverrideParentOverride) error + Uri func(string) error + Registry func(*DockerfileDevfileRegistrySourcePluginOverrideParentOverride) error + Git func(*DockerfileGitProjectSourcePluginOverrideParentOverride) error } var componentUnionPluginOverride reflect.Type = reflect.TypeOf(ComponentUnionPluginOverrideVisitor{}) @@ -526,7 +526,7 @@ func (union *DockerfileLocationPluginOverride) Simplify() { // +k8s:deepcopy-gen=false type DockerfileLocationPluginOverrideVisitor struct { - Uri func(string) error - Id func(string) error - Git func(*GitProjectSourcePluginOverride) error + Uri func(string) error + Registry func(*DockerfileDevfileRegistrySourcePluginOverride) error + Git func(*DockerfileGitProjectSourcePluginOverride) error } diff --git a/schemas/latest/dev-workspace-template-spec.json b/schemas/latest/dev-workspace-template-spec.json index 37b22324c..0217be21c 100644 --- a/schemas/latest/dev-workspace-template-spec.json +++ b/schemas/latest/dev-workspace-template-spec.json @@ -518,7 +518,7 @@ }, { "required": [ - "id" + "registry" ] }, { @@ -540,7 +540,7 @@ "type": "string" }, "git": { - "description": "Project's Git source", + "description": "Dockerfile's Git source", "type": "object", "required": [ "remotes" @@ -561,6 +561,10 @@ }, "additionalProperties": false }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string" + }, "remotes": { "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", "type": "object", @@ -571,17 +575,23 @@ }, "additionalProperties": false }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", - "type": "string" - }, - "id": { - "description": "Id in a registry that contains a Dockerfile", - "type": "string" - }, - "registryUrl": { - "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", - "type": "string" + "registry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "required": [ + "id" + ], + "properties": { + "devfileRegistryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string" + }, + "id": { + "description": "Id in a devfile registry that contains a Dockerfile", + "type": "string" + } + }, + "additionalProperties": false }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", @@ -1194,7 +1204,7 @@ }, { "required": [ - "id" + "registry" ] }, { @@ -1216,7 +1226,7 @@ "type": "string" }, "git": { - "description": "Project's Git source", + "description": "Dockerfile's Git source", "type": "object", "properties": { "checkoutFrom": { @@ -1234,6 +1244,10 @@ }, "additionalProperties": false }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string" + }, "remotes": { "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", "type": "object", @@ -1244,17 +1258,20 @@ }, "additionalProperties": false }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", - "type": "string" - }, - "id": { - "description": "Id in a registry that contains a Dockerfile", - "type": "string" - }, - "registryUrl": { - "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", - "type": "string" + "registry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "properties": { + "devfileRegistryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string" + }, + "id": { + "description": "Id in a devfile registry that contains a Dockerfile", + "type": "string" + } + }, + "additionalProperties": false }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", @@ -1975,7 +1992,7 @@ }, { "required": [ - "id" + "registry" ] }, { @@ -1997,7 +2014,7 @@ "type": "string" }, "git": { - "description": "Project's Git source", + "description": "Dockerfile's Git source", "type": "object", "properties": { "checkoutFrom": { @@ -2015,6 +2032,10 @@ }, "additionalProperties": false }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string" + }, "remotes": { "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", "type": "object", @@ -2025,17 +2046,20 @@ }, "additionalProperties": false }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", - "type": "string" - }, - "id": { - "description": "Id in a registry that contains a Dockerfile", - "type": "string" - }, - "registryUrl": { - "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", - "type": "string" + "registry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "properties": { + "devfileRegistryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string" + }, + "id": { + "description": "Id in a devfile registry that contains a Dockerfile", + "type": "string" + } + }, + "additionalProperties": false }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", @@ -2642,7 +2666,7 @@ }, { "required": [ - "id" + "registry" ] }, { @@ -2664,7 +2688,7 @@ "type": "string" }, "git": { - "description": "Project's Git source", + "description": "Dockerfile's Git source", "type": "object", "properties": { "checkoutFrom": { @@ -2682,6 +2706,10 @@ }, "additionalProperties": false }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string" + }, "remotes": { "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", "type": "object", @@ -2692,17 +2720,20 @@ }, "additionalProperties": false }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", - "type": "string" - }, - "id": { - "description": "Id in a registry that contains a Dockerfile", - "type": "string" - }, - "registryUrl": { - "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", - "type": "string" + "registry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "properties": { + "devfileRegistryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string" + }, + "id": { + "description": "Id in a devfile registry that contains a Dockerfile", + "type": "string" + } + }, + "additionalProperties": false }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", diff --git a/schemas/latest/dev-workspace-template.json b/schemas/latest/dev-workspace-template.json index 0ef085b29..bfff68b67 100644 --- a/schemas/latest/dev-workspace-template.json +++ b/schemas/latest/dev-workspace-template.json @@ -684,7 +684,7 @@ }, { "required": [ - "id" + "registry" ] }, { @@ -706,7 +706,7 @@ "type": "string" }, "git": { - "description": "Project's Git source", + "description": "Dockerfile's Git source", "type": "object", "required": [ "remotes" @@ -727,6 +727,10 @@ }, "additionalProperties": false }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string" + }, "remotes": { "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", "type": "object", @@ -737,17 +741,23 @@ }, "additionalProperties": false }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", - "type": "string" - }, - "id": { - "description": "Id in a registry that contains a Dockerfile", - "type": "string" - }, - "registryUrl": { - "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", - "type": "string" + "registry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "required": [ + "id" + ], + "properties": { + "devfileRegistryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string" + }, + "id": { + "description": "Id in a devfile registry that contains a Dockerfile", + "type": "string" + } + }, + "additionalProperties": false }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", @@ -1360,7 +1370,7 @@ }, { "required": [ - "id" + "registry" ] }, { @@ -1382,7 +1392,7 @@ "type": "string" }, "git": { - "description": "Project's Git source", + "description": "Dockerfile's Git source", "type": "object", "properties": { "checkoutFrom": { @@ -1400,6 +1410,10 @@ }, "additionalProperties": false }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string" + }, "remotes": { "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", "type": "object", @@ -1410,17 +1424,20 @@ }, "additionalProperties": false }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", - "type": "string" - }, - "id": { - "description": "Id in a registry that contains a Dockerfile", - "type": "string" - }, - "registryUrl": { - "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", - "type": "string" + "registry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "properties": { + "devfileRegistryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string" + }, + "id": { + "description": "Id in a devfile registry that contains a Dockerfile", + "type": "string" + } + }, + "additionalProperties": false }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", @@ -2141,7 +2158,7 @@ }, { "required": [ - "id" + "registry" ] }, { @@ -2163,7 +2180,7 @@ "type": "string" }, "git": { - "description": "Project's Git source", + "description": "Dockerfile's Git source", "type": "object", "properties": { "checkoutFrom": { @@ -2181,6 +2198,10 @@ }, "additionalProperties": false }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string" + }, "remotes": { "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", "type": "object", @@ -2191,17 +2212,20 @@ }, "additionalProperties": false }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", - "type": "string" - }, - "id": { - "description": "Id in a registry that contains a Dockerfile", - "type": "string" - }, - "registryUrl": { - "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", - "type": "string" + "registry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "properties": { + "devfileRegistryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string" + }, + "id": { + "description": "Id in a devfile registry that contains a Dockerfile", + "type": "string" + } + }, + "additionalProperties": false }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", @@ -2808,7 +2832,7 @@ }, { "required": [ - "id" + "registry" ] }, { @@ -2830,7 +2854,7 @@ "type": "string" }, "git": { - "description": "Project's Git source", + "description": "Dockerfile's Git source", "type": "object", "properties": { "checkoutFrom": { @@ -2848,6 +2872,10 @@ }, "additionalProperties": false }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string" + }, "remotes": { "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", "type": "object", @@ -2858,17 +2886,20 @@ }, "additionalProperties": false }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", - "type": "string" - }, - "id": { - "description": "Id in a registry that contains a Dockerfile", - "type": "string" - }, - "registryUrl": { - "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", - "type": "string" + "registry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "properties": { + "devfileRegistryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string" + }, + "id": { + "description": "Id in a devfile registry that contains a Dockerfile", + "type": "string" + } + }, + "additionalProperties": false }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", diff --git a/schemas/latest/dev-workspace.json b/schemas/latest/dev-workspace.json index 67308765f..ca506552e 100644 --- a/schemas/latest/dev-workspace.json +++ b/schemas/latest/dev-workspace.json @@ -697,7 +697,7 @@ }, { "required": [ - "id" + "registry" ] }, { @@ -719,7 +719,7 @@ "type": "string" }, "git": { - "description": "Project's Git source", + "description": "Dockerfile's Git source", "type": "object", "required": [ "remotes" @@ -740,6 +740,10 @@ }, "additionalProperties": false }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string" + }, "remotes": { "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", "type": "object", @@ -750,17 +754,23 @@ }, "additionalProperties": false }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", - "type": "string" - }, - "id": { - "description": "Id in a registry that contains a Dockerfile", - "type": "string" - }, - "registryUrl": { - "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", - "type": "string" + "registry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "required": [ + "id" + ], + "properties": { + "devfileRegistryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string" + }, + "id": { + "description": "Id in a devfile registry that contains a Dockerfile", + "type": "string" + } + }, + "additionalProperties": false }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", @@ -1373,7 +1383,7 @@ }, { "required": [ - "id" + "registry" ] }, { @@ -1395,7 +1405,7 @@ "type": "string" }, "git": { - "description": "Project's Git source", + "description": "Dockerfile's Git source", "type": "object", "properties": { "checkoutFrom": { @@ -1413,6 +1423,10 @@ }, "additionalProperties": false }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string" + }, "remotes": { "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", "type": "object", @@ -1423,17 +1437,20 @@ }, "additionalProperties": false }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", - "type": "string" - }, - "id": { - "description": "Id in a registry that contains a Dockerfile", - "type": "string" - }, - "registryUrl": { - "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", - "type": "string" + "registry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "properties": { + "devfileRegistryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string" + }, + "id": { + "description": "Id in a devfile registry that contains a Dockerfile", + "type": "string" + } + }, + "additionalProperties": false }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", @@ -2154,7 +2171,7 @@ }, { "required": [ - "id" + "registry" ] }, { @@ -2176,7 +2193,7 @@ "type": "string" }, "git": { - "description": "Project's Git source", + "description": "Dockerfile's Git source", "type": "object", "properties": { "checkoutFrom": { @@ -2194,6 +2211,10 @@ }, "additionalProperties": false }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string" + }, "remotes": { "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", "type": "object", @@ -2204,17 +2225,20 @@ }, "additionalProperties": false }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", - "type": "string" - }, - "id": { - "description": "Id in a registry that contains a Dockerfile", - "type": "string" - }, - "registryUrl": { - "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", - "type": "string" + "registry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "properties": { + "devfileRegistryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string" + }, + "id": { + "description": "Id in a devfile registry that contains a Dockerfile", + "type": "string" + } + }, + "additionalProperties": false }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", @@ -2821,7 +2845,7 @@ }, { "required": [ - "id" + "registry" ] }, { @@ -2843,7 +2867,7 @@ "type": "string" }, "git": { - "description": "Project's Git source", + "description": "Dockerfile's Git source", "type": "object", "properties": { "checkoutFrom": { @@ -2861,6 +2885,10 @@ }, "additionalProperties": false }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string" + }, "remotes": { "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", "type": "object", @@ -2871,17 +2899,20 @@ }, "additionalProperties": false }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", - "type": "string" - }, - "id": { - "description": "Id in a registry that contains a Dockerfile", - "type": "string" - }, - "registryUrl": { - "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", - "type": "string" + "registry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "properties": { + "devfileRegistryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string" + }, + "id": { + "description": "Id in a devfile registry that contains a Dockerfile", + "type": "string" + } + }, + "additionalProperties": false }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", diff --git a/schemas/latest/devfile.json b/schemas/latest/devfile.json index 1039162b9..4b9012688 100644 --- a/schemas/latest/devfile.json +++ b/schemas/latest/devfile.json @@ -437,7 +437,7 @@ }, { "required": [ - "id" + "registry" ] }, { @@ -459,7 +459,7 @@ "type": "string" }, "git": { - "description": "Project's Git source", + "description": "Dockerfile's Git source", "type": "object", "required": [ "remotes" @@ -480,6 +480,10 @@ }, "additionalProperties": false }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string" + }, "remotes": { "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", "type": "object", @@ -490,17 +494,23 @@ }, "additionalProperties": false }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", - "type": "string" - }, - "id": { - "description": "Id in a registry that contains a Dockerfile", - "type": "string" - }, - "registryUrl": { - "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", - "type": "string" + "registry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "required": [ + "id" + ], + "properties": { + "devfileRegistryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string" + }, + "id": { + "description": "Id in a devfile registry that contains a Dockerfile", + "type": "string" + } + }, + "additionalProperties": false }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", @@ -1251,7 +1261,7 @@ }, { "required": [ - "id" + "registry" ] }, { @@ -1273,7 +1283,7 @@ "type": "string" }, "git": { - "description": "Project's Git source", + "description": "Dockerfile's Git source", "type": "object", "properties": { "checkoutFrom": { @@ -1291,6 +1301,10 @@ }, "additionalProperties": false }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string" + }, "remotes": { "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", "type": "object", @@ -1301,17 +1315,20 @@ }, "additionalProperties": false }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", - "type": "string" - }, - "id": { - "description": "Id in a registry that contains a Dockerfile", - "type": "string" - }, - "registryUrl": { - "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", - "type": "string" + "registry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "properties": { + "devfileRegistryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string" + }, + "id": { + "description": "Id in a devfile registry that contains a Dockerfile", + "type": "string" + } + }, + "additionalProperties": false }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", diff --git a/schemas/latest/ide-targeted/dev-workspace-template-spec.json b/schemas/latest/ide-targeted/dev-workspace-template-spec.json index 3205995f7..065a7d840 100644 --- a/schemas/latest/ide-targeted/dev-workspace-template-spec.json +++ b/schemas/latest/ide-targeted/dev-workspace-template-spec.json @@ -569,7 +569,7 @@ }, { "required": [ - "id" + "registry" ] }, { @@ -593,7 +593,7 @@ "markdownDescription": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container" }, "git": { - "description": "Project's Git source", + "description": "Dockerfile's Git source", "type": "object", "required": [ "remotes" @@ -617,6 +617,11 @@ "additionalProperties": false, "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string", + "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." + }, "remotes": { "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", "type": "object", @@ -627,22 +632,28 @@ } }, "additionalProperties": false, - "markdownDescription": "Project's Git source" - }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", - "type": "string", - "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." - }, - "id": { - "description": "Id in a registry that contains a Dockerfile", - "type": "string", - "markdownDescription": "Id in a registry that contains a Dockerfile" + "markdownDescription": "Dockerfile's Git source" }, - "registryUrl": { - "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", - "type": "string", - "markdownDescription": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used." + "registry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "required": [ + "id" + ], + "properties": { + "devfileRegistryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string", + "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." + }, + "id": { + "description": "Id in a devfile registry that contains a Dockerfile", + "type": "string", + "markdownDescription": "Id in a devfile registry that contains a Dockerfile" + } + }, + "additionalProperties": false, + "markdownDescription": "Dockerfile's Devfile Registry source" }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", @@ -1316,7 +1327,7 @@ }, { "required": [ - "id" + "registry" ] }, { @@ -1340,7 +1351,7 @@ "markdownDescription": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container" }, "git": { - "description": "Project's Git source", + "description": "Dockerfile's Git source", "type": "object", "properties": { "checkoutFrom": { @@ -1361,6 +1372,11 @@ "additionalProperties": false, "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string", + "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." + }, "remotes": { "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", "type": "object", @@ -1371,22 +1387,25 @@ } }, "additionalProperties": false, - "markdownDescription": "Project's Git source" - }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", - "type": "string", - "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." - }, - "id": { - "description": "Id in a registry that contains a Dockerfile", - "type": "string", - "markdownDescription": "Id in a registry that contains a Dockerfile" + "markdownDescription": "Dockerfile's Git source" }, - "registryUrl": { - "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", - "type": "string", - "markdownDescription": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used." + "registry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "properties": { + "devfileRegistryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string", + "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." + }, + "id": { + "description": "Id in a devfile registry that contains a Dockerfile", + "type": "string", + "markdownDescription": "Id in a devfile registry that contains a Dockerfile" + } + }, + "additionalProperties": false, + "markdownDescription": "Dockerfile's Devfile Registry source" }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", @@ -2191,7 +2210,7 @@ }, { "required": [ - "id" + "registry" ] }, { @@ -2215,7 +2234,7 @@ "markdownDescription": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container" }, "git": { - "description": "Project's Git source", + "description": "Dockerfile's Git source", "type": "object", "properties": { "checkoutFrom": { @@ -2236,6 +2255,11 @@ "additionalProperties": false, "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string", + "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." + }, "remotes": { "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", "type": "object", @@ -2246,22 +2270,25 @@ } }, "additionalProperties": false, - "markdownDescription": "Project's Git source" + "markdownDescription": "Dockerfile's Git source" }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", - "type": "string", - "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." - }, - "id": { - "description": "Id in a registry that contains a Dockerfile", - "type": "string", - "markdownDescription": "Id in a registry that contains a Dockerfile" - }, - "registryUrl": { - "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", - "type": "string", - "markdownDescription": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used." + "registry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "properties": { + "devfileRegistryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string", + "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." + }, + "id": { + "description": "Id in a devfile registry that contains a Dockerfile", + "type": "string", + "markdownDescription": "Id in a devfile registry that contains a Dockerfile" + } + }, + "additionalProperties": false, + "markdownDescription": "Dockerfile's Devfile Registry source" }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", @@ -2933,7 +2960,7 @@ }, { "required": [ - "id" + "registry" ] }, { @@ -2957,7 +2984,7 @@ "markdownDescription": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container" }, "git": { - "description": "Project's Git source", + "description": "Dockerfile's Git source", "type": "object", "properties": { "checkoutFrom": { @@ -2978,6 +3005,11 @@ "additionalProperties": false, "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string", + "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." + }, "remotes": { "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", "type": "object", @@ -2988,22 +3020,25 @@ } }, "additionalProperties": false, - "markdownDescription": "Project's Git source" - }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", - "type": "string", - "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." - }, - "id": { - "description": "Id in a registry that contains a Dockerfile", - "type": "string", - "markdownDescription": "Id in a registry that contains a Dockerfile" + "markdownDescription": "Dockerfile's Git source" }, - "registryUrl": { - "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", - "type": "string", - "markdownDescription": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used." + "registry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "properties": { + "devfileRegistryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string", + "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." + }, + "id": { + "description": "Id in a devfile registry that contains a Dockerfile", + "type": "string", + "markdownDescription": "Id in a devfile registry that contains a Dockerfile" + } + }, + "additionalProperties": false, + "markdownDescription": "Dockerfile's Devfile Registry source" }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", diff --git a/schemas/latest/ide-targeted/dev-workspace-template.json b/schemas/latest/ide-targeted/dev-workspace-template.json index 5781411aa..edc829486 100644 --- a/schemas/latest/ide-targeted/dev-workspace-template.json +++ b/schemas/latest/ide-targeted/dev-workspace-template.json @@ -768,7 +768,7 @@ }, { "required": [ - "id" + "registry" ] }, { @@ -792,7 +792,7 @@ "markdownDescription": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container" }, "git": { - "description": "Project's Git source", + "description": "Dockerfile's Git source", "type": "object", "required": [ "remotes" @@ -816,6 +816,11 @@ "additionalProperties": false, "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string", + "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." + }, "remotes": { "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", "type": "object", @@ -826,22 +831,28 @@ } }, "additionalProperties": false, - "markdownDescription": "Project's Git source" - }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", - "type": "string", - "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." - }, - "id": { - "description": "Id in a registry that contains a Dockerfile", - "type": "string", - "markdownDescription": "Id in a registry that contains a Dockerfile" + "markdownDescription": "Dockerfile's Git source" }, - "registryUrl": { - "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", - "type": "string", - "markdownDescription": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used." + "registry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "required": [ + "id" + ], + "properties": { + "devfileRegistryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string", + "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." + }, + "id": { + "description": "Id in a devfile registry that contains a Dockerfile", + "type": "string", + "markdownDescription": "Id in a devfile registry that contains a Dockerfile" + } + }, + "additionalProperties": false, + "markdownDescription": "Dockerfile's Devfile Registry source" }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", @@ -1515,7 +1526,7 @@ }, { "required": [ - "id" + "registry" ] }, { @@ -1539,7 +1550,7 @@ "markdownDescription": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container" }, "git": { - "description": "Project's Git source", + "description": "Dockerfile's Git source", "type": "object", "properties": { "checkoutFrom": { @@ -1560,6 +1571,11 @@ "additionalProperties": false, "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string", + "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." + }, "remotes": { "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", "type": "object", @@ -1570,22 +1586,25 @@ } }, "additionalProperties": false, - "markdownDescription": "Project's Git source" - }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", - "type": "string", - "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." - }, - "id": { - "description": "Id in a registry that contains a Dockerfile", - "type": "string", - "markdownDescription": "Id in a registry that contains a Dockerfile" + "markdownDescription": "Dockerfile's Git source" }, - "registryUrl": { - "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", - "type": "string", - "markdownDescription": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used." + "registry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "properties": { + "devfileRegistryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string", + "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." + }, + "id": { + "description": "Id in a devfile registry that contains a Dockerfile", + "type": "string", + "markdownDescription": "Id in a devfile registry that contains a Dockerfile" + } + }, + "additionalProperties": false, + "markdownDescription": "Dockerfile's Devfile Registry source" }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", @@ -2390,7 +2409,7 @@ }, { "required": [ - "id" + "registry" ] }, { @@ -2414,7 +2433,7 @@ "markdownDescription": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container" }, "git": { - "description": "Project's Git source", + "description": "Dockerfile's Git source", "type": "object", "properties": { "checkoutFrom": { @@ -2435,6 +2454,11 @@ "additionalProperties": false, "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string", + "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." + }, "remotes": { "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", "type": "object", @@ -2445,22 +2469,25 @@ } }, "additionalProperties": false, - "markdownDescription": "Project's Git source" + "markdownDescription": "Dockerfile's Git source" }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", - "type": "string", - "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." - }, - "id": { - "description": "Id in a registry that contains a Dockerfile", - "type": "string", - "markdownDescription": "Id in a registry that contains a Dockerfile" - }, - "registryUrl": { - "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", - "type": "string", - "markdownDescription": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used." + "registry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "properties": { + "devfileRegistryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string", + "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." + }, + "id": { + "description": "Id in a devfile registry that contains a Dockerfile", + "type": "string", + "markdownDescription": "Id in a devfile registry that contains a Dockerfile" + } + }, + "additionalProperties": false, + "markdownDescription": "Dockerfile's Devfile Registry source" }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", @@ -3132,7 +3159,7 @@ }, { "required": [ - "id" + "registry" ] }, { @@ -3156,7 +3183,7 @@ "markdownDescription": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container" }, "git": { - "description": "Project's Git source", + "description": "Dockerfile's Git source", "type": "object", "properties": { "checkoutFrom": { @@ -3177,6 +3204,11 @@ "additionalProperties": false, "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string", + "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." + }, "remotes": { "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", "type": "object", @@ -3187,22 +3219,25 @@ } }, "additionalProperties": false, - "markdownDescription": "Project's Git source" - }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", - "type": "string", - "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." - }, - "id": { - "description": "Id in a registry that contains a Dockerfile", - "type": "string", - "markdownDescription": "Id in a registry that contains a Dockerfile" + "markdownDescription": "Dockerfile's Git source" }, - "registryUrl": { - "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", - "type": "string", - "markdownDescription": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used." + "registry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "properties": { + "devfileRegistryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string", + "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." + }, + "id": { + "description": "Id in a devfile registry that contains a Dockerfile", + "type": "string", + "markdownDescription": "Id in a devfile registry that contains a Dockerfile" + } + }, + "additionalProperties": false, + "markdownDescription": "Dockerfile's Devfile Registry source" }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", diff --git a/schemas/latest/ide-targeted/dev-workspace.json b/schemas/latest/ide-targeted/dev-workspace.json index 4f9f8e56d..7709f4ca0 100644 --- a/schemas/latest/ide-targeted/dev-workspace.json +++ b/schemas/latest/ide-targeted/dev-workspace.json @@ -781,7 +781,7 @@ }, { "required": [ - "id" + "registry" ] }, { @@ -805,7 +805,7 @@ "markdownDescription": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container" }, "git": { - "description": "Project's Git source", + "description": "Dockerfile's Git source", "type": "object", "required": [ "remotes" @@ -829,6 +829,11 @@ "additionalProperties": false, "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string", + "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." + }, "remotes": { "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", "type": "object", @@ -839,22 +844,28 @@ } }, "additionalProperties": false, - "markdownDescription": "Project's Git source" - }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", - "type": "string", - "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." - }, - "id": { - "description": "Id in a registry that contains a Dockerfile", - "type": "string", - "markdownDescription": "Id in a registry that contains a Dockerfile" + "markdownDescription": "Dockerfile's Git source" }, - "registryUrl": { - "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", - "type": "string", - "markdownDescription": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used." + "registry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "required": [ + "id" + ], + "properties": { + "devfileRegistryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string", + "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." + }, + "id": { + "description": "Id in a devfile registry that contains a Dockerfile", + "type": "string", + "markdownDescription": "Id in a devfile registry that contains a Dockerfile" + } + }, + "additionalProperties": false, + "markdownDescription": "Dockerfile's Devfile Registry source" }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", @@ -1528,7 +1539,7 @@ }, { "required": [ - "id" + "registry" ] }, { @@ -1552,7 +1563,7 @@ "markdownDescription": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container" }, "git": { - "description": "Project's Git source", + "description": "Dockerfile's Git source", "type": "object", "properties": { "checkoutFrom": { @@ -1573,6 +1584,11 @@ "additionalProperties": false, "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string", + "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." + }, "remotes": { "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", "type": "object", @@ -1583,22 +1599,25 @@ } }, "additionalProperties": false, - "markdownDescription": "Project's Git source" - }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", - "type": "string", - "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." - }, - "id": { - "description": "Id in a registry that contains a Dockerfile", - "type": "string", - "markdownDescription": "Id in a registry that contains a Dockerfile" + "markdownDescription": "Dockerfile's Git source" }, - "registryUrl": { - "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", - "type": "string", - "markdownDescription": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used." + "registry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "properties": { + "devfileRegistryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string", + "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." + }, + "id": { + "description": "Id in a devfile registry that contains a Dockerfile", + "type": "string", + "markdownDescription": "Id in a devfile registry that contains a Dockerfile" + } + }, + "additionalProperties": false, + "markdownDescription": "Dockerfile's Devfile Registry source" }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", @@ -2403,7 +2422,7 @@ }, { "required": [ - "id" + "registry" ] }, { @@ -2427,7 +2446,7 @@ "markdownDescription": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container" }, "git": { - "description": "Project's Git source", + "description": "Dockerfile's Git source", "type": "object", "properties": { "checkoutFrom": { @@ -2448,6 +2467,11 @@ "additionalProperties": false, "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string", + "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." + }, "remotes": { "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", "type": "object", @@ -2458,22 +2482,25 @@ } }, "additionalProperties": false, - "markdownDescription": "Project's Git source" + "markdownDescription": "Dockerfile's Git source" }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", - "type": "string", - "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." - }, - "id": { - "description": "Id in a registry that contains a Dockerfile", - "type": "string", - "markdownDescription": "Id in a registry that contains a Dockerfile" - }, - "registryUrl": { - "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", - "type": "string", - "markdownDescription": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used." + "registry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "properties": { + "devfileRegistryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string", + "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." + }, + "id": { + "description": "Id in a devfile registry that contains a Dockerfile", + "type": "string", + "markdownDescription": "Id in a devfile registry that contains a Dockerfile" + } + }, + "additionalProperties": false, + "markdownDescription": "Dockerfile's Devfile Registry source" }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", @@ -3145,7 +3172,7 @@ }, { "required": [ - "id" + "registry" ] }, { @@ -3169,7 +3196,7 @@ "markdownDescription": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container" }, "git": { - "description": "Project's Git source", + "description": "Dockerfile's Git source", "type": "object", "properties": { "checkoutFrom": { @@ -3190,6 +3217,11 @@ "additionalProperties": false, "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string", + "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." + }, "remotes": { "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", "type": "object", @@ -3200,22 +3232,25 @@ } }, "additionalProperties": false, - "markdownDescription": "Project's Git source" - }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", - "type": "string", - "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." - }, - "id": { - "description": "Id in a registry that contains a Dockerfile", - "type": "string", - "markdownDescription": "Id in a registry that contains a Dockerfile" + "markdownDescription": "Dockerfile's Git source" }, - "registryUrl": { - "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", - "type": "string", - "markdownDescription": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used." + "registry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "properties": { + "devfileRegistryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string", + "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." + }, + "id": { + "description": "Id in a devfile registry that contains a Dockerfile", + "type": "string", + "markdownDescription": "Id in a devfile registry that contains a Dockerfile" + } + }, + "additionalProperties": false, + "markdownDescription": "Dockerfile's Devfile Registry source" }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", diff --git a/schemas/latest/ide-targeted/devfile.json b/schemas/latest/ide-targeted/devfile.json index badcdfc04..4861f8c7a 100644 --- a/schemas/latest/ide-targeted/devfile.json +++ b/schemas/latest/ide-targeted/devfile.json @@ -478,7 +478,7 @@ }, { "required": [ - "id" + "registry" ] }, { @@ -502,7 +502,7 @@ "markdownDescription": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container" }, "git": { - "description": "Project's Git source", + "description": "Dockerfile's Git source", "type": "object", "required": [ "remotes" @@ -526,6 +526,11 @@ "additionalProperties": false, "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string", + "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." + }, "remotes": { "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", "type": "object", @@ -536,22 +541,28 @@ } }, "additionalProperties": false, - "markdownDescription": "Project's Git source" + "markdownDescription": "Dockerfile's Git source" }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", - "type": "string", - "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." - }, - "id": { - "description": "Id in a registry that contains a Dockerfile", - "type": "string", - "markdownDescription": "Id in a registry that contains a Dockerfile" - }, - "registryUrl": { - "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", - "type": "string", - "markdownDescription": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used." + "registry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "required": [ + "id" + ], + "properties": { + "devfileRegistryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string", + "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." + }, + "id": { + "description": "Id in a devfile registry that contains a Dockerfile", + "type": "string", + "markdownDescription": "Id in a devfile registry that contains a Dockerfile" + } + }, + "additionalProperties": false, + "markdownDescription": "Dockerfile's Devfile Registry source" }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", @@ -1389,7 +1400,7 @@ }, { "required": [ - "id" + "registry" ] }, { @@ -1413,7 +1424,7 @@ "markdownDescription": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container" }, "git": { - "description": "Project's Git source", + "description": "Dockerfile's Git source", "type": "object", "properties": { "checkoutFrom": { @@ -1434,6 +1445,11 @@ "additionalProperties": false, "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string", + "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." + }, "remotes": { "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", "type": "object", @@ -1444,22 +1460,25 @@ } }, "additionalProperties": false, - "markdownDescription": "Project's Git source" + "markdownDescription": "Dockerfile's Git source" }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", - "type": "string", - "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." - }, - "id": { - "description": "Id in a registry that contains a Dockerfile", - "type": "string", - "markdownDescription": "Id in a registry that contains a Dockerfile" - }, - "registryUrl": { - "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", - "type": "string", - "markdownDescription": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used." + "registry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "properties": { + "devfileRegistryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string", + "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." + }, + "id": { + "description": "Id in a devfile registry that contains a Dockerfile", + "type": "string", + "markdownDescription": "Id in a devfile registry that contains a Dockerfile" + } + }, + "additionalProperties": false, + "markdownDescription": "Dockerfile's Devfile Registry source" }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", diff --git a/schemas/latest/ide-targeted/parent-overrides.json b/schemas/latest/ide-targeted/parent-overrides.json index 3c5f83425..0b86853c9 100644 --- a/schemas/latest/ide-targeted/parent-overrides.json +++ b/schemas/latest/ide-targeted/parent-overrides.json @@ -455,7 +455,7 @@ }, { "required": [ - "id" + "registry" ] }, { @@ -479,7 +479,7 @@ "markdownDescription": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container" }, "git": { - "description": "Project's Git source", + "description": "Dockerfile's Git source", "type": "object", "properties": { "checkoutFrom": { @@ -500,6 +500,11 @@ "additionalProperties": false, "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string", + "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." + }, "remotes": { "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", "type": "object", @@ -510,22 +515,25 @@ } }, "additionalProperties": false, - "markdownDescription": "Project's Git source" - }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", - "type": "string", - "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." + "markdownDescription": "Dockerfile's Git source" }, - "id": { - "description": "Id in a registry that contains a Dockerfile", - "type": "string", - "markdownDescription": "Id in a registry that contains a Dockerfile" - }, - "registryUrl": { - "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", - "type": "string", - "markdownDescription": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used." + "registry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "properties": { + "devfileRegistryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string", + "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." + }, + "id": { + "description": "Id in a devfile registry that contains a Dockerfile", + "type": "string", + "markdownDescription": "Id in a devfile registry that contains a Dockerfile" + } + }, + "additionalProperties": false, + "markdownDescription": "Dockerfile's Devfile Registry source" }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", @@ -1197,7 +1205,7 @@ }, { "required": [ - "id" + "registry" ] }, { @@ -1221,7 +1229,7 @@ "markdownDescription": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container" }, "git": { - "description": "Project's Git source", + "description": "Dockerfile's Git source", "type": "object", "properties": { "checkoutFrom": { @@ -1242,6 +1250,11 @@ "additionalProperties": false, "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string", + "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." + }, "remotes": { "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", "type": "object", @@ -1252,22 +1265,25 @@ } }, "additionalProperties": false, - "markdownDescription": "Project's Git source" - }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", - "type": "string", - "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." + "markdownDescription": "Dockerfile's Git source" }, - "id": { - "description": "Id in a registry that contains a Dockerfile", - "type": "string", - "markdownDescription": "Id in a registry that contains a Dockerfile" - }, - "registryUrl": { - "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", - "type": "string", - "markdownDescription": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used." + "registry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "properties": { + "devfileRegistryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string", + "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." + }, + "id": { + "description": "Id in a devfile registry that contains a Dockerfile", + "type": "string", + "markdownDescription": "Id in a devfile registry that contains a Dockerfile" + } + }, + "additionalProperties": false, + "markdownDescription": "Dockerfile's Devfile Registry source" }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", diff --git a/schemas/latest/ide-targeted/plugin-overrides.json b/schemas/latest/ide-targeted/plugin-overrides.json index 823d8398a..01fdbe04f 100644 --- a/schemas/latest/ide-targeted/plugin-overrides.json +++ b/schemas/latest/ide-targeted/plugin-overrides.json @@ -444,7 +444,7 @@ }, { "required": [ - "id" + "registry" ] }, { @@ -468,7 +468,7 @@ "markdownDescription": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container" }, "git": { - "description": "Project's Git source", + "description": "Dockerfile's Git source", "type": "object", "properties": { "checkoutFrom": { @@ -489,6 +489,11 @@ "additionalProperties": false, "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string", + "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." + }, "remotes": { "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", "type": "object", @@ -499,22 +504,25 @@ } }, "additionalProperties": false, - "markdownDescription": "Project's Git source" - }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", - "type": "string", - "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." + "markdownDescription": "Dockerfile's Git source" }, - "id": { - "description": "Id in a registry that contains a Dockerfile", - "type": "string", - "markdownDescription": "Id in a registry that contains a Dockerfile" - }, - "registryUrl": { - "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", - "type": "string", - "markdownDescription": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used." + "registry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "properties": { + "devfileRegistryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string", + "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." + }, + "id": { + "description": "Id in a devfile registry that contains a Dockerfile", + "type": "string", + "markdownDescription": "Id in a devfile registry that contains a Dockerfile" + } + }, + "additionalProperties": false, + "markdownDescription": "Dockerfile's Devfile Registry source" }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", diff --git a/schemas/latest/parent-overrides.json b/schemas/latest/parent-overrides.json index 44b722b5a..0e3b5a897 100644 --- a/schemas/latest/parent-overrides.json +++ b/schemas/latest/parent-overrides.json @@ -410,7 +410,7 @@ }, { "required": [ - "id" + "registry" ] }, { @@ -432,7 +432,7 @@ "type": "string" }, "git": { - "description": "Project's Git source", + "description": "Dockerfile's Git source", "type": "object", "properties": { "checkoutFrom": { @@ -450,6 +450,10 @@ }, "additionalProperties": false }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string" + }, "remotes": { "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", "type": "object", @@ -460,17 +464,20 @@ }, "additionalProperties": false }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", - "type": "string" - }, - "id": { - "description": "Id in a registry that contains a Dockerfile", - "type": "string" - }, - "registryUrl": { - "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", - "type": "string" + "registry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "properties": { + "devfileRegistryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string" + }, + "id": { + "description": "Id in a devfile registry that contains a Dockerfile", + "type": "string" + } + }, + "additionalProperties": false }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", @@ -1077,7 +1084,7 @@ }, { "required": [ - "id" + "registry" ] }, { @@ -1099,7 +1106,7 @@ "type": "string" }, "git": { - "description": "Project's Git source", + "description": "Dockerfile's Git source", "type": "object", "properties": { "checkoutFrom": { @@ -1117,6 +1124,10 @@ }, "additionalProperties": false }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string" + }, "remotes": { "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", "type": "object", @@ -1127,17 +1138,20 @@ }, "additionalProperties": false }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", - "type": "string" - }, - "id": { - "description": "Id in a registry that contains a Dockerfile", - "type": "string" - }, - "registryUrl": { - "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", - "type": "string" + "registry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "properties": { + "devfileRegistryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string" + }, + "id": { + "description": "Id in a devfile registry that contains a Dockerfile", + "type": "string" + } + }, + "additionalProperties": false }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", diff --git a/schemas/latest/plugin-overrides.json b/schemas/latest/plugin-overrides.json index d5a7c5d10..cbf4a0885 100644 --- a/schemas/latest/plugin-overrides.json +++ b/schemas/latest/plugin-overrides.json @@ -400,7 +400,7 @@ }, { "required": [ - "id" + "registry" ] }, { @@ -422,7 +422,7 @@ "type": "string" }, "git": { - "description": "Project's Git source", + "description": "Dockerfile's Git source", "type": "object", "properties": { "checkoutFrom": { @@ -440,6 +440,10 @@ }, "additionalProperties": false }, + "gitLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "type": "string" + }, "remotes": { "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", "type": "object", @@ -450,17 +454,20 @@ }, "additionalProperties": false }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", - "type": "string" - }, - "id": { - "description": "Id in a registry that contains a Dockerfile", - "type": "string" - }, - "registryUrl": { - "description": "Registry URL to pull the Dockerfile from when using id as Dockerfile src. To ensure the dockerfile gets resolved consistently in different environments, it is recommended to always specify the `regsitryURL` when `Id` is used.", - "type": "string" + "registry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "properties": { + "devfileRegistryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string" + }, + "id": { + "description": "Id in a devfile registry that contains a Dockerfile", + "type": "string" + } + }, + "additionalProperties": false }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", From 72705267058f43e01a2bd0a2e2247f346458f295 Mon Sep 17 00:00:00 2001 From: Maysun J Faisal Date: Wed, 18 Aug 2021 18:21:53 -0400 Subject: [PATCH 4/7] Add variable subs for image component Signed-off-by: Maysun J Faisal --- .../test-fixtures/all/devfile-bad-output.yaml | 9 +++ .../test-fixtures/all/devfile-bad.yaml | 9 +++ .../all/devfile-good-output.yaml | 9 +++ .../test-fixtures/all/devfile-good.yaml | 9 +++ .../image-dockerfile-git-output.yaml | 12 +++ .../components/image-dockerfile-git.yaml | 12 +++ .../image-dockerfile-registry-output.yaml | 7 ++ .../components/image-dockerfile-registry.yaml | 7 ++ .../image-dockerfile-uri-output.yaml | 7 ++ .../components/image-dockerfile-uri.yaml | 7 ++ .../variables/variables_component.go | 81 +++++++++++++++++++ .../variables/variables_component_test.go | 75 +++++++++++++++++ pkg/validation/variables/variables_project.go | 66 +++++++++------ pkg/validation/variables/variables_test.go | 1 + 14 files changed, 286 insertions(+), 25 deletions(-) create mode 100644 pkg/validation/variables/test-fixtures/components/image-dockerfile-git-output.yaml create mode 100644 pkg/validation/variables/test-fixtures/components/image-dockerfile-git.yaml create mode 100644 pkg/validation/variables/test-fixtures/components/image-dockerfile-registry-output.yaml create mode 100644 pkg/validation/variables/test-fixtures/components/image-dockerfile-registry.yaml create mode 100644 pkg/validation/variables/test-fixtures/components/image-dockerfile-uri-output.yaml create mode 100644 pkg/validation/variables/test-fixtures/components/image-dockerfile-uri.yaml diff --git a/pkg/validation/variables/test-fixtures/all/devfile-bad-output.yaml b/pkg/validation/variables/test-fixtures/all/devfile-bad-output.yaml index 3b275f83a..b74699647 100644 --- a/pkg/validation/variables/test-fixtures/all/devfile-bad-output.yaml +++ b/pkg/validation/variables/test-fixtures/all/devfile-bad-output.yaml @@ -57,6 +57,15 @@ components: - name: component4 openshift: uri: "{{foo}}" +- name: component5 + image: + imageName: "myimage:{{ tag }}" + dockerfile: + uri: "{{foo}}/Dockerfile" + buildContext: /{{foo}}/{{foo}} + args: + - "-f" + - "/dev/null" commands: - id: command1 exec: diff --git a/pkg/validation/variables/test-fixtures/all/devfile-bad.yaml b/pkg/validation/variables/test-fixtures/all/devfile-bad.yaml index 690025410..7b4c597b5 100644 --- a/pkg/validation/variables/test-fixtures/all/devfile-bad.yaml +++ b/pkg/validation/variables/test-fixtures/all/devfile-bad.yaml @@ -57,6 +57,15 @@ components: - name: component4 openshift: uri: "{{foo}}" +- name: component5 + image: + imageName: "myimage:{{ tag }}" + dockerfile: + uri: "{{foo}}/Dockerfile" + buildContext: /{{foo}}/{{foo}} + args: + - "-f" + - "{{ devnull }}" commands: - id: command1 exec: diff --git a/pkg/validation/variables/test-fixtures/all/devfile-good-output.yaml b/pkg/validation/variables/test-fixtures/all/devfile-good-output.yaml index 4cd2a463b..f37481478 100644 --- a/pkg/validation/variables/test-fixtures/all/devfile-good-output.yaml +++ b/pkg/validation/variables/test-fixtures/all/devfile-good-output.yaml @@ -42,6 +42,15 @@ components: - name: endpoint1 exposure: "public" targetPort: 9999 +- name: component3 + image: + imageName: "myimage:xyz" + dockerfile: + uri: "FOO/Dockerfile" + buildContext: /FOO/FOO + args: + - "-f" + - "/dev/null" commands: - id: command1 exec: diff --git a/pkg/validation/variables/test-fixtures/all/devfile-good.yaml b/pkg/validation/variables/test-fixtures/all/devfile-good.yaml index 76da2a3ac..1272fbab0 100644 --- a/pkg/validation/variables/test-fixtures/all/devfile-good.yaml +++ b/pkg/validation/variables/test-fixtures/all/devfile-good.yaml @@ -42,6 +42,15 @@ components: - name: endpoint1 exposure: "public" targetPort: 9999 +- name: component3 + image: + imageName: "myimage:{{ tag }}" + dockerfile: + uri: "{{foo}}/Dockerfile" + buildContext: /{{foo}}/{{foo}} + args: + - "-f" + - "{{ devnull }}" commands: - id: command1 exec: diff --git a/pkg/validation/variables/test-fixtures/components/image-dockerfile-git-output.yaml b/pkg/validation/variables/test-fixtures/components/image-dockerfile-git-output.yaml new file mode 100644 index 000000000..63f1c10be --- /dev/null +++ b/pkg/validation/variables/test-fixtures/components/image-dockerfile-git-output.yaml @@ -0,0 +1,12 @@ +imageName: "myimage:xyz" +dockerfile: + git: + gitLocation: "uri/Dockerfile" + checkoutFrom: + revision: "FOO" + remote: "BAR" + remotes: + "foo": "BAR" + "FOOBAR": "BARFOO" + buildContext: /FOO/BAR + rootRequired: true diff --git a/pkg/validation/variables/test-fixtures/components/image-dockerfile-git.yaml b/pkg/validation/variables/test-fixtures/components/image-dockerfile-git.yaml new file mode 100644 index 000000000..cc367dd25 --- /dev/null +++ b/pkg/validation/variables/test-fixtures/components/image-dockerfile-git.yaml @@ -0,0 +1,12 @@ +imageName: "myimage:{{ tag }}" +dockerfile: + git: + gitLocation: "{{ uri }}/Dockerfile" + checkoutFrom: + revision: "{{foo}}" + remote: "{{bar}}" + remotes: + "foo": "{{bar}}" + "{{foo}}{{bar}}": "{{ bar }}{{ foo }}" + buildContext: /{{foo}}/{{bar}} + rootRequired: true diff --git a/pkg/validation/variables/test-fixtures/components/image-dockerfile-registry-output.yaml b/pkg/validation/variables/test-fixtures/components/image-dockerfile-registry-output.yaml new file mode 100644 index 000000000..1b901d5f4 --- /dev/null +++ b/pkg/validation/variables/test-fixtures/components/image-dockerfile-registry-output.yaml @@ -0,0 +1,7 @@ +imageName: "myimage:xyz" +dockerfile: + registry: + id: "FOO/BAR" + devfileRegistryUrl: "http://uri" + buildContext: /FOO/BAR + rootRequired: true diff --git a/pkg/validation/variables/test-fixtures/components/image-dockerfile-registry.yaml b/pkg/validation/variables/test-fixtures/components/image-dockerfile-registry.yaml new file mode 100644 index 000000000..f959b5fbf --- /dev/null +++ b/pkg/validation/variables/test-fixtures/components/image-dockerfile-registry.yaml @@ -0,0 +1,7 @@ +imageName: "myimage:{{ tag }}" +dockerfile: + registry: + id: "{{foo}}/{{bar}}" + devfileRegistryUrl: "http://{{ uri }}" + buildContext: /{{foo}}/{{bar}} + rootRequired: true diff --git a/pkg/validation/variables/test-fixtures/components/image-dockerfile-uri-output.yaml b/pkg/validation/variables/test-fixtures/components/image-dockerfile-uri-output.yaml new file mode 100644 index 000000000..4642bfdae --- /dev/null +++ b/pkg/validation/variables/test-fixtures/components/image-dockerfile-uri-output.yaml @@ -0,0 +1,7 @@ +imageName: "myimage:xyz" +dockerfile: + uri: "uri/Dockerfile" + buildContext: /FOO/BAR + args: + - "-f" + - "/dev/null" diff --git a/pkg/validation/variables/test-fixtures/components/image-dockerfile-uri.yaml b/pkg/validation/variables/test-fixtures/components/image-dockerfile-uri.yaml new file mode 100644 index 000000000..037843106 --- /dev/null +++ b/pkg/validation/variables/test-fixtures/components/image-dockerfile-uri.yaml @@ -0,0 +1,7 @@ +imageName: "myimage:{{ tag }}" +dockerfile: + uri: "{{uri}}/Dockerfile" + buildContext: /{{foo}}/{{bar}} + args: + - "-f" + - "{{ devnull }}" diff --git a/pkg/validation/variables/variables_component.go b/pkg/validation/variables/variables_component.go index ce5a3f1bc..de0e15e52 100644 --- a/pkg/validation/variables/variables_component.go +++ b/pkg/validation/variables/variables_component.go @@ -33,6 +33,12 @@ func ValidateAndReplaceForComponents(variables map[string]string, components []v componentsWarningMap[components[i].Name] = verr.Keys } } + case components[i].Image != nil: + if err = validateAndReplaceForImageComponent(variables, components[i].Image); err != nil { + if verr, ok := err.(*InvalidKeysError); ok { + componentsWarningMap[components[i].Name] = verr.Keys + } + } case components[i].Volume != nil: if err = validateAndReplaceForVolumeComponent(variables, components[i].Volume); err != nil { if verr, ok := err.(*InvalidKeysError); ok { @@ -189,6 +195,81 @@ func validateAndReplaceForOpenShiftComponent(variables map[string]string, opensh return newInvalidKeysError(invalidKeys) } +// validateAndReplaceForImageComponent validates the image component data for global variable references and replaces them with the variable value +func validateAndReplaceForImageComponent(variables map[string]string, image *v1alpha2.ImageComponent) error { + var err error + + invalidKeys := make(map[string]bool) + + if image != nil { + // Validate image's image name + if image.ImageName, err = validateAndReplaceDataWithVariable(image.ImageName, variables); err != nil { + checkForInvalidError(invalidKeys, err) + } + + switch { + case image.Dockerfile != nil: + if err = validateAndReplaceForDockerfileImageComponent(variables, image.Dockerfile); err != nil { + checkForInvalidError(invalidKeys, err) + } + } + + } + + return newInvalidKeysError(invalidKeys) +} + +// validateAndReplaceForDockerfileImageComponent validates the dockerfile image component data for global variable references and replaces them with the variable value +func validateAndReplaceForDockerfileImageComponent(variables map[string]string, dockerfileImage *v1alpha2.DockerfileImage) error { + var err error + + invalidKeys := make(map[string]bool) + + if dockerfileImage != nil { + + switch { + case dockerfileImage.Uri != "": + // Validate dockerfile image URI + if dockerfileImage.Uri, err = validateAndReplaceDataWithVariable(dockerfileImage.Uri, variables); err != nil { + checkForInvalidError(invalidKeys, err) + } + case dockerfileImage.Git != nil: + // Validate dockerfile Git location + if dockerfileImage.Git.GitLocation, err = validateAndReplaceDataWithVariable(dockerfileImage.Git.GitLocation, variables); err != nil { + checkForInvalidError(invalidKeys, err) + } + + gitProject := &dockerfileImage.Git.GitLikeProjectSource + if err = validateAndReplaceForGitProjectSource(variables, gitProject); err != nil { + checkForInvalidError(invalidKeys, err) + } + case dockerfileImage.Registry != nil: + // Validate dockerfile devfile registry src + if dockerfileImage.Registry.Id, err = validateAndReplaceDataWithVariable(dockerfileImage.Registry.Id, variables); err != nil { + checkForInvalidError(invalidKeys, err) + } + if dockerfileImage.Registry.DevfileRegistryUrl, err = validateAndReplaceDataWithVariable(dockerfileImage.Registry.DevfileRegistryUrl, variables); err != nil { + checkForInvalidError(invalidKeys, err) + } + } + + // Validate dockerfile image's build context + if dockerfileImage.BuildContext, err = validateAndReplaceDataWithVariable(dockerfileImage.BuildContext, variables); err != nil { + checkForInvalidError(invalidKeys, err) + } + + // Validate dockerfile image's args + for i := range dockerfileImage.Args { + if dockerfileImage.Args[i], err = validateAndReplaceDataWithVariable(dockerfileImage.Args[i], variables); err != nil { + checkForInvalidError(invalidKeys, err) + } + } + + } + + return newInvalidKeysError(invalidKeys) +} + // validateAndReplaceForVolumeComponent validates the volume component data for global variable references and replaces them with the variable value func validateAndReplaceForVolumeComponent(variables map[string]string, volume *v1alpha2.VolumeComponent) error { var err error diff --git a/pkg/validation/variables/variables_component_test.go b/pkg/validation/variables/variables_component_test.go index c972c8888..c327dad51 100644 --- a/pkg/validation/variables/variables_component_test.go +++ b/pkg/validation/variables/variables_component_test.go @@ -115,6 +115,81 @@ func TestValidateAndReplaceOpenShiftKubernetesComponent(t *testing.T) { } } +func TestValidateAndReplaceImageComponent(t *testing.T) { + + tests := []struct { + name string + testFile string + outputFile string + variableFile string + wantErr bool + }{ + { + name: "Good Substitution - dockerfile uri src", + testFile: "test-fixtures/components/image-dockerfile-uri.yaml", + outputFile: "test-fixtures/components/image-dockerfile-uri-output.yaml", + variableFile: "test-fixtures/variables/variables-referenced.yaml", + wantErr: false, + }, + { + name: "Good Substitution - dockerfile git src", + testFile: "test-fixtures/components/image-dockerfile-git.yaml", + outputFile: "test-fixtures/components/image-dockerfile-git-output.yaml", + variableFile: "test-fixtures/variables/variables-referenced.yaml", + wantErr: false, + }, + { + name: "Good Substitution - dockerfile registry src", + testFile: "test-fixtures/components/image-dockerfile-registry.yaml", + outputFile: "test-fixtures/components/image-dockerfile-registry-output.yaml", + variableFile: "test-fixtures/variables/variables-referenced.yaml", + wantErr: false, + }, + { + name: "Invalid Reference - dockerfile uri src", + testFile: "test-fixtures/components/image-dockerfile-uri.yaml", + outputFile: "test-fixtures/components/image-dockerfile-uri.yaml", + variableFile: "test-fixtures/variables/variables-notreferenced.yaml", + wantErr: true, + }, + { + name: "Invalid Reference - dockerfile git src", + testFile: "test-fixtures/components/image-dockerfile-git.yaml", + outputFile: "test-fixtures/components/image-dockerfile-git.yaml", + variableFile: "test-fixtures/variables/variables-notreferenced.yaml", + wantErr: true, + }, + { + name: "Invalid Reference - dockerfile registry src", + testFile: "test-fixtures/components/image-dockerfile-registry.yaml", + outputFile: "test-fixtures/components/image-dockerfile-registry.yaml", + variableFile: "test-fixtures/variables/variables-notreferenced.yaml", + wantErr: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + testImageComponent := v1alpha2.ImageComponent{} + readFileToStruct(t, tt.testFile, &testImageComponent) + + testVariable := make(map[string]string) + readFileToStruct(t, tt.variableFile, &testVariable) + + err := validateAndReplaceForImageComponent(testVariable, &testImageComponent) + _, ok := err.(*InvalidKeysError) + if tt.wantErr && !ok { + t.Errorf("Expected InvalidKeysError error from test but got %+v", err) + } else if !tt.wantErr && err != nil { + t.Errorf("Got unexpected error: %s", err) + } else { + expectedImageComponent := v1alpha2.ImageComponent{} + readFileToStruct(t, tt.outputFile, &expectedImageComponent) + assert.Equal(t, expectedImageComponent, testImageComponent, "The two values should be the same.") + } + }) + } +} + func TestValidateAndReplaceVolumeComponent(t *testing.T) { tests := []struct { diff --git a/pkg/validation/variables/variables_project.go b/pkg/validation/variables/variables_project.go index 09d1cdab1..e257ffe0e 100644 --- a/pkg/validation/variables/variables_project.go +++ b/pkg/validation/variables/variables_project.go @@ -85,33 +85,49 @@ func validateandReplaceForProjectSource(variables map[string]string, projectSour case projectSource.Git != nil: gitProject := &projectSource.Git.GitLikeProjectSource - if gitProject.CheckoutFrom != nil { - // validate git checkout revision - if gitProject.CheckoutFrom.Revision, err = validateAndReplaceDataWithVariable(gitProject.CheckoutFrom.Revision, variables); err != nil { - checkForInvalidError(invalidKeys, err) - } - - // // validate git checkout remote - if gitProject.CheckoutFrom.Remote, err = validateAndReplaceDataWithVariable(gitProject.CheckoutFrom.Remote, variables); err != nil { - checkForInvalidError(invalidKeys, err) - } + if err = validateAndReplaceForGitProjectSource(variables, gitProject); err != nil { + checkForInvalidError(invalidKeys, err) + } + } + } + + return newInvalidKeysError(invalidKeys) +} + +// validateAndReplaceForGitProjectSource validates a project git src for global variable references and replaces them with the variable value +func validateAndReplaceForGitProjectSource(variables map[string]string, gitProject *v1alpha2.GitLikeProjectSource) error { + + var err error + + invalidKeys := make(map[string]bool) + + if gitProject != nil { + if gitProject.CheckoutFrom != nil { + // validate git checkout revision + if gitProject.CheckoutFrom.Revision, err = validateAndReplaceDataWithVariable(gitProject.CheckoutFrom.Revision, variables); err != nil { + checkForInvalidError(invalidKeys, err) } - // validate git remotes - for k := range gitProject.Remotes { - // validate remote map value - if gitProject.Remotes[k], err = validateAndReplaceDataWithVariable(gitProject.Remotes[k], variables); err != nil { - checkForInvalidError(invalidKeys, err) - } - - // validate remote map key - var updatedKey string - if updatedKey, err = validateAndReplaceDataWithVariable(k, variables); err != nil { - checkForInvalidError(invalidKeys, err) - } else if updatedKey != k { - gitProject.Remotes[updatedKey] = gitProject.Remotes[k] - delete(gitProject.Remotes, k) - } + // // validate git checkout remote + if gitProject.CheckoutFrom.Remote, err = validateAndReplaceDataWithVariable(gitProject.CheckoutFrom.Remote, variables); err != nil { + checkForInvalidError(invalidKeys, err) + } + } + + // validate git remotes + for k := range gitProject.Remotes { + // validate remote map value + if gitProject.Remotes[k], err = validateAndReplaceDataWithVariable(gitProject.Remotes[k], variables); err != nil { + checkForInvalidError(invalidKeys, err) + } + + // validate remote map key + var updatedKey string + if updatedKey, err = validateAndReplaceDataWithVariable(k, variables); err != nil { + checkForInvalidError(invalidKeys, err) + } else if updatedKey != k { + gitProject.Remotes[updatedKey] = gitProject.Remotes[k] + delete(gitProject.Remotes, k) } } } diff --git a/pkg/validation/variables/variables_test.go b/pkg/validation/variables/variables_test.go index 6aa1936dd..0ebdc7eb6 100644 --- a/pkg/validation/variables/variables_test.go +++ b/pkg/validation/variables/variables_test.go @@ -39,6 +39,7 @@ func TestValidateGlobalVariableBasic(t *testing.T) { "component2": {"bar", "foo", "x"}, "component3": {"xyz"}, "component4": {"foo"}, + "component5": {"foo", "tag"}, }, Projects: map[string][]string{ "project1": {"dir", "path", "tag", "version", "version1"}, From 468c2fe2674e2b848baba9272d50f9b837370302 Mon Sep 17 00:00:00 2001 From: Maysun J Faisal Date: Wed, 25 Aug 2021 12:19:49 -0400 Subject: [PATCH 5/7] Add more tests for the new image component Signed-off-by: Maysun J Faisal --- ...pace.devfile.io_devworkspaces.v1beta1.yaml | 20 +++- crds/workspace.devfile.io_devworkspaces.yaml | 20 +++- ...file.io_devworkspacetemplates.v1beta1.yaml | 18 +++- ...pace.devfile.io_devworkspacetemplates.yaml | 18 +++- .../v1alpha2/component_image_dockerfile.go | 5 +- .../v1alpha2/zz_generated.parent_overrides.go | 12 ++- .../v1alpha2/zz_generated.plugin_overrides.go | 6 +- .../merges/duplicate-with-parent/main.yaml | 5 + .../merges/duplicate-with-parent/parent.yaml | 5 + .../duplicate-with-parent/result-error.txt | 2 +- .../merges/no-duplicate/parent.yaml | 5 + .../merges/no-duplicate/result.yaml | 5 + .../image-component-union/original.yaml | 17 ++++ .../patches/image-component-union/patch.yaml | 18 ++++ .../patches/image-component-union/result.yaml | 24 +++++ samples/devfiles/deployment-manifest.yaml | 26 +++++ ...ckerfile-build-inlined-deploy-devfile.yaml | 98 +++++++++++++++++++ ...p-dockerfile-build-uri-deploy-devfile.yaml | 69 +++++++++++++ .../latest/dev-workspace-template-spec.json | 8 +- schemas/latest/dev-workspace-template.json | 8 +- schemas/latest/dev-workspace.json | 8 +- schemas/latest/devfile.json | 4 +- .../dev-workspace-template-spec.json | 16 +-- .../ide-targeted/dev-workspace-template.json | 16 +-- .../latest/ide-targeted/dev-workspace.json | 16 +-- schemas/latest/ide-targeted/devfile.json | 8 +- .../latest/ide-targeted/parent-overrides.json | 8 +- .../latest/ide-targeted/plugin-overrides.json | 4 +- schemas/latest/parent-overrides.json | 4 +- schemas/latest/plugin-overrides.json | 2 +- 30 files changed, 403 insertions(+), 72 deletions(-) create mode 100644 pkg/utils/overriding/test-fixtures/patches/image-component-union/original.yaml create mode 100644 pkg/utils/overriding/test-fixtures/patches/image-component-union/patch.yaml create mode 100644 pkg/utils/overriding/test-fixtures/patches/image-component-union/result.yaml create mode 100644 samples/devfiles/deployment-manifest.yaml create mode 100644 samples/devfiles/outerloop-dockerfile-build-inlined-deploy-devfile.yaml create mode 100644 samples/devfiles/outerloop-dockerfile-build-uri-deploy-devfile.yaml diff --git a/crds/workspace.devfile.io_devworkspaces.v1beta1.yaml b/crds/workspace.devfile.io_devworkspaces.v1beta1.yaml index a89a2c730..093d36cfb 100644 --- a/crds/workspace.devfile.io_devworkspaces.v1beta1.yaml +++ b/crds/workspace.devfile.io_devworkspaces.v1beta1.yaml @@ -4694,7 +4694,9 @@ spec: type: string id: description: Id in a devfile registry that contains - a Dockerfile + a Dockerfile. The src in the OCI registry + required for the Dockerfile build will be + downloaded for building the image. type: string required: - id @@ -5440,7 +5442,10 @@ spec: type: string id: description: Id in a devfile registry - that contains a Dockerfile + that contains a Dockerfile. The + src in the OCI registry required + for the Dockerfile build will be + downloaded for building the image. type: string type: object rootRequired: @@ -6294,7 +6299,10 @@ spec: type: string id: description: Id in a devfile registry that - contains a Dockerfile + contains a Dockerfile. The src in the + OCI registry required for the Dockerfile + build will be downloaded for building + the image. type: string type: object rootRequired: @@ -7061,7 +7069,11 @@ spec: type: string id: description: Id in a devfile registry - that contains a Dockerfile + that contains a Dockerfile. + The src in the OCI registry + required for the Dockerfile + build will be downloaded for + building the image. type: string type: object rootRequired: diff --git a/crds/workspace.devfile.io_devworkspaces.yaml b/crds/workspace.devfile.io_devworkspaces.yaml index 06b46e15d..c2338173e 100644 --- a/crds/workspace.devfile.io_devworkspaces.yaml +++ b/crds/workspace.devfile.io_devworkspaces.yaml @@ -4695,7 +4695,9 @@ spec: type: string id: description: Id in a devfile registry that contains - a Dockerfile + a Dockerfile. The src in the OCI registry + required for the Dockerfile build will be + downloaded for building the image. type: string required: - id @@ -5445,7 +5447,10 @@ spec: type: string id: description: Id in a devfile registry - that contains a Dockerfile + that contains a Dockerfile. The + src in the OCI registry required + for the Dockerfile build will be + downloaded for building the image. type: string type: object rootRequired: @@ -6299,7 +6304,10 @@ spec: type: string id: description: Id in a devfile registry that - contains a Dockerfile + contains a Dockerfile. The src in the + OCI registry required for the Dockerfile + build will be downloaded for building + the image. type: string type: object rootRequired: @@ -7066,7 +7074,11 @@ spec: type: string id: description: Id in a devfile registry - that contains a Dockerfile + that contains a Dockerfile. + The src in the OCI registry + required for the Dockerfile + build will be downloaded for + building the image. type: string type: object rootRequired: diff --git a/crds/workspace.devfile.io_devworkspacetemplates.v1beta1.yaml b/crds/workspace.devfile.io_devworkspacetemplates.v1beta1.yaml index fad194462..4528008fb 100644 --- a/crds/workspace.devfile.io_devworkspacetemplates.v1beta1.yaml +++ b/crds/workspace.devfile.io_devworkspacetemplates.v1beta1.yaml @@ -4449,7 +4449,9 @@ spec: type: string id: description: Id in a devfile registry that contains - a Dockerfile + a Dockerfile. The src in the OCI registry required + for the Dockerfile build will be downloaded for + building the image. type: string required: - id @@ -5173,7 +5175,10 @@ spec: type: string id: description: Id in a devfile registry - that contains a Dockerfile + that contains a Dockerfile. The src + in the OCI registry required for the + Dockerfile build will be downloaded + for building the image. type: string type: object rootRequired: @@ -5993,7 +5998,9 @@ spec: type: string id: description: Id in a devfile registry that contains - a Dockerfile + a Dockerfile. The src in the OCI registry + required for the Dockerfile build will be + downloaded for building the image. type: string type: object rootRequired: @@ -6733,7 +6740,10 @@ spec: type: string id: description: Id in a devfile registry - that contains a Dockerfile + that contains a Dockerfile. The + src in the OCI registry required + for the Dockerfile build will be + downloaded for building the image. type: string type: object rootRequired: diff --git a/crds/workspace.devfile.io_devworkspacetemplates.yaml b/crds/workspace.devfile.io_devworkspacetemplates.yaml index ea7ecd7b4..00d1d38d2 100644 --- a/crds/workspace.devfile.io_devworkspacetemplates.yaml +++ b/crds/workspace.devfile.io_devworkspacetemplates.yaml @@ -4450,7 +4450,9 @@ spec: type: string id: description: Id in a devfile registry that contains - a Dockerfile + a Dockerfile. The src in the OCI registry required + for the Dockerfile build will be downloaded for + building the image. type: string required: - id @@ -5178,7 +5180,10 @@ spec: type: string id: description: Id in a devfile registry - that contains a Dockerfile + that contains a Dockerfile. The src + in the OCI registry required for the + Dockerfile build will be downloaded + for building the image. type: string type: object rootRequired: @@ -5998,7 +6003,9 @@ spec: type: string id: description: Id in a devfile registry that contains - a Dockerfile + a Dockerfile. The src in the OCI registry + required for the Dockerfile build will be + downloaded for building the image. type: string type: object rootRequired: @@ -6738,7 +6745,10 @@ spec: type: string id: description: Id in a devfile registry - that contains a Dockerfile + that contains a Dockerfile. The + src in the OCI registry required + for the Dockerfile build will be + downloaded for building the image. type: string type: object rootRequired: diff --git a/pkg/apis/workspaces/v1alpha2/component_image_dockerfile.go b/pkg/apis/workspaces/v1alpha2/component_image_dockerfile.go index 0eb7e8921..27cbcbe1d 100644 --- a/pkg/apis/workspaces/v1alpha2/component_image_dockerfile.go +++ b/pkg/apis/workspaces/v1alpha2/component_image_dockerfile.go @@ -58,7 +58,8 @@ type Dockerfile struct { } type DockerfileDevfileRegistrySource struct { - // Id in a devfile registry that contains a Dockerfile + // Id in a devfile registry that contains a Dockerfile. The src in the OCI registry + // required for the Dockerfile build will be downloaded for building the image. Id string `json:"id"` // Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. @@ -69,6 +70,8 @@ type DockerfileDevfileRegistrySource struct { } type DockerfileGitProjectSource struct { + // Git src for the Dockerfile build. The src required for the Dockerfile build will need to be + // cloned for building the image. GitProjectSource `json:",inline"` // Location of the Dockerfile in the Git repository when using git as Dockerfile src. diff --git a/pkg/apis/workspaces/v1alpha2/zz_generated.parent_overrides.go b/pkg/apis/workspaces/v1alpha2/zz_generated.parent_overrides.go index fe73d5705..b18d7bf09 100644 --- a/pkg/apis/workspaces/v1alpha2/zz_generated.parent_overrides.go +++ b/pkg/apis/workspaces/v1alpha2/zz_generated.parent_overrides.go @@ -1001,7 +1001,8 @@ type DockerfileLocationTypeParentOverride string type DockerfileDevfileRegistrySourceParentOverride struct { // +optional - // Id in a devfile registry that contains a Dockerfile + // Id in a devfile registry that contains a Dockerfile. The src in the OCI registry + // required for the Dockerfile build will be downloaded for building the image. Id string `json:"id,omitempty"` // Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. @@ -1012,6 +1013,9 @@ type DockerfileDevfileRegistrySourceParentOverride struct { } type DockerfileGitProjectSourceParentOverride struct { + + // Git src for the Dockerfile build. The src required for the Dockerfile build will need to be + // cloned for building the image. GitProjectSourceParentOverride `json:",inline"` // Location of the Dockerfile in the Git repository when using git as Dockerfile src. @@ -1351,7 +1355,8 @@ type DockerfileLocationTypePluginOverrideParentOverride string type DockerfileDevfileRegistrySourcePluginOverrideParentOverride struct { // +optional - // Id in a devfile registry that contains a Dockerfile + // Id in a devfile registry that contains a Dockerfile. The src in the OCI registry + // required for the Dockerfile build will be downloaded for building the image. Id string `json:"id,omitempty"` // Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. @@ -1362,6 +1367,9 @@ type DockerfileDevfileRegistrySourcePluginOverrideParentOverride struct { } type DockerfileGitProjectSourcePluginOverrideParentOverride struct { + + // Git src for the Dockerfile build. The src required for the Dockerfile build will need to be + // cloned for building the image. GitProjectSourcePluginOverrideParentOverride `json:",inline"` // Location of the Dockerfile in the Git repository when using git as Dockerfile src. diff --git a/pkg/apis/workspaces/v1alpha2/zz_generated.plugin_overrides.go b/pkg/apis/workspaces/v1alpha2/zz_generated.plugin_overrides.go index 0132b3621..5df551bb4 100644 --- a/pkg/apis/workspaces/v1alpha2/zz_generated.plugin_overrides.go +++ b/pkg/apis/workspaces/v1alpha2/zz_generated.plugin_overrides.go @@ -563,7 +563,8 @@ type DockerfileLocationTypePluginOverride string type DockerfileDevfileRegistrySourcePluginOverride struct { // +optional - // Id in a devfile registry that contains a Dockerfile + // Id in a devfile registry that contains a Dockerfile. The src in the OCI registry + // required for the Dockerfile build will be downloaded for building the image. Id string `json:"id,omitempty"` // Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. @@ -574,6 +575,9 @@ type DockerfileDevfileRegistrySourcePluginOverride struct { } type DockerfileGitProjectSourcePluginOverride struct { + + // Git src for the Dockerfile build. The src required for the Dockerfile build will need to be + // cloned for building the image. GitProjectSourcePluginOverride `json:",inline"` // Location of the Dockerfile in the Git repository when using git as Dockerfile src. diff --git a/pkg/utils/overriding/test-fixtures/merges/duplicate-with-parent/main.yaml b/pkg/utils/overriding/test-fixtures/merges/duplicate-with-parent/main.yaml index b1ac1a152..f8097ac81 100644 --- a/pkg/utils/overriding/test-fixtures/merges/duplicate-with-parent/main.yaml +++ b/pkg/utils/overriding/test-fixtures/merges/duplicate-with-parent/main.yaml @@ -8,3 +8,8 @@ components: - container: image: "aDifferentValue" name: "existing-in-parent" + - image: + imageName: "myimage:main" + dockerfile: + uri: "uri/Dockerfile" + name: "existing-in-parent-2" diff --git a/pkg/utils/overriding/test-fixtures/merges/duplicate-with-parent/parent.yaml b/pkg/utils/overriding/test-fixtures/merges/duplicate-with-parent/parent.yaml index 045d2b33a..905ff8617 100644 --- a/pkg/utils/overriding/test-fixtures/merges/duplicate-with-parent/parent.yaml +++ b/pkg/utils/overriding/test-fixtures/merges/duplicate-with-parent/parent.yaml @@ -6,3 +6,8 @@ components: - container: image: "aValue" name: "existing-in-parent" + - image: + imageName: "myimage:parent" + dockerfile: + uri: "uri/Dockerfile" + name: "existing-in-parent-2" diff --git a/pkg/utils/overriding/test-fixtures/merges/duplicate-with-parent/result-error.txt b/pkg/utils/overriding/test-fixtures/merges/duplicate-with-parent/result-error.txt index 358f7a5b9..2e57bab37 100644 --- a/pkg/utils/overriding/test-fixtures/merges/duplicate-with-parent/result-error.txt +++ b/pkg/utils/overriding/test-fixtures/merges/duplicate-with-parent/result-error.txt @@ -1,4 +1,4 @@ 3 errors occurred: - * Some Components are already defined in parent: existing-in-parent. If you want to override them, you should do it in the parent scope. + * Some Components are already defined in parent: existing-in-parent, existing-in-parent-2. If you want to override them, you should do it in the parent scope. * Some Variables are already defined in parent: objectVariable. If you want to override them, you should do it in the parent scope. * Some Attributes are already defined in parent: mainAttribute. If you want to override them, you should do it in the parent scope. diff --git a/pkg/utils/overriding/test-fixtures/merges/no-duplicate/parent.yaml b/pkg/utils/overriding/test-fixtures/merges/no-duplicate/parent.yaml index 5e5637f72..01270ae44 100644 --- a/pkg/utils/overriding/test-fixtures/merges/no-duplicate/parent.yaml +++ b/pkg/utils/overriding/test-fixtures/merges/no-duplicate/parent.yaml @@ -6,3 +6,8 @@ components: - container: image: "aValue" name: "parent-component" + - image: + imageName: "myimage:xyz" + dockerfile: + uri: "uri/Dockerfile" + name: "parent-component-2" diff --git a/pkg/utils/overriding/test-fixtures/merges/no-duplicate/result.yaml b/pkg/utils/overriding/test-fixtures/merges/no-duplicate/result.yaml index fe10426e2..da4cfe0d7 100644 --- a/pkg/utils/overriding/test-fixtures/merges/no-duplicate/result.yaml +++ b/pkg/utils/overriding/test-fixtures/merges/no-duplicate/result.yaml @@ -10,6 +10,11 @@ components: - container: image: "aValue" name: "parent-component" + - image: + imageName: "myimage:xyz" + dockerfile: + uri: "uri/Dockerfile" + name: "parent-component-2" - container: image: "aValue" name: "plugin-component" diff --git a/pkg/utils/overriding/test-fixtures/patches/image-component-union/original.yaml b/pkg/utils/overriding/test-fixtures/patches/image-component-union/original.yaml new file mode 100644 index 000000000..648ab8e7f --- /dev/null +++ b/pkg/utils/overriding/test-fixtures/patches/image-component-union/original.yaml @@ -0,0 +1,17 @@ +components: + - name: unchanged-component + kubernetes: + inlined: "componentToUpdateInline" + endpoints: + - name: endpoint-name + targetPort: 8080 + - name: component-to-update + image: + imageName: "myimage:xyz" + dockerfile: + uri: "uri/Dockerfile" + buildContext: /FOO/BAR + args: + - "-f" + - "/dev/null" + rootRequired: false diff --git a/pkg/utils/overriding/test-fixtures/patches/image-component-union/patch.yaml b/pkg/utils/overriding/test-fixtures/patches/image-component-union/patch.yaml new file mode 100644 index 000000000..a3d032b66 --- /dev/null +++ b/pkg/utils/overriding/test-fixtures/patches/image-component-union/patch.yaml @@ -0,0 +1,18 @@ +components: + - name: component-to-update + image: + imageName: "newimage:xyz" + dockerfile: + git: + gitLocation: "uri/Dockerfile" + checkoutFrom: + revision: "FOO" + remote: "BAR" + remotes: + "foo": "BAR" + "FOOBAR": "BARFOO" + buildContext: /BAR/FOO + args: + - "sleep" + - "400" + rootRequired: true diff --git a/pkg/utils/overriding/test-fixtures/patches/image-component-union/result.yaml b/pkg/utils/overriding/test-fixtures/patches/image-component-union/result.yaml new file mode 100644 index 000000000..3be96e8e5 --- /dev/null +++ b/pkg/utils/overriding/test-fixtures/patches/image-component-union/result.yaml @@ -0,0 +1,24 @@ +components: + - name: unchanged-component + kubernetes: + inlined: "componentToUpdateInline" + endpoints: + - name: endpoint-name + targetPort: 8080 + - name: component-to-update + image: + imageName: "newimage:xyz" + dockerfile: + git: + gitLocation: "uri/Dockerfile" + checkoutFrom: + revision: "FOO" + remote: "BAR" + remotes: + "foo": "BAR" + "FOOBAR": "BARFOO" + buildContext: /BAR/FOO + args: + - "sleep" + - "400" + rootRequired: true diff --git a/samples/devfiles/deployment-manifest.yaml b/samples/devfiles/deployment-manifest.yaml new file mode 100644 index 000000000..8b94de0b7 --- /dev/null +++ b/samples/devfiles/deployment-manifest.yaml @@ -0,0 +1,26 @@ +--- +kind: Deployment +apiVersion: apps/v1 +metadata: + name: my-node +spec: + replicas: 1 + selector: + matchLabels: + app: node-app + template: + metadata: + labels: + app: node-app + spec: + containers: + - name: my-node + image: node-image:latest + ports: + - name: http + containerPort: 3001 + protocol: TCP + resources: + limits: + memory: "128Mi" + cpu: "500m" diff --git a/samples/devfiles/outerloop-dockerfile-build-inlined-deploy-devfile.yaml b/samples/devfiles/outerloop-dockerfile-build-inlined-deploy-devfile.yaml new file mode 100644 index 000000000..4bad4039d --- /dev/null +++ b/samples/devfiles/outerloop-dockerfile-build-inlined-deploy-devfile.yaml @@ -0,0 +1,98 @@ +# Devfile based on the existing Node Sample https://github.com/nodeshift-starters/devfile-sample +schemaVersion: 2.1.0 +metadata: + name: nodejs + version: 1.0.1 + displayName: Node.js Runtime + description: Stack with Node.js 14 + tags: ["NodeJS", "Express", "ubi8"] + projectType: "nodejs" + language: "nodejs" +variables: + CONTAINER_IMAGE: node-image:latest + COMPONENT_NAME: my-node + PORT: "3001" +components: + - name: outerloop-build + image: + imageName: "{{CONTAINER_IMAGE}}" + dockerfile: + uri: ./Dockerfile + buildContext: /project + rootRequired: false + - name: outerloop-deploy + kubernetes: + inlined: | + kind: Deployment + apiVersion: apps/v1 + metadata: + name: {{COMPONENT_NAME}} + spec: + replicas: 1 + selector: + matchLabels: + app: node-app + template: + metadata: + labels: + app: node-app + spec: + containers: + - name: {{COMPONENT_NAME}} + image: {{CONTAINER_IMAGE}} + ports: + - name: http + containerPort: {{PORT}} + protocol: TCP + resources: + limits: + memory: "128Mi" + cpu: "500m" + - name: runtime + container: + image: registry.access.redhat.com/ubi8/nodejs-14:latest + memoryLimit: 1024Mi + mountSources: true + sourceMapping: /project + endpoints: + - name: http-3000 + targetPort: 3000 +commands: + - id: install + exec: + component: runtime + commandLine: npm install + workingDir: /project + group: + kind: build + isDefault: true + - id: run + exec: + component: runtime + commandLine: npm start + workingDir: /project + group: + kind: run + isDefault: true + - id: debug + exec: + component: runtime + commandLine: npm run debug + workingDir: /project + group: + kind: debug + isDefault: true + - id: test + exec: + component: runtime + commandLine: npm test + workingDir: /project + group: + kind: test + isDefault: true + - id: deployk8s + apply: + component: outerloop-deploy + group: + kind: deploy + isDefault: true diff --git a/samples/devfiles/outerloop-dockerfile-build-uri-deploy-devfile.yaml b/samples/devfiles/outerloop-dockerfile-build-uri-deploy-devfile.yaml new file mode 100644 index 000000000..8926d58a3 --- /dev/null +++ b/samples/devfiles/outerloop-dockerfile-build-uri-deploy-devfile.yaml @@ -0,0 +1,69 @@ +# Devfile based on the existing Node Sample https://github.com/nodeshift-starters/devfile-sample +schemaVersion: 2.1.0 +metadata: + name: nodejs + version: 1.0.1 + displayName: Node.js Runtime + description: Stack with Node.js 14 + tags: ["NodeJS", "Express", "ubi8"] + projectType: "nodejs" + language: "nodejs" +components: + - name: outerloop-build + image: + imageName: node-image:latest + dockerfile: + uri: ./Dockerfile + buildContext: /project + rootRequired: false + - name: outerloop-deploy + kubernetes: + uri: deployment-manifest.yaml + - name: runtime + container: + image: registry.access.redhat.com/ubi8/nodejs-14:latest + memoryLimit: 1024Mi + mountSources: true + sourceMapping: /project + endpoints: + - name: http-3000 + targetPort: 3000 +commands: + - id: install + exec: + component: runtime + commandLine: npm install + workingDir: /project + group: + kind: build + isDefault: true + - id: run + exec: + component: runtime + commandLine: npm start + workingDir: /project + group: + kind: run + isDefault: true + - id: debug + exec: + component: runtime + commandLine: npm run debug + workingDir: /project + group: + kind: debug + isDefault: true + - id: test + exec: + component: runtime + commandLine: npm test + workingDir: /project + group: + kind: test + isDefault: true + - id: deployk8s + apply: + component: outerloop-deploy + group: + kind: deploy + isDefault: true diff --git a/schemas/latest/dev-workspace-template-spec.json b/schemas/latest/dev-workspace-template-spec.json index 0217be21c..903118f0d 100644 --- a/schemas/latest/dev-workspace-template-spec.json +++ b/schemas/latest/dev-workspace-template-spec.json @@ -587,7 +587,7 @@ "type": "string" }, "id": { - "description": "Id in a devfile registry that contains a Dockerfile", + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", "type": "string" } }, @@ -1267,7 +1267,7 @@ "type": "string" }, "id": { - "description": "Id in a devfile registry that contains a Dockerfile", + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", "type": "string" } }, @@ -2055,7 +2055,7 @@ "type": "string" }, "id": { - "description": "Id in a devfile registry that contains a Dockerfile", + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", "type": "string" } }, @@ -2729,7 +2729,7 @@ "type": "string" }, "id": { - "description": "Id in a devfile registry that contains a Dockerfile", + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", "type": "string" } }, diff --git a/schemas/latest/dev-workspace-template.json b/schemas/latest/dev-workspace-template.json index bfff68b67..7a7f90215 100644 --- a/schemas/latest/dev-workspace-template.json +++ b/schemas/latest/dev-workspace-template.json @@ -753,7 +753,7 @@ "type": "string" }, "id": { - "description": "Id in a devfile registry that contains a Dockerfile", + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", "type": "string" } }, @@ -1433,7 +1433,7 @@ "type": "string" }, "id": { - "description": "Id in a devfile registry that contains a Dockerfile", + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", "type": "string" } }, @@ -2221,7 +2221,7 @@ "type": "string" }, "id": { - "description": "Id in a devfile registry that contains a Dockerfile", + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", "type": "string" } }, @@ -2895,7 +2895,7 @@ "type": "string" }, "id": { - "description": "Id in a devfile registry that contains a Dockerfile", + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", "type": "string" } }, diff --git a/schemas/latest/dev-workspace.json b/schemas/latest/dev-workspace.json index ca506552e..46535aff8 100644 --- a/schemas/latest/dev-workspace.json +++ b/schemas/latest/dev-workspace.json @@ -766,7 +766,7 @@ "type": "string" }, "id": { - "description": "Id in a devfile registry that contains a Dockerfile", + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", "type": "string" } }, @@ -1446,7 +1446,7 @@ "type": "string" }, "id": { - "description": "Id in a devfile registry that contains a Dockerfile", + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", "type": "string" } }, @@ -2234,7 +2234,7 @@ "type": "string" }, "id": { - "description": "Id in a devfile registry that contains a Dockerfile", + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", "type": "string" } }, @@ -2908,7 +2908,7 @@ "type": "string" }, "id": { - "description": "Id in a devfile registry that contains a Dockerfile", + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", "type": "string" } }, diff --git a/schemas/latest/devfile.json b/schemas/latest/devfile.json index 4b9012688..0cc9632e9 100644 --- a/schemas/latest/devfile.json +++ b/schemas/latest/devfile.json @@ -506,7 +506,7 @@ "type": "string" }, "id": { - "description": "Id in a devfile registry that contains a Dockerfile", + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", "type": "string" } }, @@ -1324,7 +1324,7 @@ "type": "string" }, "id": { - "description": "Id in a devfile registry that contains a Dockerfile", + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", "type": "string" } }, diff --git a/schemas/latest/ide-targeted/dev-workspace-template-spec.json b/schemas/latest/ide-targeted/dev-workspace-template-spec.json index 065a7d840..6c7720577 100644 --- a/schemas/latest/ide-targeted/dev-workspace-template-spec.json +++ b/schemas/latest/ide-targeted/dev-workspace-template-spec.json @@ -647,9 +647,9 @@ "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." }, "id": { - "description": "Id in a devfile registry that contains a Dockerfile", + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", "type": "string", - "markdownDescription": "Id in a devfile registry that contains a Dockerfile" + "markdownDescription": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image." } }, "additionalProperties": false, @@ -1399,9 +1399,9 @@ "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." }, "id": { - "description": "Id in a devfile registry that contains a Dockerfile", + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", "type": "string", - "markdownDescription": "Id in a devfile registry that contains a Dockerfile" + "markdownDescription": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image." } }, "additionalProperties": false, @@ -2282,9 +2282,9 @@ "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." }, "id": { - "description": "Id in a devfile registry that contains a Dockerfile", + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", "type": "string", - "markdownDescription": "Id in a devfile registry that contains a Dockerfile" + "markdownDescription": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image." } }, "additionalProperties": false, @@ -3032,9 +3032,9 @@ "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." }, "id": { - "description": "Id in a devfile registry that contains a Dockerfile", + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", "type": "string", - "markdownDescription": "Id in a devfile registry that contains a Dockerfile" + "markdownDescription": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image." } }, "additionalProperties": false, diff --git a/schemas/latest/ide-targeted/dev-workspace-template.json b/schemas/latest/ide-targeted/dev-workspace-template.json index edc829486..b6f5c21cb 100644 --- a/schemas/latest/ide-targeted/dev-workspace-template.json +++ b/schemas/latest/ide-targeted/dev-workspace-template.json @@ -846,9 +846,9 @@ "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." }, "id": { - "description": "Id in a devfile registry that contains a Dockerfile", + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", "type": "string", - "markdownDescription": "Id in a devfile registry that contains a Dockerfile" + "markdownDescription": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image." } }, "additionalProperties": false, @@ -1598,9 +1598,9 @@ "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." }, "id": { - "description": "Id in a devfile registry that contains a Dockerfile", + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", "type": "string", - "markdownDescription": "Id in a devfile registry that contains a Dockerfile" + "markdownDescription": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image." } }, "additionalProperties": false, @@ -2481,9 +2481,9 @@ "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." }, "id": { - "description": "Id in a devfile registry that contains a Dockerfile", + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", "type": "string", - "markdownDescription": "Id in a devfile registry that contains a Dockerfile" + "markdownDescription": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image." } }, "additionalProperties": false, @@ -3231,9 +3231,9 @@ "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." }, "id": { - "description": "Id in a devfile registry that contains a Dockerfile", + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", "type": "string", - "markdownDescription": "Id in a devfile registry that contains a Dockerfile" + "markdownDescription": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image." } }, "additionalProperties": false, diff --git a/schemas/latest/ide-targeted/dev-workspace.json b/schemas/latest/ide-targeted/dev-workspace.json index 7709f4ca0..a3f3995e9 100644 --- a/schemas/latest/ide-targeted/dev-workspace.json +++ b/schemas/latest/ide-targeted/dev-workspace.json @@ -859,9 +859,9 @@ "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." }, "id": { - "description": "Id in a devfile registry that contains a Dockerfile", + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", "type": "string", - "markdownDescription": "Id in a devfile registry that contains a Dockerfile" + "markdownDescription": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image." } }, "additionalProperties": false, @@ -1611,9 +1611,9 @@ "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." }, "id": { - "description": "Id in a devfile registry that contains a Dockerfile", + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", "type": "string", - "markdownDescription": "Id in a devfile registry that contains a Dockerfile" + "markdownDescription": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image." } }, "additionalProperties": false, @@ -2494,9 +2494,9 @@ "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." }, "id": { - "description": "Id in a devfile registry that contains a Dockerfile", + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", "type": "string", - "markdownDescription": "Id in a devfile registry that contains a Dockerfile" + "markdownDescription": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image." } }, "additionalProperties": false, @@ -3244,9 +3244,9 @@ "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." }, "id": { - "description": "Id in a devfile registry that contains a Dockerfile", + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", "type": "string", - "markdownDescription": "Id in a devfile registry that contains a Dockerfile" + "markdownDescription": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image." } }, "additionalProperties": false, diff --git a/schemas/latest/ide-targeted/devfile.json b/schemas/latest/ide-targeted/devfile.json index 4861f8c7a..a5254183d 100644 --- a/schemas/latest/ide-targeted/devfile.json +++ b/schemas/latest/ide-targeted/devfile.json @@ -556,9 +556,9 @@ "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." }, "id": { - "description": "Id in a devfile registry that contains a Dockerfile", + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", "type": "string", - "markdownDescription": "Id in a devfile registry that contains a Dockerfile" + "markdownDescription": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image." } }, "additionalProperties": false, @@ -1472,9 +1472,9 @@ "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." }, "id": { - "description": "Id in a devfile registry that contains a Dockerfile", + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", "type": "string", - "markdownDescription": "Id in a devfile registry that contains a Dockerfile" + "markdownDescription": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image." } }, "additionalProperties": false, diff --git a/schemas/latest/ide-targeted/parent-overrides.json b/schemas/latest/ide-targeted/parent-overrides.json index 0b86853c9..fc2792bd1 100644 --- a/schemas/latest/ide-targeted/parent-overrides.json +++ b/schemas/latest/ide-targeted/parent-overrides.json @@ -527,9 +527,9 @@ "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." }, "id": { - "description": "Id in a devfile registry that contains a Dockerfile", + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", "type": "string", - "markdownDescription": "Id in a devfile registry that contains a Dockerfile" + "markdownDescription": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image." } }, "additionalProperties": false, @@ -1277,9 +1277,9 @@ "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." }, "id": { - "description": "Id in a devfile registry that contains a Dockerfile", + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", "type": "string", - "markdownDescription": "Id in a devfile registry that contains a Dockerfile" + "markdownDescription": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image." } }, "additionalProperties": false, diff --git a/schemas/latest/ide-targeted/plugin-overrides.json b/schemas/latest/ide-targeted/plugin-overrides.json index 01fdbe04f..61aa9d438 100644 --- a/schemas/latest/ide-targeted/plugin-overrides.json +++ b/schemas/latest/ide-targeted/plugin-overrides.json @@ -516,9 +516,9 @@ "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." }, "id": { - "description": "Id in a devfile registry that contains a Dockerfile", + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", "type": "string", - "markdownDescription": "Id in a devfile registry that contains a Dockerfile" + "markdownDescription": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image." } }, "additionalProperties": false, diff --git a/schemas/latest/parent-overrides.json b/schemas/latest/parent-overrides.json index 0e3b5a897..514e5f000 100644 --- a/schemas/latest/parent-overrides.json +++ b/schemas/latest/parent-overrides.json @@ -473,7 +473,7 @@ "type": "string" }, "id": { - "description": "Id in a devfile registry that contains a Dockerfile", + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", "type": "string" } }, @@ -1147,7 +1147,7 @@ "type": "string" }, "id": { - "description": "Id in a devfile registry that contains a Dockerfile", + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", "type": "string" } }, diff --git a/schemas/latest/plugin-overrides.json b/schemas/latest/plugin-overrides.json index cbf4a0885..273012896 100644 --- a/schemas/latest/plugin-overrides.json +++ b/schemas/latest/plugin-overrides.json @@ -463,7 +463,7 @@ "type": "string" }, "id": { - "description": "Id in a devfile registry that contains a Dockerfile", + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", "type": "string" } }, From 12f89913256e9b403de1d974d0b514b940b56aee Mon Sep 17 00:00:00 2001 From: Maysun J Faisal Date: Wed, 8 Sep 2021 17:32:53 -0400 Subject: [PATCH 6/7] Apply Outerloop PR feedback Signed-off-by: Maysun J Faisal --- ...pace.devfile.io_devworkspaces.v1beta1.yaml | 298 +++++++++--------- crds/workspace.devfile.io_devworkspaces.yaml | 298 +++++++++--------- ...file.io_devworkspacetemplates.v1beta1.yaml | 285 +++++++++-------- ...pace.devfile.io_devworkspacetemplates.yaml | 285 +++++++++-------- .../v1alpha1/commands_conversion.go | 73 ++--- .../v1alpha2/component_image_dockerfile.go | 33 +- pkg/apis/workspaces/v1alpha2/projects.go | 2 +- .../v1alpha2/zz_generated.deepcopy.go | 168 +++++----- .../v1alpha2/zz_generated.parent_overrides.go | 59 ++-- .../v1alpha2/zz_generated.plugin_overrides.go | 30 +- .../zz_generated.union_definitions.go | 96 +++--- .../patches/image-component-union/patch.yaml | 5 +- .../patches/image-component-union/result.yaml | 5 +- pkg/validation/components.go | 9 + pkg/validation/components_test.go | 124 +++++++- pkg/validation/errors.go | 10 +- pkg/validation/projects.go | 42 +-- pkg/validation/projects_test.go | 4 +- pkg/validation/validation-rule.md | 7 +- .../image-dockerfile-git-output.yaml | 5 +- .../components/image-dockerfile-git.yaml | 5 +- .../image-dockerfile-registry-output.yaml | 4 +- .../components/image-dockerfile-registry.yaml | 4 +- .../variables/variables_component.go | 8 +- ...ckerfile-build-inlined-deploy-devfile.yaml | 9 +- ...p-dockerfile-build-uri-deploy-devfile.yaml | 9 +- .../latest/dev-workspace-template-spec.json | 166 +++++----- schemas/latest/dev-workspace-template.json | 166 +++++----- schemas/latest/dev-workspace.json | 166 +++++----- schemas/latest/devfile.json | 90 +++--- .../dev-workspace-template-spec.json | 214 ++++++------- .../ide-targeted/dev-workspace-template.json | 214 ++++++------- .../latest/ide-targeted/dev-workspace.json | 214 ++++++------- schemas/latest/ide-targeted/devfile.json | 118 +++---- .../latest/ide-targeted/parent-overrides.json | 104 +++--- .../latest/ide-targeted/plugin-overrides.json | 48 +-- schemas/latest/parent-overrides.json | 80 ++--- schemas/latest/plugin-overrides.json | 38 +-- 38 files changed, 1849 insertions(+), 1646 deletions(-) diff --git a/crds/workspace.devfile.io_devworkspaces.v1beta1.yaml b/crds/workspace.devfile.io_devworkspaces.v1beta1.yaml index 093d36cfb..cda25a565 100644 --- a/crds/workspace.devfile.io_devworkspaces.v1beta1.yaml +++ b/crds/workspace.devfile.io_devworkspaces.v1beta1.yaml @@ -4624,7 +4624,7 @@ spec: - required: - uri - required: - - registry + - devfileRegistry - required: - git properties: @@ -4639,6 +4639,26 @@ spec: build context. Defaults to ${PROJECT_ROOT} in the container type: string + devfileRegistry: + description: Dockerfile's Devfile Registry source + properties: + id: + description: Id in a devfile registry that contains + a Dockerfile. The src in the OCI registry + required for the Dockerfile build will be + downloaded for building the image. + type: string + registryUrl: + description: Devfile Registry URL to pull the + Dockerfile from when using the Devfile Registry + as Dockerfile src. To ensure the Dockerfile + gets resolved consistently in different environments, + it is recommended to always specify the `devfileRegistryUrl` + when `Id` is used. + type: string + required: + - id + type: object git: description: Dockerfile's Git source properties: @@ -4659,52 +4679,34 @@ spec: revision is not found. type: string type: object - gitLocation: + fileLocation: description: Location of the Dockerfile in the Git repository when using git as Dockerfile - src. + src. Defaults to Dockerfile. type: string remotes: additionalProperties: type: string description: The remotes map which should be - initialized in the git project. Must have - at least one remote configured + initialized in the git project. Projects must + have at least one remote configured while + StarterProjects & Image Component's Git source + can only have at most one remote configured. type: object required: - remotes type: object - locationType: - description: Type of Dockerfile location - enum: - - Uri - - Registry - - Git - type: string - registry: - description: Dockerfile's Devfile Registry source - properties: - devfileRegistryUrl: - description: Devfile Registry URL to pull the - Dockerfile from when using the Devfile Registry - as Dockerfile src. To ensure the Dockerfile - gets resolved consistently in different environments, - it is recommended to always specify the `devfileRegistryUrl` - when `Id` is used. - type: string - id: - description: Id in a devfile registry that contains - a Dockerfile. The src in the OCI registry - required for the Dockerfile build will be - downloaded for building the image. - type: string - required: - - id - type: object rootRequired: description: "Specify if a privileged builder pod is required. \n Default value is `false`" type: boolean + srcType: + description: Type of Dockerfile src + enum: + - Uri + - DevfileRegistry + - Git + type: string uri: description: URI Reference of a Dockerfile. It can be a full URL or a relative URI from the current @@ -5367,7 +5369,7 @@ spec: - required: - uri - required: - - registry + - devfileRegistry - required: - git properties: @@ -5382,6 +5384,28 @@ spec: to establish build context. Defaults to ${PROJECT_ROOT} in the container type: string + devfileRegistry: + description: Dockerfile's Devfile Registry + source + properties: + id: + description: Id in a devfile registry + that contains a Dockerfile. The + src in the OCI registry required + for the Dockerfile build will be + downloaded for building the image. + type: string + registryUrl: + description: Devfile Registry URL + to pull the Dockerfile from when + using the Devfile Registry as Dockerfile + src. To ensure the Dockerfile gets + resolved consistently in different + environments, it is recommended + to always specify the `devfileRegistryUrl` + when `Id` is used. + type: string + type: object git: description: Dockerfile's Git source properties: @@ -5405,54 +5429,35 @@ spec: revision is not found. type: string type: object - gitLocation: + fileLocation: description: Location of the Dockerfile in the Git repository when using - git as Dockerfile src. + git as Dockerfile src. Defaults + to Dockerfile. type: string remotes: additionalProperties: type: string description: The remotes map which should be initialized in the git - project. Must have at least one - remote configured + project. Projects must have at least + one remote configured while StarterProjects + & Image Component's Git source can + only have at most one remote configured. type: object type: object - locationType: - description: Type of Dockerfile location - enum: - - Uri - - Registry - - Git - type: string - registry: - description: Dockerfile's Devfile Registry - source - properties: - devfileRegistryUrl: - description: Devfile Registry URL - to pull the Dockerfile from when - using the Devfile Registry as Dockerfile - src. To ensure the Dockerfile gets - resolved consistently in different - environments, it is recommended - to always specify the `devfileRegistryUrl` - when `Id` is used. - type: string - id: - description: Id in a devfile registry - that contains a Dockerfile. The - src in the OCI registry required - for the Dockerfile build will be - downloaded for building the image. - type: string - type: object rootRequired: description: "Specify if a privileged builder pod is required. \n Default value is `false`" type: boolean + srcType: + description: Type of Dockerfile src + enum: + - Uri + - DevfileRegistry + - Git + type: string uri: description: URI Reference of a Dockerfile. It can be a full URL or a relative URI @@ -6229,7 +6234,7 @@ spec: - required: - uri - required: - - registry + - devfileRegistry - required: - git properties: @@ -6244,6 +6249,26 @@ spec: build context. Defaults to ${PROJECT_ROOT} in the container type: string + devfileRegistry: + description: Dockerfile's Devfile Registry source + properties: + id: + description: Id in a devfile registry that + contains a Dockerfile. The src in the + OCI registry required for the Dockerfile + build will be downloaded for building + the image. + type: string + registryUrl: + description: Devfile Registry URL to pull + the Dockerfile from when using the Devfile + Registry as Dockerfile src. To ensure + the Dockerfile gets resolved consistently + in different environments, it is recommended + to always specify the `devfileRegistryUrl` + when `Id` is used. + type: string + type: object git: description: Dockerfile's Git source properties: @@ -6265,50 +6290,33 @@ spec: not found. type: string type: object - gitLocation: + fileLocation: description: Location of the Dockerfile in the Git repository when using git as - Dockerfile src. + Dockerfile src. Defaults to Dockerfile. type: string remotes: additionalProperties: type: string description: The remotes map which should - be initialized in the git project. Must - have at least one remote configured + be initialized in the git project. Projects + must have at least one remote configured + while StarterProjects & Image Component's + Git source can only have at most one remote + configured. type: object type: object - locationType: - description: Type of Dockerfile location - enum: - - Uri - - Registry - - Git - type: string - registry: - description: Dockerfile's Devfile Registry source - properties: - devfileRegistryUrl: - description: Devfile Registry URL to pull - the Dockerfile from when using the Devfile - Registry as Dockerfile src. To ensure - the Dockerfile gets resolved consistently - in different environments, it is recommended - to always specify the `devfileRegistryUrl` - when `Id` is used. - type: string - id: - description: Id in a devfile registry that - contains a Dockerfile. The src in the - OCI registry required for the Dockerfile - build will be downloaded for building - the image. - type: string - type: object rootRequired: description: "Specify if a privileged builder pod is required. \n Default value is `false`" type: boolean + srcType: + description: Type of Dockerfile src + enum: + - Uri + - DevfileRegistry + - Git + type: string uri: description: URI Reference of a Dockerfile. It can be a full URL or a relative URI from @@ -6992,7 +7000,7 @@ spec: - required: - uri - required: - - registry + - devfileRegistry - required: - git properties: @@ -7007,6 +7015,30 @@ spec: to establish build context. Defaults to ${PROJECT_ROOT} in the container type: string + devfileRegistry: + description: Dockerfile's Devfile + Registry source + properties: + id: + description: Id in a devfile registry + that contains a Dockerfile. + The src in the OCI registry + required for the Dockerfile + build will be downloaded for + building the image. + type: string + registryUrl: + description: Devfile Registry + URL to pull the Dockerfile from + when using the Devfile Registry + as Dockerfile src. To ensure + the Dockerfile gets resolved + consistently in different environments, + it is recommended to always + specify the `devfileRegistryUrl` + when `Id` is used. + type: string + type: object git: description: Dockerfile's Git source properties: @@ -7031,56 +7063,36 @@ spec: revision is not found. type: string type: object - gitLocation: + fileLocation: description: Location of the Dockerfile in the Git repository when using - git as Dockerfile src. + git as Dockerfile src. Defaults + to Dockerfile. type: string remotes: additionalProperties: type: string description: The remotes map which should be initialized in the - git project. Must have at least - one remote configured + git project. Projects must have + at least one remote configured + while StarterProjects & Image + Component's Git source can only + have at most one remote configured. type: object type: object - locationType: - description: Type of Dockerfile location - enum: - - Uri - - Registry - - Git - type: string - registry: - description: Dockerfile's Devfile - Registry source - properties: - devfileRegistryUrl: - description: Devfile Registry - URL to pull the Dockerfile from - when using the Devfile Registry - as Dockerfile src. To ensure - the Dockerfile gets resolved - consistently in different environments, - it is recommended to always - specify the `devfileRegistryUrl` - when `Id` is used. - type: string - id: - description: Id in a devfile registry - that contains a Dockerfile. - The src in the OCI registry - required for the Dockerfile - build will be downloaded for - building the image. - type: string - type: object rootRequired: description: "Specify if a privileged builder pod is required. \n Default value is `false`" type: boolean + srcType: + description: Type of Dockerfile src + enum: + - Uri + - DevfileRegistry + - Git + type: string uri: description: URI Reference of a Dockerfile. It can be a full URL or a relative @@ -7482,8 +7494,9 @@ spec: type: string description: The remotes map which should be initialized in the git project. Projects must have at least - one remote configured while StarterProjects can - only have at most one remote configured. + one remote configured while StarterProjects & + Image Component's Git source can only have at + most one remote configured. type: object type: object name: @@ -7560,8 +7573,9 @@ spec: type: string description: The remotes map which should be initialized in the git project. Projects must have at least - one remote configured while StarterProjects can - only have at most one remote configured. + one remote configured while StarterProjects & + Image Component's Git source can only have at + most one remote configured. type: object type: object name: @@ -7666,8 +7680,8 @@ spec: type: string description: The remotes map which should be initialized in the git project. Projects must have at least one - remote configured while StarterProjects can only have - at most one remote configured. + remote configured while StarterProjects & Image Component's + Git source can only have at most one remote configured. type: object required: - remotes @@ -7753,8 +7767,8 @@ spec: type: string description: The remotes map which should be initialized in the git project. Projects must have at least one - remote configured while StarterProjects can only have - at most one remote configured. + remote configured while StarterProjects & Image Component's + Git source can only have at most one remote configured. type: object required: - remotes diff --git a/crds/workspace.devfile.io_devworkspaces.yaml b/crds/workspace.devfile.io_devworkspaces.yaml index c2338173e..95b16f85e 100644 --- a/crds/workspace.devfile.io_devworkspaces.yaml +++ b/crds/workspace.devfile.io_devworkspaces.yaml @@ -4625,7 +4625,7 @@ spec: - required: - uri - required: - - registry + - devfileRegistry - required: - git properties: @@ -4640,6 +4640,26 @@ spec: build context. Defaults to ${PROJECT_ROOT} in the container type: string + devfileRegistry: + description: Dockerfile's Devfile Registry source + properties: + id: + description: Id in a devfile registry that contains + a Dockerfile. The src in the OCI registry + required for the Dockerfile build will be + downloaded for building the image. + type: string + registryUrl: + description: Devfile Registry URL to pull the + Dockerfile from when using the Devfile Registry + as Dockerfile src. To ensure the Dockerfile + gets resolved consistently in different environments, + it is recommended to always specify the `devfileRegistryUrl` + when `Id` is used. + type: string + required: + - id + type: object git: description: Dockerfile's Git source properties: @@ -4660,52 +4680,34 @@ spec: revision is not found. type: string type: object - gitLocation: + fileLocation: description: Location of the Dockerfile in the Git repository when using git as Dockerfile - src. + src. Defaults to Dockerfile. type: string remotes: additionalProperties: type: string description: The remotes map which should be - initialized in the git project. Must have - at least one remote configured + initialized in the git project. Projects must + have at least one remote configured while + StarterProjects & Image Component's Git source + can only have at most one remote configured. type: object required: - remotes type: object - locationType: - description: Type of Dockerfile location - enum: - - Uri - - Registry - - Git - type: string - registry: - description: Dockerfile's Devfile Registry source - properties: - devfileRegistryUrl: - description: Devfile Registry URL to pull the - Dockerfile from when using the Devfile Registry - as Dockerfile src. To ensure the Dockerfile - gets resolved consistently in different environments, - it is recommended to always specify the `devfileRegistryUrl` - when `Id` is used. - type: string - id: - description: Id in a devfile registry that contains - a Dockerfile. The src in the OCI registry - required for the Dockerfile build will be - downloaded for building the image. - type: string - required: - - id - type: object rootRequired: description: "Specify if a privileged builder pod is required. \n Default value is `false`" type: boolean + srcType: + description: Type of Dockerfile src + enum: + - Uri + - DevfileRegistry + - Git + type: string uri: description: URI Reference of a Dockerfile. It can be a full URL or a relative URI from the current @@ -5372,7 +5374,7 @@ spec: - required: - uri - required: - - registry + - devfileRegistry - required: - git properties: @@ -5387,6 +5389,28 @@ spec: to establish build context. Defaults to ${PROJECT_ROOT} in the container type: string + devfileRegistry: + description: Dockerfile's Devfile Registry + source + properties: + id: + description: Id in a devfile registry + that contains a Dockerfile. The + src in the OCI registry required + for the Dockerfile build will be + downloaded for building the image. + type: string + registryUrl: + description: Devfile Registry URL + to pull the Dockerfile from when + using the Devfile Registry as Dockerfile + src. To ensure the Dockerfile gets + resolved consistently in different + environments, it is recommended + to always specify the `devfileRegistryUrl` + when `Id` is used. + type: string + type: object git: description: Dockerfile's Git source properties: @@ -5410,54 +5434,35 @@ spec: revision is not found. type: string type: object - gitLocation: + fileLocation: description: Location of the Dockerfile in the Git repository when using - git as Dockerfile src. + git as Dockerfile src. Defaults + to Dockerfile. type: string remotes: additionalProperties: type: string description: The remotes map which should be initialized in the git - project. Must have at least one - remote configured + project. Projects must have at least + one remote configured while StarterProjects + & Image Component's Git source can + only have at most one remote configured. type: object type: object - locationType: - description: Type of Dockerfile location - enum: - - Uri - - Registry - - Git - type: string - registry: - description: Dockerfile's Devfile Registry - source - properties: - devfileRegistryUrl: - description: Devfile Registry URL - to pull the Dockerfile from when - using the Devfile Registry as Dockerfile - src. To ensure the Dockerfile gets - resolved consistently in different - environments, it is recommended - to always specify the `devfileRegistryUrl` - when `Id` is used. - type: string - id: - description: Id in a devfile registry - that contains a Dockerfile. The - src in the OCI registry required - for the Dockerfile build will be - downloaded for building the image. - type: string - type: object rootRequired: description: "Specify if a privileged builder pod is required. \n Default value is `false`" type: boolean + srcType: + description: Type of Dockerfile src + enum: + - Uri + - DevfileRegistry + - Git + type: string uri: description: URI Reference of a Dockerfile. It can be a full URL or a relative URI @@ -6234,7 +6239,7 @@ spec: - required: - uri - required: - - registry + - devfileRegistry - required: - git properties: @@ -6249,6 +6254,26 @@ spec: build context. Defaults to ${PROJECT_ROOT} in the container type: string + devfileRegistry: + description: Dockerfile's Devfile Registry source + properties: + id: + description: Id in a devfile registry that + contains a Dockerfile. The src in the + OCI registry required for the Dockerfile + build will be downloaded for building + the image. + type: string + registryUrl: + description: Devfile Registry URL to pull + the Dockerfile from when using the Devfile + Registry as Dockerfile src. To ensure + the Dockerfile gets resolved consistently + in different environments, it is recommended + to always specify the `devfileRegistryUrl` + when `Id` is used. + type: string + type: object git: description: Dockerfile's Git source properties: @@ -6270,50 +6295,33 @@ spec: not found. type: string type: object - gitLocation: + fileLocation: description: Location of the Dockerfile in the Git repository when using git as - Dockerfile src. + Dockerfile src. Defaults to Dockerfile. type: string remotes: additionalProperties: type: string description: The remotes map which should - be initialized in the git project. Must - have at least one remote configured + be initialized in the git project. Projects + must have at least one remote configured + while StarterProjects & Image Component's + Git source can only have at most one remote + configured. type: object type: object - locationType: - description: Type of Dockerfile location - enum: - - Uri - - Registry - - Git - type: string - registry: - description: Dockerfile's Devfile Registry source - properties: - devfileRegistryUrl: - description: Devfile Registry URL to pull - the Dockerfile from when using the Devfile - Registry as Dockerfile src. To ensure - the Dockerfile gets resolved consistently - in different environments, it is recommended - to always specify the `devfileRegistryUrl` - when `Id` is used. - type: string - id: - description: Id in a devfile registry that - contains a Dockerfile. The src in the - OCI registry required for the Dockerfile - build will be downloaded for building - the image. - type: string - type: object rootRequired: description: "Specify if a privileged builder pod is required. \n Default value is `false`" type: boolean + srcType: + description: Type of Dockerfile src + enum: + - Uri + - DevfileRegistry + - Git + type: string uri: description: URI Reference of a Dockerfile. It can be a full URL or a relative URI from @@ -6997,7 +7005,7 @@ spec: - required: - uri - required: - - registry + - devfileRegistry - required: - git properties: @@ -7012,6 +7020,30 @@ spec: to establish build context. Defaults to ${PROJECT_ROOT} in the container type: string + devfileRegistry: + description: Dockerfile's Devfile + Registry source + properties: + id: + description: Id in a devfile registry + that contains a Dockerfile. + The src in the OCI registry + required for the Dockerfile + build will be downloaded for + building the image. + type: string + registryUrl: + description: Devfile Registry + URL to pull the Dockerfile from + when using the Devfile Registry + as Dockerfile src. To ensure + the Dockerfile gets resolved + consistently in different environments, + it is recommended to always + specify the `devfileRegistryUrl` + when `Id` is used. + type: string + type: object git: description: Dockerfile's Git source properties: @@ -7036,56 +7068,36 @@ spec: revision is not found. type: string type: object - gitLocation: + fileLocation: description: Location of the Dockerfile in the Git repository when using - git as Dockerfile src. + git as Dockerfile src. Defaults + to Dockerfile. type: string remotes: additionalProperties: type: string description: The remotes map which should be initialized in the - git project. Must have at least - one remote configured + git project. Projects must have + at least one remote configured + while StarterProjects & Image + Component's Git source can only + have at most one remote configured. type: object type: object - locationType: - description: Type of Dockerfile location - enum: - - Uri - - Registry - - Git - type: string - registry: - description: Dockerfile's Devfile - Registry source - properties: - devfileRegistryUrl: - description: Devfile Registry - URL to pull the Dockerfile from - when using the Devfile Registry - as Dockerfile src. To ensure - the Dockerfile gets resolved - consistently in different environments, - it is recommended to always - specify the `devfileRegistryUrl` - when `Id` is used. - type: string - id: - description: Id in a devfile registry - that contains a Dockerfile. - The src in the OCI registry - required for the Dockerfile - build will be downloaded for - building the image. - type: string - type: object rootRequired: description: "Specify if a privileged builder pod is required. \n Default value is `false`" type: boolean + srcType: + description: Type of Dockerfile src + enum: + - Uri + - DevfileRegistry + - Git + type: string uri: description: URI Reference of a Dockerfile. It can be a full URL or a relative @@ -7487,8 +7499,9 @@ spec: type: string description: The remotes map which should be initialized in the git project. Projects must have at least - one remote configured while StarterProjects can - only have at most one remote configured. + one remote configured while StarterProjects & + Image Component's Git source can only have at + most one remote configured. type: object type: object name: @@ -7565,8 +7578,9 @@ spec: type: string description: The remotes map which should be initialized in the git project. Projects must have at least - one remote configured while StarterProjects can - only have at most one remote configured. + one remote configured while StarterProjects & + Image Component's Git source can only have at + most one remote configured. type: object type: object name: @@ -7671,8 +7685,8 @@ spec: type: string description: The remotes map which should be initialized in the git project. Projects must have at least one - remote configured while StarterProjects can only have - at most one remote configured. + remote configured while StarterProjects & Image Component's + Git source can only have at most one remote configured. type: object required: - remotes @@ -7758,8 +7772,8 @@ spec: type: string description: The remotes map which should be initialized in the git project. Projects must have at least one - remote configured while StarterProjects can only have - at most one remote configured. + remote configured while StarterProjects & Image Component's + Git source can only have at most one remote configured. type: object required: - remotes diff --git a/crds/workspace.devfile.io_devworkspacetemplates.v1beta1.yaml b/crds/workspace.devfile.io_devworkspacetemplates.v1beta1.yaml index 4528008fb..db000a11e 100644 --- a/crds/workspace.devfile.io_devworkspacetemplates.v1beta1.yaml +++ b/crds/workspace.devfile.io_devworkspacetemplates.v1beta1.yaml @@ -4381,7 +4381,7 @@ spec: - required: - uri - required: - - registry + - devfileRegistry - required: - git properties: @@ -4395,6 +4395,26 @@ spec: description: Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container type: string + devfileRegistry: + description: Dockerfile's Devfile Registry source + properties: + id: + description: Id in a devfile registry that contains + a Dockerfile. The src in the OCI registry required + for the Dockerfile build will be downloaded for + building the image. + type: string + registryUrl: + description: Devfile Registry URL to pull the Dockerfile + from when using the Devfile Registry as Dockerfile + src. To ensure the Dockerfile gets resolved consistently + in different environments, it is recommended to + always specify the `devfileRegistryUrl` when `Id` + is used. + type: string + required: + - id + type: object git: description: Dockerfile's Git source properties: @@ -4415,51 +4435,34 @@ spec: is not found. type: string type: object - gitLocation: + fileLocation: description: Location of the Dockerfile in the Git - repository when using git as Dockerfile src. + repository when using git as Dockerfile src. Defaults + to Dockerfile. type: string remotes: additionalProperties: type: string description: The remotes map which should be initialized - in the git project. Must have at least one remote - configured + in the git project. Projects must have at least + one remote configured while StarterProjects & + Image Component's Git source can only have at + most one remote configured. type: object required: - remotes type: object - locationType: - description: Type of Dockerfile location - enum: - - Uri - - Registry - - Git - type: string - registry: - description: Dockerfile's Devfile Registry source - properties: - devfileRegistryUrl: - description: Devfile Registry URL to pull the Dockerfile - from when using the Devfile Registry as Dockerfile - src. To ensure the Dockerfile gets resolved consistently - in different environments, it is recommended to - always specify the `devfileRegistryUrl` when `Id` - is used. - type: string - id: - description: Id in a devfile registry that contains - a Dockerfile. The src in the OCI registry required - for the Dockerfile build will be downloaded for - building the image. - type: string - required: - - id - type: object rootRequired: description: "Specify if a privileged builder pod is required. \n Default value is `false`" type: boolean + srcType: + description: Type of Dockerfile src + enum: + - Uri + - DevfileRegistry + - Git + type: string uri: description: URI Reference of a Dockerfile. It can be a full URL or a relative URI from the current devfile @@ -5104,7 +5107,7 @@ spec: - required: - uri - required: - - registry + - devfileRegistry - required: - git properties: @@ -5119,6 +5122,27 @@ spec: build context. Defaults to ${PROJECT_ROOT} in the container type: string + devfileRegistry: + description: Dockerfile's Devfile Registry + source + properties: + id: + description: Id in a devfile registry + that contains a Dockerfile. The src + in the OCI registry required for the + Dockerfile build will be downloaded + for building the image. + type: string + registryUrl: + description: Devfile Registry URL to pull + the Dockerfile from when using the Devfile + Registry as Dockerfile src. To ensure + the Dockerfile gets resolved consistently + in different environments, it is recommended + to always specify the `devfileRegistryUrl` + when `Id` is used. + type: string + type: object git: description: Dockerfile's Git source properties: @@ -5140,51 +5164,33 @@ spec: is not found. type: string type: object - gitLocation: + fileLocation: description: Location of the Dockerfile in the Git repository when using git - as Dockerfile src. + as Dockerfile src. Defaults to Dockerfile. type: string remotes: additionalProperties: type: string description: The remotes map which should - be initialized in the git project. Must - have at least one remote configured + be initialized in the git project. Projects + must have at least one remote configured + while StarterProjects & Image Component's + Git source can only have at most one + remote configured. type: object type: object - locationType: - description: Type of Dockerfile location - enum: - - Uri - - Registry - - Git - type: string - registry: - description: Dockerfile's Devfile Registry - source - properties: - devfileRegistryUrl: - description: Devfile Registry URL to pull - the Dockerfile from when using the Devfile - Registry as Dockerfile src. To ensure - the Dockerfile gets resolved consistently - in different environments, it is recommended - to always specify the `devfileRegistryUrl` - when `Id` is used. - type: string - id: - description: Id in a devfile registry - that contains a Dockerfile. The src - in the OCI registry required for the - Dockerfile build will be downloaded - for building the image. - type: string - type: object rootRequired: description: "Specify if a privileged builder pod is required. \n Default value is `false`" type: boolean + srcType: + description: Type of Dockerfile src + enum: + - Uri + - DevfileRegistry + - Git + type: string uri: description: URI Reference of a Dockerfile. It can be a full URL or a relative URI from @@ -5930,7 +5936,7 @@ spec: - required: - uri - required: - - registry + - devfileRegistry - required: - git properties: @@ -5945,6 +5951,24 @@ spec: build context. Defaults to ${PROJECT_ROOT} in the container type: string + devfileRegistry: + description: Dockerfile's Devfile Registry source + properties: + id: + description: Id in a devfile registry that contains + a Dockerfile. The src in the OCI registry + required for the Dockerfile build will be + downloaded for building the image. + type: string + registryUrl: + description: Devfile Registry URL to pull the + Dockerfile from when using the Devfile Registry + as Dockerfile src. To ensure the Dockerfile + gets resolved consistently in different environments, + it is recommended to always specify the `devfileRegistryUrl` + when `Id` is used. + type: string + type: object git: description: Dockerfile's Git source properties: @@ -5965,48 +5989,32 @@ spec: revision is not found. type: string type: object - gitLocation: + fileLocation: description: Location of the Dockerfile in the Git repository when using git as Dockerfile - src. + src. Defaults to Dockerfile. type: string remotes: additionalProperties: type: string description: The remotes map which should be - initialized in the git project. Must have - at least one remote configured + initialized in the git project. Projects must + have at least one remote configured while + StarterProjects & Image Component's Git source + can only have at most one remote configured. type: object type: object - locationType: - description: Type of Dockerfile location - enum: - - Uri - - Registry - - Git - type: string - registry: - description: Dockerfile's Devfile Registry source - properties: - devfileRegistryUrl: - description: Devfile Registry URL to pull the - Dockerfile from when using the Devfile Registry - as Dockerfile src. To ensure the Dockerfile - gets resolved consistently in different environments, - it is recommended to always specify the `devfileRegistryUrl` - when `Id` is used. - type: string - id: - description: Id in a devfile registry that contains - a Dockerfile. The src in the OCI registry - required for the Dockerfile build will be - downloaded for building the image. - type: string - type: object rootRequired: description: "Specify if a privileged builder pod is required. \n Default value is `false`" type: boolean + srcType: + description: Type of Dockerfile src + enum: + - Uri + - DevfileRegistry + - Git + type: string uri: description: URI Reference of a Dockerfile. It can be a full URL or a relative URI from the current @@ -6665,7 +6673,7 @@ spec: - required: - uri - required: - - registry + - devfileRegistry - required: - git properties: @@ -6680,6 +6688,28 @@ spec: to establish build context. Defaults to ${PROJECT_ROOT} in the container type: string + devfileRegistry: + description: Dockerfile's Devfile Registry + source + properties: + id: + description: Id in a devfile registry + that contains a Dockerfile. The + src in the OCI registry required + for the Dockerfile build will be + downloaded for building the image. + type: string + registryUrl: + description: Devfile Registry URL + to pull the Dockerfile from when + using the Devfile Registry as Dockerfile + src. To ensure the Dockerfile gets + resolved consistently in different + environments, it is recommended + to always specify the `devfileRegistryUrl` + when `Id` is used. + type: string + type: object git: description: Dockerfile's Git source properties: @@ -6703,54 +6733,35 @@ spec: revision is not found. type: string type: object - gitLocation: + fileLocation: description: Location of the Dockerfile in the Git repository when using - git as Dockerfile src. + git as Dockerfile src. Defaults + to Dockerfile. type: string remotes: additionalProperties: type: string description: The remotes map which should be initialized in the git - project. Must have at least one - remote configured + project. Projects must have at least + one remote configured while StarterProjects + & Image Component's Git source can + only have at most one remote configured. type: object type: object - locationType: - description: Type of Dockerfile location - enum: - - Uri - - Registry - - Git - type: string - registry: - description: Dockerfile's Devfile Registry - source - properties: - devfileRegistryUrl: - description: Devfile Registry URL - to pull the Dockerfile from when - using the Devfile Registry as Dockerfile - src. To ensure the Dockerfile gets - resolved consistently in different - environments, it is recommended - to always specify the `devfileRegistryUrl` - when `Id` is used. - type: string - id: - description: Id in a devfile registry - that contains a Dockerfile. The - src in the OCI registry required - for the Dockerfile build will be - downloaded for building the image. - type: string - type: object rootRequired: description: "Specify if a privileged builder pod is required. \n Default value is `false`" type: boolean + srcType: + description: Type of Dockerfile src + enum: + - Uri + - DevfileRegistry + - Git + type: string uri: description: URI Reference of a Dockerfile. It can be a full URL or a relative URI @@ -7135,8 +7146,8 @@ spec: type: string description: The remotes map which should be initialized in the git project. Projects must have at least one - remote configured while StarterProjects can only have - at most one remote configured. + remote configured while StarterProjects & Image Component's + Git source can only have at most one remote configured. type: object type: object name: @@ -7212,8 +7223,8 @@ spec: type: string description: The remotes map which should be initialized in the git project. Projects must have at least one - remote configured while StarterProjects can only have - at most one remote configured. + remote configured while StarterProjects & Image Component's + Git source can only have at most one remote configured. type: object type: object name: @@ -7315,8 +7326,8 @@ spec: type: string description: The remotes map which should be initialized in the git project. Projects must have at least one remote - configured while StarterProjects can only have at most - one remote configured. + configured while StarterProjects & Image Component's Git + source can only have at most one remote configured. type: object required: - remotes @@ -7400,8 +7411,8 @@ spec: type: string description: The remotes map which should be initialized in the git project. Projects must have at least one remote - configured while StarterProjects can only have at most - one remote configured. + configured while StarterProjects & Image Component's Git + source can only have at most one remote configured. type: object required: - remotes diff --git a/crds/workspace.devfile.io_devworkspacetemplates.yaml b/crds/workspace.devfile.io_devworkspacetemplates.yaml index 00d1d38d2..329899038 100644 --- a/crds/workspace.devfile.io_devworkspacetemplates.yaml +++ b/crds/workspace.devfile.io_devworkspacetemplates.yaml @@ -4382,7 +4382,7 @@ spec: - required: - uri - required: - - registry + - devfileRegistry - required: - git properties: @@ -4396,6 +4396,26 @@ spec: description: Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container type: string + devfileRegistry: + description: Dockerfile's Devfile Registry source + properties: + id: + description: Id in a devfile registry that contains + a Dockerfile. The src in the OCI registry required + for the Dockerfile build will be downloaded for + building the image. + type: string + registryUrl: + description: Devfile Registry URL to pull the Dockerfile + from when using the Devfile Registry as Dockerfile + src. To ensure the Dockerfile gets resolved consistently + in different environments, it is recommended to + always specify the `devfileRegistryUrl` when `Id` + is used. + type: string + required: + - id + type: object git: description: Dockerfile's Git source properties: @@ -4416,51 +4436,34 @@ spec: is not found. type: string type: object - gitLocation: + fileLocation: description: Location of the Dockerfile in the Git - repository when using git as Dockerfile src. + repository when using git as Dockerfile src. Defaults + to Dockerfile. type: string remotes: additionalProperties: type: string description: The remotes map which should be initialized - in the git project. Must have at least one remote - configured + in the git project. Projects must have at least + one remote configured while StarterProjects & + Image Component's Git source can only have at + most one remote configured. type: object required: - remotes type: object - locationType: - description: Type of Dockerfile location - enum: - - Uri - - Registry - - Git - type: string - registry: - description: Dockerfile's Devfile Registry source - properties: - devfileRegistryUrl: - description: Devfile Registry URL to pull the Dockerfile - from when using the Devfile Registry as Dockerfile - src. To ensure the Dockerfile gets resolved consistently - in different environments, it is recommended to - always specify the `devfileRegistryUrl` when `Id` - is used. - type: string - id: - description: Id in a devfile registry that contains - a Dockerfile. The src in the OCI registry required - for the Dockerfile build will be downloaded for - building the image. - type: string - required: - - id - type: object rootRequired: description: "Specify if a privileged builder pod is required. \n Default value is `false`" type: boolean + srcType: + description: Type of Dockerfile src + enum: + - Uri + - DevfileRegistry + - Git + type: string uri: description: URI Reference of a Dockerfile. It can be a full URL or a relative URI from the current devfile @@ -5109,7 +5112,7 @@ spec: - required: - uri - required: - - registry + - devfileRegistry - required: - git properties: @@ -5124,6 +5127,27 @@ spec: build context. Defaults to ${PROJECT_ROOT} in the container type: string + devfileRegistry: + description: Dockerfile's Devfile Registry + source + properties: + id: + description: Id in a devfile registry + that contains a Dockerfile. The src + in the OCI registry required for the + Dockerfile build will be downloaded + for building the image. + type: string + registryUrl: + description: Devfile Registry URL to pull + the Dockerfile from when using the Devfile + Registry as Dockerfile src. To ensure + the Dockerfile gets resolved consistently + in different environments, it is recommended + to always specify the `devfileRegistryUrl` + when `Id` is used. + type: string + type: object git: description: Dockerfile's Git source properties: @@ -5145,51 +5169,33 @@ spec: is not found. type: string type: object - gitLocation: + fileLocation: description: Location of the Dockerfile in the Git repository when using git - as Dockerfile src. + as Dockerfile src. Defaults to Dockerfile. type: string remotes: additionalProperties: type: string description: The remotes map which should - be initialized in the git project. Must - have at least one remote configured + be initialized in the git project. Projects + must have at least one remote configured + while StarterProjects & Image Component's + Git source can only have at most one + remote configured. type: object type: object - locationType: - description: Type of Dockerfile location - enum: - - Uri - - Registry - - Git - type: string - registry: - description: Dockerfile's Devfile Registry - source - properties: - devfileRegistryUrl: - description: Devfile Registry URL to pull - the Dockerfile from when using the Devfile - Registry as Dockerfile src. To ensure - the Dockerfile gets resolved consistently - in different environments, it is recommended - to always specify the `devfileRegistryUrl` - when `Id` is used. - type: string - id: - description: Id in a devfile registry - that contains a Dockerfile. The src - in the OCI registry required for the - Dockerfile build will be downloaded - for building the image. - type: string - type: object rootRequired: description: "Specify if a privileged builder pod is required. \n Default value is `false`" type: boolean + srcType: + description: Type of Dockerfile src + enum: + - Uri + - DevfileRegistry + - Git + type: string uri: description: URI Reference of a Dockerfile. It can be a full URL or a relative URI from @@ -5935,7 +5941,7 @@ spec: - required: - uri - required: - - registry + - devfileRegistry - required: - git properties: @@ -5950,6 +5956,24 @@ spec: build context. Defaults to ${PROJECT_ROOT} in the container type: string + devfileRegistry: + description: Dockerfile's Devfile Registry source + properties: + id: + description: Id in a devfile registry that contains + a Dockerfile. The src in the OCI registry + required for the Dockerfile build will be + downloaded for building the image. + type: string + registryUrl: + description: Devfile Registry URL to pull the + Dockerfile from when using the Devfile Registry + as Dockerfile src. To ensure the Dockerfile + gets resolved consistently in different environments, + it is recommended to always specify the `devfileRegistryUrl` + when `Id` is used. + type: string + type: object git: description: Dockerfile's Git source properties: @@ -5970,48 +5994,32 @@ spec: revision is not found. type: string type: object - gitLocation: + fileLocation: description: Location of the Dockerfile in the Git repository when using git as Dockerfile - src. + src. Defaults to Dockerfile. type: string remotes: additionalProperties: type: string description: The remotes map which should be - initialized in the git project. Must have - at least one remote configured + initialized in the git project. Projects must + have at least one remote configured while + StarterProjects & Image Component's Git source + can only have at most one remote configured. type: object type: object - locationType: - description: Type of Dockerfile location - enum: - - Uri - - Registry - - Git - type: string - registry: - description: Dockerfile's Devfile Registry source - properties: - devfileRegistryUrl: - description: Devfile Registry URL to pull the - Dockerfile from when using the Devfile Registry - as Dockerfile src. To ensure the Dockerfile - gets resolved consistently in different environments, - it is recommended to always specify the `devfileRegistryUrl` - when `Id` is used. - type: string - id: - description: Id in a devfile registry that contains - a Dockerfile. The src in the OCI registry - required for the Dockerfile build will be - downloaded for building the image. - type: string - type: object rootRequired: description: "Specify if a privileged builder pod is required. \n Default value is `false`" type: boolean + srcType: + description: Type of Dockerfile src + enum: + - Uri + - DevfileRegistry + - Git + type: string uri: description: URI Reference of a Dockerfile. It can be a full URL or a relative URI from the current @@ -6670,7 +6678,7 @@ spec: - required: - uri - required: - - registry + - devfileRegistry - required: - git properties: @@ -6685,6 +6693,28 @@ spec: to establish build context. Defaults to ${PROJECT_ROOT} in the container type: string + devfileRegistry: + description: Dockerfile's Devfile Registry + source + properties: + id: + description: Id in a devfile registry + that contains a Dockerfile. The + src in the OCI registry required + for the Dockerfile build will be + downloaded for building the image. + type: string + registryUrl: + description: Devfile Registry URL + to pull the Dockerfile from when + using the Devfile Registry as Dockerfile + src. To ensure the Dockerfile gets + resolved consistently in different + environments, it is recommended + to always specify the `devfileRegistryUrl` + when `Id` is used. + type: string + type: object git: description: Dockerfile's Git source properties: @@ -6708,54 +6738,35 @@ spec: revision is not found. type: string type: object - gitLocation: + fileLocation: description: Location of the Dockerfile in the Git repository when using - git as Dockerfile src. + git as Dockerfile src. Defaults + to Dockerfile. type: string remotes: additionalProperties: type: string description: The remotes map which should be initialized in the git - project. Must have at least one - remote configured + project. Projects must have at least + one remote configured while StarterProjects + & Image Component's Git source can + only have at most one remote configured. type: object type: object - locationType: - description: Type of Dockerfile location - enum: - - Uri - - Registry - - Git - type: string - registry: - description: Dockerfile's Devfile Registry - source - properties: - devfileRegistryUrl: - description: Devfile Registry URL - to pull the Dockerfile from when - using the Devfile Registry as Dockerfile - src. To ensure the Dockerfile gets - resolved consistently in different - environments, it is recommended - to always specify the `devfileRegistryUrl` - when `Id` is used. - type: string - id: - description: Id in a devfile registry - that contains a Dockerfile. The - src in the OCI registry required - for the Dockerfile build will be - downloaded for building the image. - type: string - type: object rootRequired: description: "Specify if a privileged builder pod is required. \n Default value is `false`" type: boolean + srcType: + description: Type of Dockerfile src + enum: + - Uri + - DevfileRegistry + - Git + type: string uri: description: URI Reference of a Dockerfile. It can be a full URL or a relative URI @@ -7140,8 +7151,8 @@ spec: type: string description: The remotes map which should be initialized in the git project. Projects must have at least one - remote configured while StarterProjects can only have - at most one remote configured. + remote configured while StarterProjects & Image Component's + Git source can only have at most one remote configured. type: object type: object name: @@ -7217,8 +7228,8 @@ spec: type: string description: The remotes map which should be initialized in the git project. Projects must have at least one - remote configured while StarterProjects can only have - at most one remote configured. + remote configured while StarterProjects & Image Component's + Git source can only have at most one remote configured. type: object type: object name: @@ -7320,8 +7331,8 @@ spec: type: string description: The remotes map which should be initialized in the git project. Projects must have at least one remote - configured while StarterProjects can only have at most - one remote configured. + configured while StarterProjects & Image Component's Git + source can only have at most one remote configured. type: object required: - remotes @@ -7405,8 +7416,8 @@ spec: type: string description: The remotes map which should be initialized in the git project. Projects must have at least one remote - configured while StarterProjects can only have at most - one remote configured. + configured while StarterProjects & Image Component's Git + source can only have at most one remote configured. type: object required: - remotes diff --git a/pkg/apis/workspaces/v1alpha1/commands_conversion.go b/pkg/apis/workspaces/v1alpha1/commands_conversion.go index b48e3f2ce..878b448d6 100644 --- a/pkg/apis/workspaces/v1alpha1/commands_conversion.go +++ b/pkg/apis/workspaces/v1alpha1/commands_conversion.go @@ -58,47 +58,48 @@ func getGroup(dc v1alpha2.Command) *v1alpha2.CommandGroup { } func convertCommandFrom_v1alpha2(src *v1alpha2.Command, dest *Command) error { - if src != nil { - id := src.Key() + if src == nil { + return nil + } - srcCmdGroup := getGroup(*src) - if srcCmdGroup != nil && srcCmdGroup.Kind == v1alpha2.DeployCommandGroupKind { - // skip converting deploy kind commands as deploy kind commands are not supported in v1alpha1 - return nil - } + id := src.Key() - jsonCommand, err := json.Marshal(src) - if err != nil { - return err - } - err = json.Unmarshal(jsonCommand, dest) + srcCmdGroup := getGroup(*src) + if srcCmdGroup != nil && srcCmdGroup.Kind == v1alpha2.DeployCommandGroupKind { + // skip converting deploy kind commands as deploy kind commands are not supported in v1alpha1 + return nil + } + + jsonCommand, err := json.Marshal(src) + if err != nil { + return err + } + err = json.Unmarshal(jsonCommand, dest) + if err != nil { + return err + } + var destAttributes map[string]string + if src.Attributes != nil { + destAttributes = make(map[string]string) + err = convertAttributesFrom_v1alpha2(&src.Attributes, destAttributes) if err != nil { return err } - var destAttributes map[string]string - if src.Attributes != nil { - destAttributes = make(map[string]string) - err = convertAttributesFrom_v1alpha2(&src.Attributes, destAttributes) - if err != nil { - return err - } - } + } - switch { - case dest.Apply != nil: - dest.Apply.Attributes = destAttributes - dest.Apply.Id = id - case dest.Composite != nil: - dest.Composite.Attributes = destAttributes - dest.Composite.Id = id - case dest.Custom != nil: - dest.Custom.Attributes = destAttributes - dest.Custom.Id = id - case dest.Exec != nil: - dest.Exec.Attributes = destAttributes - dest.Exec.Id = id - } - return err + switch { + case dest.Apply != nil: + dest.Apply.Attributes = destAttributes + dest.Apply.Id = id + case dest.Composite != nil: + dest.Composite.Attributes = destAttributes + dest.Composite.Id = id + case dest.Custom != nil: + dest.Custom.Attributes = destAttributes + dest.Custom.Id = id + case dest.Exec != nil: + dest.Exec.Attributes = destAttributes + dest.Exec.Id = id } - return nil + return err } diff --git a/pkg/apis/workspaces/v1alpha2/component_image_dockerfile.go b/pkg/apis/workspaces/v1alpha2/component_image_dockerfile.go index 27cbcbe1d..4743825e2 100644 --- a/pkg/apis/workspaces/v1alpha2/component_image_dockerfile.go +++ b/pkg/apis/workspaces/v1alpha2/component_image_dockerfile.go @@ -1,31 +1,31 @@ package v1alpha2 -// DockerfileLocationType describes the type of -// the location for the Dockerfile outerloop build. +// DockerfileSrcType describes the type of +// the src for the Dockerfile outerloop build. // Only one of the following location type may be specified. -// +kubebuilder:validation:Enum=Uri;Registry;Git -type DockerfileLocationType string +// +kubebuilder:validation:Enum=Uri;DevfileRegistry;Git +type DockerfileSrcType string const ( - UriLikeDockerfileLocationType DockerfileLocationType = "Uri" - RegistryLikeDockerfileLocationType DockerfileLocationType = "Registry" - GitLikeDockerfileLocationType DockerfileLocationType = "Git" + UriLikeDockerfileSrcType DockerfileSrcType = "Uri" + DevfileRegistryLikeDockerfileSrcType DockerfileSrcType = "DevfileRegistry" + GitLikeDockerfileSrcType DockerfileSrcType = "Git" ) // Dockerfile Image type to specify the outerloop build using a Dockerfile type DockerfileImage struct { - BaseImage `json:",inline"` - DockerfileLocation `json:",inline"` - Dockerfile `json:",inline"` + BaseImage `json:",inline"` + DockerfileSrc `json:",inline"` + Dockerfile `json:",inline"` } // +union -type DockerfileLocation struct { - // Type of Dockerfile location +type DockerfileSrc struct { + // Type of Dockerfile src // + // +unionDiscriminator // +optional - LocationType DockerfileLocationType `json:"locationType,omitempty"` + SrcType DockerfileSrcType `json:"srcType,omitempty"` // URI Reference of a Dockerfile. // It can be a full URL or a relative URI from the current devfile as the base URI. @@ -34,7 +34,7 @@ type DockerfileLocation struct { // Dockerfile's Devfile Registry source // +optional - Registry *DockerfileDevfileRegistrySource `json:"registry,omitempty"` + DevfileRegistry *DockerfileDevfileRegistrySource `json:"devfileRegistry,omitempty"` // Dockerfile's Git source // +optional @@ -66,7 +66,7 @@ type DockerfileDevfileRegistrySource struct { // To ensure the Dockerfile gets resolved consistently in different environments, // it is recommended to always specify the `devfileRegistryUrl` when `Id` is used. // +optional - DevfileRegistryUrl string `json:"devfileRegistryUrl,omitempty"` + RegistryUrl string `json:"registryUrl,omitempty"` } type DockerfileGitProjectSource struct { @@ -75,6 +75,7 @@ type DockerfileGitProjectSource struct { GitProjectSource `json:",inline"` // Location of the Dockerfile in the Git repository when using git as Dockerfile src. + // Defaults to Dockerfile. // +optional - GitLocation string `json:"gitLocation,omitempty"` + FileLocation string `json:"fileLocation,omitempty"` } diff --git a/pkg/apis/workspaces/v1alpha2/projects.go b/pkg/apis/workspaces/v1alpha2/projects.go index eafa40ae0..9348d4d68 100644 --- a/pkg/apis/workspaces/v1alpha2/projects.go +++ b/pkg/apis/workspaces/v1alpha2/projects.go @@ -110,7 +110,7 @@ type GitLikeProjectSource struct { CheckoutFrom *CheckoutFrom `json:"checkoutFrom,omitempty"` // The remotes map which should be initialized in the git project. - // Projects must have at least one remote configured while StarterProjects can only have at most one remote configured. + // Projects must have at least one remote configured while StarterProjects & Image Component's Git source can only have at most one remote configured. Remotes map[string]string `json:"remotes"` } diff --git a/pkg/apis/workspaces/v1alpha2/zz_generated.deepcopy.go b/pkg/apis/workspaces/v1alpha2/zz_generated.deepcopy.go index 20c9ce0cf..ee9afdfbb 100644 --- a/pkg/apis/workspaces/v1alpha2/zz_generated.deepcopy.go +++ b/pkg/apis/workspaces/v1alpha2/zz_generated.deepcopy.go @@ -1828,7 +1828,7 @@ func (in *DockerfileGitProjectSourcePluginOverrideParentOverride) DeepCopy() *Do func (in *DockerfileImage) DeepCopyInto(out *DockerfileImage) { *out = *in out.BaseImage = in.BaseImage - in.DockerfileLocation.DeepCopyInto(&out.DockerfileLocation) + in.DockerfileSrc.DeepCopyInto(&out.DockerfileSrc) in.Dockerfile.DeepCopyInto(&out.Dockerfile) } @@ -1846,7 +1846,7 @@ func (in *DockerfileImage) DeepCopy() *DockerfileImage { func (in *DockerfileImageParentOverride) DeepCopyInto(out *DockerfileImageParentOverride) { *out = *in out.BaseImageParentOverride = in.BaseImageParentOverride - in.DockerfileLocationParentOverride.DeepCopyInto(&out.DockerfileLocationParentOverride) + in.DockerfileSrcParentOverride.DeepCopyInto(&out.DockerfileSrcParentOverride) in.DockerfileParentOverride.DeepCopyInto(&out.DockerfileParentOverride) } @@ -1864,7 +1864,7 @@ func (in *DockerfileImageParentOverride) DeepCopy() *DockerfileImageParentOverri func (in *DockerfileImagePluginOverride) DeepCopyInto(out *DockerfileImagePluginOverride) { *out = *in out.BaseImagePluginOverride = in.BaseImagePluginOverride - in.DockerfileLocationPluginOverride.DeepCopyInto(&out.DockerfileLocationPluginOverride) + in.DockerfileSrcPluginOverride.DeepCopyInto(&out.DockerfileSrcPluginOverride) in.DockerfilePluginOverride.DeepCopyInto(&out.DockerfilePluginOverride) } @@ -1882,7 +1882,7 @@ func (in *DockerfileImagePluginOverride) DeepCopy() *DockerfileImagePluginOverri func (in *DockerfileImagePluginOverrideParentOverride) DeepCopyInto(out *DockerfileImagePluginOverrideParentOverride) { *out = *in out.BaseImagePluginOverrideParentOverride = in.BaseImagePluginOverrideParentOverride - in.DockerfileLocationPluginOverrideParentOverride.DeepCopyInto(&out.DockerfileLocationPluginOverrideParentOverride) + in.DockerfileSrcPluginOverrideParentOverride.DeepCopyInto(&out.DockerfileSrcPluginOverrideParentOverride) in.DockerfilePluginOverrideParentOverride.DeepCopyInto(&out.DockerfilePluginOverrideParentOverride) } @@ -1897,176 +1897,176 @@ func (in *DockerfileImagePluginOverrideParentOverride) DeepCopy() *DockerfileIma } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DockerfileLocation) DeepCopyInto(out *DockerfileLocation) { +func (in *DockerfileParentOverride) DeepCopyInto(out *DockerfileParentOverride) { *out = *in - if in.Registry != nil { - in, out := &in.Registry, &out.Registry - *out = new(DockerfileDevfileRegistrySource) - **out = **in + if in.Args != nil { + in, out := &in.Args, &out.Args + *out = make([]string, len(*in)) + copy(*out, *in) } - if in.Git != nil { - in, out := &in.Git, &out.Git - *out = new(DockerfileGitProjectSource) - (*in).DeepCopyInto(*out) + if in.RootRequired != nil { + in, out := &in.RootRequired, &out.RootRequired + *out = new(bool) + **out = **in } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerfileLocation. -func (in *DockerfileLocation) DeepCopy() *DockerfileLocation { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerfileParentOverride. +func (in *DockerfileParentOverride) DeepCopy() *DockerfileParentOverride { if in == nil { return nil } - out := new(DockerfileLocation) + out := new(DockerfileParentOverride) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DockerfileLocationParentOverride) DeepCopyInto(out *DockerfileLocationParentOverride) { +func (in *DockerfilePluginOverride) DeepCopyInto(out *DockerfilePluginOverride) { *out = *in - if in.Registry != nil { - in, out := &in.Registry, &out.Registry - *out = new(DockerfileDevfileRegistrySourceParentOverride) - **out = **in + if in.Args != nil { + in, out := &in.Args, &out.Args + *out = make([]string, len(*in)) + copy(*out, *in) } - if in.Git != nil { - in, out := &in.Git, &out.Git - *out = new(DockerfileGitProjectSourceParentOverride) - (*in).DeepCopyInto(*out) + if in.RootRequired != nil { + in, out := &in.RootRequired, &out.RootRequired + *out = new(bool) + **out = **in } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerfileLocationParentOverride. -func (in *DockerfileLocationParentOverride) DeepCopy() *DockerfileLocationParentOverride { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerfilePluginOverride. +func (in *DockerfilePluginOverride) DeepCopy() *DockerfilePluginOverride { if in == nil { return nil } - out := new(DockerfileLocationParentOverride) + out := new(DockerfilePluginOverride) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DockerfileLocationPluginOverride) DeepCopyInto(out *DockerfileLocationPluginOverride) { +func (in *DockerfilePluginOverrideParentOverride) DeepCopyInto(out *DockerfilePluginOverrideParentOverride) { *out = *in - if in.Registry != nil { - in, out := &in.Registry, &out.Registry - *out = new(DockerfileDevfileRegistrySourcePluginOverride) - **out = **in + if in.Args != nil { + in, out := &in.Args, &out.Args + *out = make([]string, len(*in)) + copy(*out, *in) } - if in.Git != nil { - in, out := &in.Git, &out.Git - *out = new(DockerfileGitProjectSourcePluginOverride) - (*in).DeepCopyInto(*out) + if in.RootRequired != nil { + in, out := &in.RootRequired, &out.RootRequired + *out = new(bool) + **out = **in } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerfileLocationPluginOverride. -func (in *DockerfileLocationPluginOverride) DeepCopy() *DockerfileLocationPluginOverride { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerfilePluginOverrideParentOverride. +func (in *DockerfilePluginOverrideParentOverride) DeepCopy() *DockerfilePluginOverrideParentOverride { if in == nil { return nil } - out := new(DockerfileLocationPluginOverride) + out := new(DockerfilePluginOverrideParentOverride) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DockerfileLocationPluginOverrideParentOverride) DeepCopyInto(out *DockerfileLocationPluginOverrideParentOverride) { +func (in *DockerfileSrc) DeepCopyInto(out *DockerfileSrc) { *out = *in - if in.Registry != nil { - in, out := &in.Registry, &out.Registry - *out = new(DockerfileDevfileRegistrySourcePluginOverrideParentOverride) + if in.DevfileRegistry != nil { + in, out := &in.DevfileRegistry, &out.DevfileRegistry + *out = new(DockerfileDevfileRegistrySource) **out = **in } if in.Git != nil { in, out := &in.Git, &out.Git - *out = new(DockerfileGitProjectSourcePluginOverrideParentOverride) + *out = new(DockerfileGitProjectSource) (*in).DeepCopyInto(*out) } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerfileLocationPluginOverrideParentOverride. -func (in *DockerfileLocationPluginOverrideParentOverride) DeepCopy() *DockerfileLocationPluginOverrideParentOverride { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerfileSrc. +func (in *DockerfileSrc) DeepCopy() *DockerfileSrc { if in == nil { return nil } - out := new(DockerfileLocationPluginOverrideParentOverride) + out := new(DockerfileSrc) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DockerfileParentOverride) DeepCopyInto(out *DockerfileParentOverride) { +func (in *DockerfileSrcParentOverride) DeepCopyInto(out *DockerfileSrcParentOverride) { *out = *in - if in.Args != nil { - in, out := &in.Args, &out.Args - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.RootRequired != nil { - in, out := &in.RootRequired, &out.RootRequired - *out = new(bool) + if in.DevfileRegistry != nil { + in, out := &in.DevfileRegistry, &out.DevfileRegistry + *out = new(DockerfileDevfileRegistrySourceParentOverride) **out = **in } + if in.Git != nil { + in, out := &in.Git, &out.Git + *out = new(DockerfileGitProjectSourceParentOverride) + (*in).DeepCopyInto(*out) + } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerfileParentOverride. -func (in *DockerfileParentOverride) DeepCopy() *DockerfileParentOverride { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerfileSrcParentOverride. +func (in *DockerfileSrcParentOverride) DeepCopy() *DockerfileSrcParentOverride { if in == nil { return nil } - out := new(DockerfileParentOverride) + out := new(DockerfileSrcParentOverride) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DockerfilePluginOverride) DeepCopyInto(out *DockerfilePluginOverride) { +func (in *DockerfileSrcPluginOverride) DeepCopyInto(out *DockerfileSrcPluginOverride) { *out = *in - if in.Args != nil { - in, out := &in.Args, &out.Args - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.RootRequired != nil { - in, out := &in.RootRequired, &out.RootRequired - *out = new(bool) + if in.DevfileRegistry != nil { + in, out := &in.DevfileRegistry, &out.DevfileRegistry + *out = new(DockerfileDevfileRegistrySourcePluginOverride) **out = **in } + if in.Git != nil { + in, out := &in.Git, &out.Git + *out = new(DockerfileGitProjectSourcePluginOverride) + (*in).DeepCopyInto(*out) + } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerfilePluginOverride. -func (in *DockerfilePluginOverride) DeepCopy() *DockerfilePluginOverride { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerfileSrcPluginOverride. +func (in *DockerfileSrcPluginOverride) DeepCopy() *DockerfileSrcPluginOverride { if in == nil { return nil } - out := new(DockerfilePluginOverride) + out := new(DockerfileSrcPluginOverride) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DockerfilePluginOverrideParentOverride) DeepCopyInto(out *DockerfilePluginOverrideParentOverride) { +func (in *DockerfileSrcPluginOverrideParentOverride) DeepCopyInto(out *DockerfileSrcPluginOverrideParentOverride) { *out = *in - if in.Args != nil { - in, out := &in.Args, &out.Args - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.RootRequired != nil { - in, out := &in.RootRequired, &out.RootRequired - *out = new(bool) + if in.DevfileRegistry != nil { + in, out := &in.DevfileRegistry, &out.DevfileRegistry + *out = new(DockerfileDevfileRegistrySourcePluginOverrideParentOverride) **out = **in } + if in.Git != nil { + in, out := &in.Git, &out.Git + *out = new(DockerfileGitProjectSourcePluginOverrideParentOverride) + (*in).DeepCopyInto(*out) + } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerfilePluginOverrideParentOverride. -func (in *DockerfilePluginOverrideParentOverride) DeepCopy() *DockerfilePluginOverrideParentOverride { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerfileSrcPluginOverrideParentOverride. +func (in *DockerfileSrcPluginOverrideParentOverride) DeepCopy() *DockerfileSrcPluginOverrideParentOverride { if in == nil { return nil } - out := new(DockerfilePluginOverrideParentOverride) + out := new(DockerfileSrcPluginOverrideParentOverride) in.DeepCopyInto(out) return out } diff --git a/pkg/apis/workspaces/v1alpha2/zz_generated.parent_overrides.go b/pkg/apis/workspaces/v1alpha2/zz_generated.parent_overrides.go index b18d7bf09..4886db49e 100644 --- a/pkg/apis/workspaces/v1alpha2/zz_generated.parent_overrides.go +++ b/pkg/apis/workspaces/v1alpha2/zz_generated.parent_overrides.go @@ -567,7 +567,7 @@ type GitLikeProjectSourceParentOverride struct { // +optional // The remotes map which should be initialized in the git project. - // Projects must have at least one remote configured while StarterProjects can only have at most one remote configured. + // Projects must have at least one remote configured while StarterProjects & Image Component's Git source can only have at most one remote configured. Remotes map[string]string `json:"remotes,omitempty"` } @@ -745,9 +745,9 @@ type ImageTypeParentOverride string // Dockerfile Image type to specify the outerloop build using a Dockerfile type DockerfileImageParentOverride struct { - BaseImageParentOverride `json:",inline"` - DockerfileLocationParentOverride `json:",inline"` - DockerfileParentOverride `json:",inline"` + BaseImageParentOverride `json:",inline"` + DockerfileSrcParentOverride `json:",inline"` + DockerfileParentOverride `json:",inline"` } // ImportReferenceType describes the type of location @@ -849,14 +849,14 @@ type BaseImageParentOverride struct { } // +union -type DockerfileLocationParentOverride struct { +type DockerfileSrcParentOverride struct { - // +kubebuilder:validation:Enum=Uri;Registry;Git - // Type of Dockerfile location + // +kubebuilder:validation:Enum=Uri;DevfileRegistry;Git + // Type of Dockerfile src // + // +unionDiscriminator // +optional - LocationType DockerfileLocationTypeParentOverride `json:"locationType,omitempty"` + SrcType DockerfileSrcTypeParentOverride `json:"srcType,omitempty"` // URI Reference of a Dockerfile. // It can be a full URL or a relative URI from the current devfile as the base URI. @@ -865,7 +865,7 @@ type DockerfileLocationParentOverride struct { // Dockerfile's Devfile Registry source // +optional - Registry *DockerfileDevfileRegistrySourceParentOverride `json:"registry,omitempty"` + DevfileRegistry *DockerfileDevfileRegistrySourceParentOverride `json:"devfileRegistry,omitempty"` // Dockerfile's Git source // +optional @@ -993,10 +993,10 @@ type CompositeCommandPluginOverrideParentOverride struct { // +kubebuilder:validation:Enum=build;run;test;debug;deploy type CommandGroupKindParentOverride string -// DockerfileLocationType describes the type of -// the location for the Dockerfile outerloop build. +// DockerfileSrcType describes the type of +// the src for the Dockerfile outerloop build. // Only one of the following location type may be specified. -type DockerfileLocationTypeParentOverride string +type DockerfileSrcTypeParentOverride string type DockerfileDevfileRegistrySourceParentOverride struct { @@ -1009,7 +1009,7 @@ type DockerfileDevfileRegistrySourceParentOverride struct { // To ensure the Dockerfile gets resolved consistently in different environments, // it is recommended to always specify the `devfileRegistryUrl` when `Id` is used. // +optional - DevfileRegistryUrl string `json:"devfileRegistryUrl,omitempty"` + RegistryUrl string `json:"registryUrl,omitempty"` } type DockerfileGitProjectSourceParentOverride struct { @@ -1019,8 +1019,9 @@ type DockerfileGitProjectSourceParentOverride struct { GitProjectSourceParentOverride `json:",inline"` // Location of the Dockerfile in the Git repository when using git as Dockerfile src. + // Defaults to Dockerfile. // +optional - GitLocation string `json:"gitLocation,omitempty"` + FileLocation string `json:"fileLocation,omitempty"` } // DevWorkspace component: Anything that will bring additional features / tooling / behaviour / context @@ -1283,9 +1284,9 @@ type ImageTypePluginOverrideParentOverride string // Dockerfile Image type to specify the outerloop build using a Dockerfile type DockerfileImagePluginOverrideParentOverride struct { - BaseImagePluginOverrideParentOverride `json:",inline"` - DockerfileLocationPluginOverrideParentOverride `json:",inline"` - DockerfilePluginOverrideParentOverride `json:",inline"` + BaseImagePluginOverrideParentOverride `json:",inline"` + DockerfileSrcPluginOverrideParentOverride `json:",inline"` + DockerfilePluginOverrideParentOverride `json:",inline"` } type CommandGroupPluginOverrideParentOverride struct { @@ -1303,14 +1304,14 @@ type BaseImagePluginOverrideParentOverride struct { } // +union -type DockerfileLocationPluginOverrideParentOverride struct { +type DockerfileSrcPluginOverrideParentOverride struct { - // +kubebuilder:validation:Enum=Uri;Registry;Git - // Type of Dockerfile location + // +kubebuilder:validation:Enum=Uri;DevfileRegistry;Git + // Type of Dockerfile src // + // +unionDiscriminator // +optional - LocationType DockerfileLocationTypePluginOverrideParentOverride `json:"locationType,omitempty"` + SrcType DockerfileSrcTypePluginOverrideParentOverride `json:"srcType,omitempty"` // URI Reference of a Dockerfile. // It can be a full URL or a relative URI from the current devfile as the base URI. @@ -1319,7 +1320,7 @@ type DockerfileLocationPluginOverrideParentOverride struct { // Dockerfile's Devfile Registry source // +optional - Registry *DockerfileDevfileRegistrySourcePluginOverrideParentOverride `json:"registry,omitempty"` + DevfileRegistry *DockerfileDevfileRegistrySourcePluginOverrideParentOverride `json:"devfileRegistry,omitempty"` // Dockerfile's Git source // +optional @@ -1347,10 +1348,10 @@ type DockerfilePluginOverrideParentOverride struct { // +kubebuilder:validation:Enum=build;run;test;debug;deploy type CommandGroupKindPluginOverrideParentOverride string -// DockerfileLocationType describes the type of -// the location for the Dockerfile outerloop build. +// DockerfileSrcType describes the type of +// the src for the Dockerfile outerloop build. // Only one of the following location type may be specified. -type DockerfileLocationTypePluginOverrideParentOverride string +type DockerfileSrcTypePluginOverrideParentOverride string type DockerfileDevfileRegistrySourcePluginOverrideParentOverride struct { @@ -1363,7 +1364,7 @@ type DockerfileDevfileRegistrySourcePluginOverrideParentOverride struct { // To ensure the Dockerfile gets resolved consistently in different environments, // it is recommended to always specify the `devfileRegistryUrl` when `Id` is used. // +optional - DevfileRegistryUrl string `json:"devfileRegistryUrl,omitempty"` + RegistryUrl string `json:"registryUrl,omitempty"` } type DockerfileGitProjectSourcePluginOverrideParentOverride struct { @@ -1373,8 +1374,9 @@ type DockerfileGitProjectSourcePluginOverrideParentOverride struct { GitProjectSourcePluginOverrideParentOverride `json:",inline"` // Location of the Dockerfile in the Git repository when using git as Dockerfile src. + // Defaults to Dockerfile. // +optional - GitLocation string `json:"gitLocation,omitempty"` + FileLocation string `json:"fileLocation,omitempty"` } type GitProjectSourcePluginOverrideParentOverride struct { @@ -1389,7 +1391,8 @@ type GitLikeProjectSourcePluginOverrideParentOverride struct { CheckoutFrom *CheckoutFromPluginOverrideParentOverride `json:"checkoutFrom,omitempty"` // +optional - // The remotes map which should be initialized in the git project. Must have at least one remote configured + // The remotes map which should be initialized in the git project. + // Projects must have at least one remote configured while StarterProjects & Image Component's Git source can only have at most one remote configured. Remotes map[string]string `json:"remotes,omitempty"` } diff --git a/pkg/apis/workspaces/v1alpha2/zz_generated.plugin_overrides.go b/pkg/apis/workspaces/v1alpha2/zz_generated.plugin_overrides.go index 5df551bb4..93ccf8102 100644 --- a/pkg/apis/workspaces/v1alpha2/zz_generated.plugin_overrides.go +++ b/pkg/apis/workspaces/v1alpha2/zz_generated.plugin_overrides.go @@ -491,9 +491,9 @@ type ImageTypePluginOverride string // Dockerfile Image type to specify the outerloop build using a Dockerfile type DockerfileImagePluginOverride struct { - BaseImagePluginOverride `json:",inline"` - DockerfileLocationPluginOverride `json:",inline"` - DockerfilePluginOverride `json:",inline"` + BaseImagePluginOverride `json:",inline"` + DockerfileSrcPluginOverride `json:",inline"` + DockerfilePluginOverride `json:",inline"` } type CommandGroupPluginOverride struct { @@ -511,14 +511,14 @@ type BaseImagePluginOverride struct { } // +union -type DockerfileLocationPluginOverride struct { +type DockerfileSrcPluginOverride struct { - // +kubebuilder:validation:Enum=Uri;Registry;Git - // Type of Dockerfile location + // +kubebuilder:validation:Enum=Uri;DevfileRegistry;Git + // Type of Dockerfile src // + // +unionDiscriminator // +optional - LocationType DockerfileLocationTypePluginOverride `json:"locationType,omitempty"` + SrcType DockerfileSrcTypePluginOverride `json:"srcType,omitempty"` // URI Reference of a Dockerfile. // It can be a full URL or a relative URI from the current devfile as the base URI. @@ -527,7 +527,7 @@ type DockerfileLocationPluginOverride struct { // Dockerfile's Devfile Registry source // +optional - Registry *DockerfileDevfileRegistrySourcePluginOverride `json:"registry,omitempty"` + DevfileRegistry *DockerfileDevfileRegistrySourcePluginOverride `json:"devfileRegistry,omitempty"` // Dockerfile's Git source // +optional @@ -555,10 +555,10 @@ type DockerfilePluginOverride struct { // +kubebuilder:validation:Enum=build;run;test;debug;deploy type CommandGroupKindPluginOverride string -// DockerfileLocationType describes the type of -// the location for the Dockerfile outerloop build. +// DockerfileSrcType describes the type of +// the src for the Dockerfile outerloop build. // Only one of the following location type may be specified. -type DockerfileLocationTypePluginOverride string +type DockerfileSrcTypePluginOverride string type DockerfileDevfileRegistrySourcePluginOverride struct { @@ -571,7 +571,7 @@ type DockerfileDevfileRegistrySourcePluginOverride struct { // To ensure the Dockerfile gets resolved consistently in different environments, // it is recommended to always specify the `devfileRegistryUrl` when `Id` is used. // +optional - DevfileRegistryUrl string `json:"devfileRegistryUrl,omitempty"` + RegistryUrl string `json:"registryUrl,omitempty"` } type DockerfileGitProjectSourcePluginOverride struct { @@ -581,8 +581,9 @@ type DockerfileGitProjectSourcePluginOverride struct { GitProjectSourcePluginOverride `json:",inline"` // Location of the Dockerfile in the Git repository when using git as Dockerfile src. + // Defaults to Dockerfile. // +optional - GitLocation string `json:"gitLocation,omitempty"` + FileLocation string `json:"fileLocation,omitempty"` } type GitProjectSourcePluginOverride struct { @@ -597,7 +598,8 @@ type GitLikeProjectSourcePluginOverride struct { CheckoutFrom *CheckoutFromPluginOverride `json:"checkoutFrom,omitempty"` // +optional - // The remotes map which should be initialized in the git project. Must have at least one remote configured + // The remotes map which should be initialized in the git project. + // Projects must have at least one remote configured while StarterProjects & Image Component's Git source can only have at most one remote configured. Remotes map[string]string `json:"remotes,omitempty"` } diff --git a/pkg/apis/workspaces/v1alpha2/zz_generated.union_definitions.go b/pkg/apis/workspaces/v1alpha2/zz_generated.union_definitions.go index 58e616440..3efd841ae 100644 --- a/pkg/apis/workspaces/v1alpha2/zz_generated.union_definitions.go +++ b/pkg/apis/workspaces/v1alpha2/zz_generated.union_definitions.go @@ -47,26 +47,26 @@ type ImageUnionVisitor struct { Dockerfile func(*DockerfileImage) error } -var dockerfileLocation reflect.Type = reflect.TypeOf(DockerfileLocationVisitor{}) +var dockerfileSrc reflect.Type = reflect.TypeOf(DockerfileSrcVisitor{}) -func (union DockerfileLocation) Visit(visitor DockerfileLocationVisitor) error { +func (union DockerfileSrc) Visit(visitor DockerfileSrcVisitor) error { return visitUnion(union, visitor) } -func (union *DockerfileLocation) discriminator() *string { - return (*string)(&union.LocationType) +func (union *DockerfileSrc) discriminator() *string { + return (*string)(&union.SrcType) } -func (union *DockerfileLocation) Normalize() error { - return normalizeUnion(union, dockerfileLocation) +func (union *DockerfileSrc) Normalize() error { + return normalizeUnion(union, dockerfileSrc) } -func (union *DockerfileLocation) Simplify() { - simplifyUnion(union, dockerfileLocation) +func (union *DockerfileSrc) Simplify() { + simplifyUnion(union, dockerfileSrc) } // +k8s:deepcopy-gen=false -type DockerfileLocationVisitor struct { - Uri func(string) error - Registry func(*DockerfileDevfileRegistrySource) error - Git func(*DockerfileGitProjectSource) error +type DockerfileSrcVisitor struct { + Uri func(string) error + DevfileRegistry func(*DockerfileDevfileRegistrySource) error + Git func(*DockerfileGitProjectSource) error } var k8sLikeComponentLocation reflect.Type = reflect.TypeOf(K8sLikeComponentLocationVisitor{}) @@ -337,26 +337,26 @@ type CommandUnionPluginOverrideParentOverrideVisitor struct { Composite func(*CompositeCommandPluginOverrideParentOverride) error } -var dockerfileLocationParentOverride reflect.Type = reflect.TypeOf(DockerfileLocationParentOverrideVisitor{}) +var dockerfileSrcParentOverride reflect.Type = reflect.TypeOf(DockerfileSrcParentOverrideVisitor{}) -func (union DockerfileLocationParentOverride) Visit(visitor DockerfileLocationParentOverrideVisitor) error { +func (union DockerfileSrcParentOverride) Visit(visitor DockerfileSrcParentOverrideVisitor) error { return visitUnion(union, visitor) } -func (union *DockerfileLocationParentOverride) discriminator() *string { - return (*string)(&union.LocationType) +func (union *DockerfileSrcParentOverride) discriminator() *string { + return (*string)(&union.SrcType) } -func (union *DockerfileLocationParentOverride) Normalize() error { - return normalizeUnion(union, dockerfileLocationParentOverride) +func (union *DockerfileSrcParentOverride) Normalize() error { + return normalizeUnion(union, dockerfileSrcParentOverride) } -func (union *DockerfileLocationParentOverride) Simplify() { - simplifyUnion(union, dockerfileLocationParentOverride) +func (union *DockerfileSrcParentOverride) Simplify() { + simplifyUnion(union, dockerfileSrcParentOverride) } // +k8s:deepcopy-gen=false -type DockerfileLocationParentOverrideVisitor struct { - Uri func(string) error - Registry func(*DockerfileDevfileRegistrySourceParentOverride) error - Git func(*DockerfileGitProjectSourceParentOverride) error +type DockerfileSrcParentOverrideVisitor struct { + Uri func(string) error + DevfileRegistry func(*DockerfileDevfileRegistrySourceParentOverride) error + Git func(*DockerfileGitProjectSourceParentOverride) error } var k8sLikeComponentLocationPluginOverrideParentOverride reflect.Type = reflect.TypeOf(K8sLikeComponentLocationPluginOverrideParentOverrideVisitor{}) @@ -400,26 +400,26 @@ type ImageUnionPluginOverrideParentOverrideVisitor struct { Dockerfile func(*DockerfileImagePluginOverrideParentOverride) error } -var dockerfileLocationPluginOverrideParentOverride reflect.Type = reflect.TypeOf(DockerfileLocationPluginOverrideParentOverrideVisitor{}) +var dockerfileSrcPluginOverrideParentOverride reflect.Type = reflect.TypeOf(DockerfileSrcPluginOverrideParentOverrideVisitor{}) -func (union DockerfileLocationPluginOverrideParentOverride) Visit(visitor DockerfileLocationPluginOverrideParentOverrideVisitor) error { +func (union DockerfileSrcPluginOverrideParentOverride) Visit(visitor DockerfileSrcPluginOverrideParentOverrideVisitor) error { return visitUnion(union, visitor) } -func (union *DockerfileLocationPluginOverrideParentOverride) discriminator() *string { - return (*string)(&union.LocationType) +func (union *DockerfileSrcPluginOverrideParentOverride) discriminator() *string { + return (*string)(&union.SrcType) } -func (union *DockerfileLocationPluginOverrideParentOverride) Normalize() error { - return normalizeUnion(union, dockerfileLocationPluginOverrideParentOverride) +func (union *DockerfileSrcPluginOverrideParentOverride) Normalize() error { + return normalizeUnion(union, dockerfileSrcPluginOverrideParentOverride) } -func (union *DockerfileLocationPluginOverrideParentOverride) Simplify() { - simplifyUnion(union, dockerfileLocationPluginOverrideParentOverride) +func (union *DockerfileSrcPluginOverrideParentOverride) Simplify() { + simplifyUnion(union, dockerfileSrcPluginOverrideParentOverride) } // +k8s:deepcopy-gen=false -type DockerfileLocationPluginOverrideParentOverrideVisitor struct { - Uri func(string) error - Registry func(*DockerfileDevfileRegistrySourcePluginOverrideParentOverride) error - Git func(*DockerfileGitProjectSourcePluginOverrideParentOverride) error +type DockerfileSrcPluginOverrideParentOverrideVisitor struct { + Uri func(string) error + DevfileRegistry func(*DockerfileDevfileRegistrySourcePluginOverrideParentOverride) error + Git func(*DockerfileGitProjectSourcePluginOverrideParentOverride) error } var componentUnionPluginOverride reflect.Type = reflect.TypeOf(ComponentUnionPluginOverrideVisitor{}) @@ -509,24 +509,24 @@ type ImageUnionPluginOverrideVisitor struct { Dockerfile func(*DockerfileImagePluginOverride) error } -var dockerfileLocationPluginOverride reflect.Type = reflect.TypeOf(DockerfileLocationPluginOverrideVisitor{}) +var dockerfileSrcPluginOverride reflect.Type = reflect.TypeOf(DockerfileSrcPluginOverrideVisitor{}) -func (union DockerfileLocationPluginOverride) Visit(visitor DockerfileLocationPluginOverrideVisitor) error { +func (union DockerfileSrcPluginOverride) Visit(visitor DockerfileSrcPluginOverrideVisitor) error { return visitUnion(union, visitor) } -func (union *DockerfileLocationPluginOverride) discriminator() *string { - return (*string)(&union.LocationType) +func (union *DockerfileSrcPluginOverride) discriminator() *string { + return (*string)(&union.SrcType) } -func (union *DockerfileLocationPluginOverride) Normalize() error { - return normalizeUnion(union, dockerfileLocationPluginOverride) +func (union *DockerfileSrcPluginOverride) Normalize() error { + return normalizeUnion(union, dockerfileSrcPluginOverride) } -func (union *DockerfileLocationPluginOverride) Simplify() { - simplifyUnion(union, dockerfileLocationPluginOverride) +func (union *DockerfileSrcPluginOverride) Simplify() { + simplifyUnion(union, dockerfileSrcPluginOverride) } // +k8s:deepcopy-gen=false -type DockerfileLocationPluginOverrideVisitor struct { - Uri func(string) error - Registry func(*DockerfileDevfileRegistrySourcePluginOverride) error - Git func(*DockerfileGitProjectSourcePluginOverride) error +type DockerfileSrcPluginOverrideVisitor struct { + Uri func(string) error + DevfileRegistry func(*DockerfileDevfileRegistrySourcePluginOverride) error + Git func(*DockerfileGitProjectSourcePluginOverride) error } diff --git a/pkg/utils/overriding/test-fixtures/patches/image-component-union/patch.yaml b/pkg/utils/overriding/test-fixtures/patches/image-component-union/patch.yaml index a3d032b66..08e21c15a 100644 --- a/pkg/utils/overriding/test-fixtures/patches/image-component-union/patch.yaml +++ b/pkg/utils/overriding/test-fixtures/patches/image-component-union/patch.yaml @@ -4,13 +4,12 @@ components: imageName: "newimage:xyz" dockerfile: git: - gitLocation: "uri/Dockerfile" + fileLocation: "uri/Dockerfile" checkoutFrom: revision: "FOO" - remote: "BAR" + remote: "foo" remotes: "foo": "BAR" - "FOOBAR": "BARFOO" buildContext: /BAR/FOO args: - "sleep" diff --git a/pkg/utils/overriding/test-fixtures/patches/image-component-union/result.yaml b/pkg/utils/overriding/test-fixtures/patches/image-component-union/result.yaml index 3be96e8e5..d911d7f30 100644 --- a/pkg/utils/overriding/test-fixtures/patches/image-component-union/result.yaml +++ b/pkg/utils/overriding/test-fixtures/patches/image-component-union/result.yaml @@ -10,13 +10,12 @@ components: imageName: "newimage:xyz" dockerfile: git: - gitLocation: "uri/Dockerfile" + fileLocation: "uri/Dockerfile" checkoutFrom: revision: "FOO" - remote: "BAR" + remote: "foo" remotes: "foo": "BAR" - "FOOBAR": "BARFOO" buildContext: /BAR/FOO args: - "sleep" diff --git a/pkg/validation/components.go b/pkg/validation/components.go index 8f0103b8e..10b3c89ad 100644 --- a/pkg/validation/components.go +++ b/pkg/validation/components.go @@ -22,6 +22,7 @@ const ( // 2. makes sure the volume components are unique // 3. checks the URI specified in openshift components and kubernetes components are with valid format // 4. makes sure the component name is unique +// 5. makes sure the image dockerfile component git src has at most one remote func ValidateComponents(components []v1alpha2.Component) (returnedErr error) { processedVolumes := make(map[string]bool) @@ -100,6 +101,14 @@ func ValidateComponents(components []v1alpha2.Component) (returnedErr error) { returnedErr = multierror.Append(returnedErr, resolveErrorMessageWithImportAttributes(endpointErr, component.Attributes)) } } + case component.Image != nil: + var gitSource v1alpha2.GitLikeProjectSource + if component.Image.Dockerfile != nil && component.Image.Dockerfile.Git != nil { + gitSource = component.Image.Dockerfile.Git.GitLikeProjectSource + if err := validateSingleRemoteGitSrc("component", component.Name, gitSource); err != nil { + returnedErr = multierror.Append(returnedErr, resolveErrorMessageWithImportAttributes(err, component.Attributes)) + } + } case component.Plugin != nil: if component.Plugin.RegistryUrl != "" { err := ValidateURI(component.Plugin.RegistryUrl) diff --git a/pkg/validation/components_test.go b/pkg/validation/components_test.go index 7d6bcb49c..d97349ae1 100644 --- a/pkg/validation/components_test.go +++ b/pkg/validation/components_test.go @@ -1,9 +1,10 @@ package validation import ( - "github.com/devfile/api/v2/pkg/attributes" "testing" + "github.com/devfile/api/v2/pkg/attributes" + "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" "github.com/hashicorp/go-multierror" "github.com/stretchr/testify/assert" @@ -80,6 +81,29 @@ func generateDummyKubernetesComponent(name string, endpoints []v1alpha2.Endpoint } } +// generateDummyImageComponent returns a dummy Image Dockerfile Component for testing +func generateDummyImageComponent(name string, src v1alpha2.DockerfileSrc) v1alpha2.Component { + + return v1alpha2.Component{ + Name: name, + ComponentUnion: v1alpha2.ComponentUnion{ + Image: &v1alpha2.ImageComponent{ + Image: v1alpha2.Image{ + ImageName: "image:latest", + ImageUnion: v1alpha2.ImageUnion{ + Dockerfile: &v1alpha2.DockerfileImage{ + DockerfileSrc: src, + Dockerfile: v1alpha2.Dockerfile{ + BuildContext: "/path", + }, + }, + }, + }, + }, + }, + } +} + // generateDummyPluginComponent returns a dummy Plugin component for testing func generateDummyPluginComponent(name, url string, compAttribute attributes.Attributes) v1alpha2.Component { @@ -128,6 +152,68 @@ func TestValidateComponents(t *testing.T) { }, } + twoRemotesGitSrc := v1alpha2.DockerfileSrc{ + Git: &v1alpha2.DockerfileGitProjectSource{ + GitProjectSource: v1alpha2.GitProjectSource{ + GitLikeProjectSource: v1alpha2.GitLikeProjectSource{ + Remotes: map[string]string{ + "a": "abc", + "x": "xyz", + }, + CheckoutFrom: &v1alpha2.CheckoutFrom{ + Remote: "a", + }, + }, + }, + }, + } + + zeroRemoteGitSrc := v1alpha2.DockerfileSrc{ + Git: &v1alpha2.DockerfileGitProjectSource{ + GitProjectSource: v1alpha2.GitProjectSource{ + GitLikeProjectSource: v1alpha2.GitLikeProjectSource{ + CheckoutFrom: &v1alpha2.CheckoutFrom{ + Remote: "a", + }, + }, + }, + }, + } + + invalidRemoteGitSrc := v1alpha2.DockerfileSrc{ + Git: &v1alpha2.DockerfileGitProjectSource{ + GitProjectSource: v1alpha2.GitProjectSource{ + GitLikeProjectSource: v1alpha2.GitLikeProjectSource{ + Remotes: map[string]string{ + "a": "abc", + }, + CheckoutFrom: &v1alpha2.CheckoutFrom{ + Remote: "b", + }, + }, + }, + }, + } + + validRemoteGitSrc := v1alpha2.DockerfileSrc{ + Git: &v1alpha2.DockerfileGitProjectSource{ + GitProjectSource: v1alpha2.GitProjectSource{ + GitLikeProjectSource: v1alpha2.GitLikeProjectSource{ + Remotes: map[string]string{ + "a": "abc", + }, + CheckoutFrom: &v1alpha2.CheckoutFrom{ + Remote: "a", + }, + }, + }, + }, + } + + validUriSrc := v1alpha2.DockerfileSrc{ + Uri: "uri", + } + endpointUrl18080 := generateDummyEndpoint("url1", 8080) endpointUrl18081 := generateDummyEndpoint("url1", 8081) endpointUrl28080 := generateDummyEndpoint("url2", 8080) @@ -139,6 +225,9 @@ func TestValidateComponents(t *testing.T) { sameEndpointNameErr := "devfile contains multiple endpoint entries with same name.*" sameTargetPortErr := "devfile contains multiple containers with same TargetPort.*" invalidURIErr := ".*invalid URI for request" + imageCompTwoRemoteErr := "component .* should have one remote only" + imageCompNoRemoteErr := "component .* should have at least one remote" + imageCompInvalidRemoteErr := "unable to find the checkout remote .* in the remotes for component .*" pluginOverridesFromMainDevfile := attributes.Attributes{}.PutString(ImportSourceAttribute, "uri: http://127.0.0.1:8080").PutString(PluginOverrideAttribute, "main devfile") @@ -246,6 +335,39 @@ func TestValidateComponents(t *testing.T) { }, wantErr: []string{duplicateComponentErr, invalidURIErr, invalidURIErrWithImportAttributes}, }, + { + name: "Invalid image dockerfile component with more than one remote", + components: []v1alpha2.Component{ + generateDummyImageComponent("name1", twoRemotesGitSrc), + }, + wantErr: []string{imageCompTwoRemoteErr}, + }, + { + name: "Invalid image dockerfile component with zero remote", + components: []v1alpha2.Component{ + generateDummyImageComponent("name1", zeroRemoteGitSrc), + }, + wantErr: []string{imageCompNoRemoteErr}, + }, + { + name: "Invalid image dockerfile component with wrong checkout", + components: []v1alpha2.Component{ + generateDummyImageComponent("name1", invalidRemoteGitSrc), + }, + wantErr: []string{imageCompInvalidRemoteErr}, + }, + { + name: "Valid image dockerfile component with correct remote", + components: []v1alpha2.Component{ + generateDummyImageComponent("name1", validRemoteGitSrc), + }, + }, + { + name: "Valid image dockerfile component with non git src", + components: []v1alpha2.Component{ + generateDummyImageComponent("name1", validUriSrc), + }, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/pkg/validation/errors.go b/pkg/validation/errors.go index 7e71578dc..6fc520188 100644 --- a/pkg/validation/errors.go +++ b/pkg/validation/errors.go @@ -2,6 +2,7 @@ package validation import ( "fmt" + "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" attributesAPI "github.com/devfile/api/v2/pkg/attributes" ) @@ -122,20 +123,22 @@ func (e *MissingProjectRemoteError) Error() string { //MissingStarterProjectRemoteError returns an error if the git remotes object under a starterProject is empty type MissingStarterProjectRemoteError struct { + objectName string projectName string } func (e *MissingStarterProjectRemoteError) Error() string { - return fmt.Sprintf("starterProject %s should have at least one remote", e.projectName) + return fmt.Sprintf("%s %s should have at least one remote", e.objectName, e.projectName) } //MultipleStarterProjectRemoteError returns an error if multiple git remotes are specified. There can only be one remote. type MultipleStarterProjectRemoteError struct { + objectName string projectName string } func (e *MultipleStarterProjectRemoteError) Error() string { - return fmt.Sprintf("starterProject %s should have one remote only", e.projectName) + return fmt.Sprintf("%s %s should have one remote only", e.objectName, e.projectName) } //MissingProjectCheckoutFromRemoteError returns an error if there are multiple git remotes but the checkoutFrom remote has not been specified @@ -149,12 +152,13 @@ func (e *MissingProjectCheckoutFromRemoteError) Error() string { //InvalidProjectCheckoutRemoteError returns an error if there is an unmatched, checkoutFrom remote specified type InvalidProjectCheckoutRemoteError struct { + objectName string projectName string checkoutRemote string } func (e *InvalidProjectCheckoutRemoteError) Error() string { - return fmt.Sprintf("unable to find the checkout remote %s in the remotes for project %s", e.checkoutRemote, e.projectName) + return fmt.Sprintf("unable to find the checkout remote %s in the remotes for %s %s", e.checkoutRemote, e.objectName, e.projectName) } // resolveErrorMessageWithImportAttributes returns an updated error message diff --git a/pkg/validation/projects.go b/pkg/validation/projects.go index 8fdd39bc3..55df4ec7a 100644 --- a/pkg/validation/projects.go +++ b/pkg/validation/projects.go @@ -17,22 +17,8 @@ func ValidateStarterProjects(starterProjects []v1alpha2.StarterProject) (returne continue } - switch len(gitSource.Remotes) { - case 0: - - newErr := resolveErrorMessageWithImportAttributes(&MissingStarterProjectRemoteError{projectName: starterProject.Name}, starterProject.Attributes) - returnedErr = multierror.Append(returnedErr, newErr) - case 1: - if gitSource.CheckoutFrom != nil && gitSource.CheckoutFrom.Remote != "" { - err := validateRemoteMap(gitSource.Remotes, gitSource.CheckoutFrom.Remote, starterProject.Name) - if err != nil { - newErr := resolveErrorMessageWithImportAttributes(err, starterProject.Attributes) - returnedErr = multierror.Append(returnedErr, newErr) - } - } - default: // len(gitSource.Remotes) >= 2 - - newErr := resolveErrorMessageWithImportAttributes(&MultipleStarterProjectRemoteError{projectName: starterProject.Name}, starterProject.Attributes) + if starterProjectErr := validateSingleRemoteGitSrc("starterProject", starterProject.Name, gitSource); starterProjectErr != nil { + newErr := resolveErrorMessageWithImportAttributes(starterProjectErr, starterProject.Attributes) returnedErr = multierror.Append(returnedErr, newErr) } } @@ -58,7 +44,7 @@ func ValidateProjects(projects []v1alpha2.Project) (returnedErr error) { returnedErr = multierror.Append(returnedErr, newErr) case 1: if gitSource.CheckoutFrom != nil && gitSource.CheckoutFrom.Remote != "" { - if err := validateRemoteMap(gitSource.Remotes, gitSource.CheckoutFrom.Remote, project.Name); err != nil { + if err := validateRemoteMap(gitSource.Remotes, gitSource.CheckoutFrom.Remote, "project", project.Name); err != nil { newErr := resolveErrorMessageWithImportAttributes(err, project.Attributes) returnedErr = multierror.Append(returnedErr, newErr) } @@ -70,7 +56,7 @@ func ValidateProjects(projects []v1alpha2.Project) (returnedErr error) { returnedErr = multierror.Append(returnedErr, newErr) continue } - if err := validateRemoteMap(gitSource.Remotes, gitSource.CheckoutFrom.Remote, project.Name); err != nil { + if err := validateRemoteMap(gitSource.Remotes, gitSource.CheckoutFrom.Remote, "project", project.Name); err != nil { newErr := resolveErrorMessageWithImportAttributes(err, project.Attributes) returnedErr = multierror.Append(returnedErr, newErr) } @@ -81,12 +67,28 @@ func ValidateProjects(projects []v1alpha2.Project) (returnedErr error) { } // validateRemoteMap checks if the checkout remote is present in the project remote map -func validateRemoteMap(remotes map[string]string, checkoutRemote, projectName string) error { +func validateRemoteMap(remotes map[string]string, checkoutRemote, object, name string) error { if _, ok := remotes[checkoutRemote]; !ok { - return &InvalidProjectCheckoutRemoteError{projectName: projectName, checkoutRemote: checkoutRemote} + return &InvalidProjectCheckoutRemoteError{projectName: name, objectName: object, checkoutRemote: checkoutRemote} } return nil } + +// validateSingleRemoteGitSrc validates a git src for a single remote only +func validateSingleRemoteGitSrc(object, name string, gitSource v1alpha2.GitLikeProjectSource) (err error) { + switch len(gitSource.Remotes) { + case 0: + err = &MissingStarterProjectRemoteError{objectName: object, projectName: name} + case 1: + if gitSource.CheckoutFrom != nil && gitSource.CheckoutFrom.Remote != "" { + err = validateRemoteMap(gitSource.Remotes, gitSource.CheckoutFrom.Remote, object, name) + } + default: // len(gitSource.Remotes) >= 2 + err = &MultipleStarterProjectRemoteError{objectName: object, projectName: name} + } + + return err +} diff --git a/pkg/validation/projects_test.go b/pkg/validation/projects_test.go index fff4d8e36..4ceb970d4 100644 --- a/pkg/validation/projects_test.go +++ b/pkg/validation/projects_test.go @@ -43,12 +43,12 @@ func generateDummyGitProject(name string, checkoutRemote *v1alpha2.CheckoutFrom, func TestValidateStarterProjects(t *testing.T) { oneRemoteErr := "starterProject .* should have one remote only" - wrongCheckoutErr := "unable to find the checkout remote .* in the remotes for project.*" + wrongCheckoutErr := "unable to find the checkout remote .* in the remotes for starterProject.*" atleastOneRemoteErr := "starterProject .* should have at least one remote" parentOverridesFromMainDevfile := attributes.Attributes{}.PutString(ImportSourceAttribute, "uri: http://127.0.0.1:8080").PutString(ParentOverrideAttribute, "main devfile") - wrongCheckoutErrWithImportAttributes := "unable to find the checkout remote .* in the remotes for project.*, imported from uri: http://127.0.0.1:8080, in parent overrides from main devfile" + wrongCheckoutErrWithImportAttributes := "unable to find the checkout remote .* in the remotes for starterProject.*, imported from uri: http://127.0.0.1:8080, in parent overrides from main devfile" tests := []struct { name string diff --git a/pkg/validation/validation-rule.md b/pkg/validation/validation-rule.md index fd88efa69..ac9c0f991 100644 --- a/pkg/validation/validation-rule.md +++ b/pkg/validation/validation-rule.md @@ -41,6 +41,9 @@ Common rules for all components types: #### Kubernetes & Openshift component - URI needs to be in valid URI format +#### Image component +- A Dockerfile Image component's git source cannot have more than one remote defined. If checkout remote is mentioned, validate it against the remote configured map + ### Events: 1. preStart and postStop events can only be Apply commands @@ -60,7 +63,3 @@ Common rules for all components types: ### projects - if more than one remote is configured, a checkout remote is mandatory - if checkout remote is mentioned, validate it against the starter project remote configured map - -### Architectures - -Architectures list support the following values - `amd64`, `arm64`, `ppc64le`, `s390x`. These values are determined by the .manifests[].platform["architecture"] field from an image's manifests and manually selected. diff --git a/pkg/validation/variables/test-fixtures/components/image-dockerfile-git-output.yaml b/pkg/validation/variables/test-fixtures/components/image-dockerfile-git-output.yaml index 63f1c10be..da723ec5b 100644 --- a/pkg/validation/variables/test-fixtures/components/image-dockerfile-git-output.yaml +++ b/pkg/validation/variables/test-fixtures/components/image-dockerfile-git-output.yaml @@ -1,12 +1,11 @@ imageName: "myimage:xyz" dockerfile: git: - gitLocation: "uri/Dockerfile" + fileLocation: "uri/Dockerfile" checkoutFrom: revision: "FOO" remote: "BAR" remotes: - "foo": "BAR" - "FOOBAR": "BARFOO" + "BAR": "foo" buildContext: /FOO/BAR rootRequired: true diff --git a/pkg/validation/variables/test-fixtures/components/image-dockerfile-git.yaml b/pkg/validation/variables/test-fixtures/components/image-dockerfile-git.yaml index cc367dd25..f27712dee 100644 --- a/pkg/validation/variables/test-fixtures/components/image-dockerfile-git.yaml +++ b/pkg/validation/variables/test-fixtures/components/image-dockerfile-git.yaml @@ -1,12 +1,11 @@ imageName: "myimage:{{ tag }}" dockerfile: git: - gitLocation: "{{ uri }}/Dockerfile" + fileLocation: "{{ uri }}/Dockerfile" checkoutFrom: revision: "{{foo}}" remote: "{{bar}}" remotes: - "foo": "{{bar}}" - "{{foo}}{{bar}}": "{{ bar }}{{ foo }}" + "{{bar}}": "foo" buildContext: /{{foo}}/{{bar}} rootRequired: true diff --git a/pkg/validation/variables/test-fixtures/components/image-dockerfile-registry-output.yaml b/pkg/validation/variables/test-fixtures/components/image-dockerfile-registry-output.yaml index 1b901d5f4..826557933 100644 --- a/pkg/validation/variables/test-fixtures/components/image-dockerfile-registry-output.yaml +++ b/pkg/validation/variables/test-fixtures/components/image-dockerfile-registry-output.yaml @@ -1,7 +1,7 @@ imageName: "myimage:xyz" dockerfile: - registry: + devfileRegistry: id: "FOO/BAR" - devfileRegistryUrl: "http://uri" + registryUrl: "http://uri" buildContext: /FOO/BAR rootRequired: true diff --git a/pkg/validation/variables/test-fixtures/components/image-dockerfile-registry.yaml b/pkg/validation/variables/test-fixtures/components/image-dockerfile-registry.yaml index f959b5fbf..4c695245f 100644 --- a/pkg/validation/variables/test-fixtures/components/image-dockerfile-registry.yaml +++ b/pkg/validation/variables/test-fixtures/components/image-dockerfile-registry.yaml @@ -1,7 +1,7 @@ imageName: "myimage:{{ tag }}" dockerfile: - registry: + devfileRegistry: id: "{{foo}}/{{bar}}" - devfileRegistryUrl: "http://{{ uri }}" + registryUrl: "http://{{ uri }}" buildContext: /{{foo}}/{{bar}} rootRequired: true diff --git a/pkg/validation/variables/variables_component.go b/pkg/validation/variables/variables_component.go index de0e15e52..0bd237ad5 100644 --- a/pkg/validation/variables/variables_component.go +++ b/pkg/validation/variables/variables_component.go @@ -235,7 +235,7 @@ func validateAndReplaceForDockerfileImageComponent(variables map[string]string, } case dockerfileImage.Git != nil: // Validate dockerfile Git location - if dockerfileImage.Git.GitLocation, err = validateAndReplaceDataWithVariable(dockerfileImage.Git.GitLocation, variables); err != nil { + if dockerfileImage.Git.FileLocation, err = validateAndReplaceDataWithVariable(dockerfileImage.Git.FileLocation, variables); err != nil { checkForInvalidError(invalidKeys, err) } @@ -243,12 +243,12 @@ func validateAndReplaceForDockerfileImageComponent(variables map[string]string, if err = validateAndReplaceForGitProjectSource(variables, gitProject); err != nil { checkForInvalidError(invalidKeys, err) } - case dockerfileImage.Registry != nil: + case dockerfileImage.DevfileRegistry != nil: // Validate dockerfile devfile registry src - if dockerfileImage.Registry.Id, err = validateAndReplaceDataWithVariable(dockerfileImage.Registry.Id, variables); err != nil { + if dockerfileImage.DevfileRegistry.Id, err = validateAndReplaceDataWithVariable(dockerfileImage.DevfileRegistry.Id, variables); err != nil { checkForInvalidError(invalidKeys, err) } - if dockerfileImage.Registry.DevfileRegistryUrl, err = validateAndReplaceDataWithVariable(dockerfileImage.Registry.DevfileRegistryUrl, variables); err != nil { + if dockerfileImage.DevfileRegistry.RegistryUrl, err = validateAndReplaceDataWithVariable(dockerfileImage.DevfileRegistry.RegistryUrl, variables); err != nil { checkForInvalidError(invalidKeys, err) } } diff --git a/samples/devfiles/outerloop-dockerfile-build-inlined-deploy-devfile.yaml b/samples/devfiles/outerloop-dockerfile-build-inlined-deploy-devfile.yaml index 4bad4039d..0d3fda102 100644 --- a/samples/devfiles/outerloop-dockerfile-build-inlined-deploy-devfile.yaml +++ b/samples/devfiles/outerloop-dockerfile-build-inlined-deploy-devfile.yaml @@ -90,9 +90,16 @@ commands: group: kind: test isDefault: true + - id: build-image + apply: + component: outerloop-build - id: deployk8s apply: component: outerloop-deploy + - id: deploy + composite: + commands: + - build-image + - deployk8s group: kind: deploy - isDefault: true diff --git a/samples/devfiles/outerloop-dockerfile-build-uri-deploy-devfile.yaml b/samples/devfiles/outerloop-dockerfile-build-uri-deploy-devfile.yaml index 8926d58a3..31602f75c 100644 --- a/samples/devfiles/outerloop-dockerfile-build-uri-deploy-devfile.yaml +++ b/samples/devfiles/outerloop-dockerfile-build-uri-deploy-devfile.yaml @@ -61,9 +61,16 @@ commands: group: kind: test isDefault: true + - id: build-image + apply: + component: outerloop-build - id: deployk8s apply: component: outerloop-deploy + - id: deploy + composite: + commands: + - build-image + - deployk8s group: kind: deploy - isDefault: true diff --git a/schemas/latest/dev-workspace-template-spec.json b/schemas/latest/dev-workspace-template-spec.json index 903118f0d..0c5d7ef5f 100644 --- a/schemas/latest/dev-workspace-template-spec.json +++ b/schemas/latest/dev-workspace-template-spec.json @@ -518,7 +518,7 @@ }, { "required": [ - "registry" + "devfileRegistry" ] }, { @@ -539,6 +539,24 @@ "description": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container", "type": "string" }, + "devfileRegistry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", + "type": "string" + }, + "registryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string" + } + }, + "additionalProperties": false + }, "git": { "description": "Dockerfile's Git source", "type": "object", @@ -561,12 +579,12 @@ }, "additionalProperties": false }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "fileLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src. Defaults to Dockerfile.", "type": "string" }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" @@ -575,24 +593,6 @@ }, "additionalProperties": false }, - "registry": { - "description": "Dockerfile's Devfile Registry source", - "type": "object", - "required": [ - "id" - ], - "properties": { - "devfileRegistryUrl": { - "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", - "type": "string" - }, - "id": { - "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", - "type": "string" - } - }, - "additionalProperties": false - }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", "type": "boolean" @@ -1204,7 +1204,7 @@ }, { "required": [ - "registry" + "devfileRegistry" ] }, { @@ -1225,6 +1225,21 @@ "description": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container", "type": "string" }, + "devfileRegistry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "properties": { + "id": { + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", + "type": "string" + }, + "registryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string" + } + }, + "additionalProperties": false + }, "git": { "description": "Dockerfile's Git source", "type": "object", @@ -1244,12 +1259,12 @@ }, "additionalProperties": false }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "fileLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src. Defaults to Dockerfile.", "type": "string" }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" @@ -1258,21 +1273,6 @@ }, "additionalProperties": false }, - "registry": { - "description": "Dockerfile's Devfile Registry source", - "type": "object", - "properties": { - "devfileRegistryUrl": { - "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", - "type": "string" - }, - "id": { - "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", - "type": "string" - } - }, - "additionalProperties": false - }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", "type": "boolean" @@ -1992,7 +1992,7 @@ }, { "required": [ - "registry" + "devfileRegistry" ] }, { @@ -2013,6 +2013,21 @@ "description": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container", "type": "string" }, + "devfileRegistry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "properties": { + "id": { + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", + "type": "string" + }, + "registryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string" + } + }, + "additionalProperties": false + }, "git": { "description": "Dockerfile's Git source", "type": "object", @@ -2032,12 +2047,12 @@ }, "additionalProperties": false }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "fileLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src. Defaults to Dockerfile.", "type": "string" }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" @@ -2046,21 +2061,6 @@ }, "additionalProperties": false }, - "registry": { - "description": "Dockerfile's Devfile Registry source", - "type": "object", - "properties": { - "devfileRegistryUrl": { - "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", - "type": "string" - }, - "id": { - "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", - "type": "string" - } - }, - "additionalProperties": false - }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", "type": "boolean" @@ -2666,7 +2666,7 @@ }, { "required": [ - "registry" + "devfileRegistry" ] }, { @@ -2687,6 +2687,21 @@ "description": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container", "type": "string" }, + "devfileRegistry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "properties": { + "id": { + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", + "type": "string" + }, + "registryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string" + } + }, + "additionalProperties": false + }, "git": { "description": "Dockerfile's Git source", "type": "object", @@ -2706,12 +2721,12 @@ }, "additionalProperties": false }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "fileLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src. Defaults to Dockerfile.", "type": "string" }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" @@ -2720,21 +2735,6 @@ }, "additionalProperties": false }, - "registry": { - "description": "Dockerfile's Devfile Registry source", - "type": "object", - "properties": { - "devfileRegistryUrl": { - "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", - "type": "string" - }, - "id": { - "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", - "type": "string" - } - }, - "additionalProperties": false - }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", "type": "boolean" @@ -3057,7 +3057,7 @@ "additionalProperties": false }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects can only have at most one remote configured.", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" @@ -3141,7 +3141,7 @@ "additionalProperties": false }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects can only have at most one remote configured.", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" @@ -3265,7 +3265,7 @@ "additionalProperties": false }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects can only have at most one remote configured.", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" @@ -3371,7 +3371,7 @@ "additionalProperties": false }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects can only have at most one remote configured.", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" diff --git a/schemas/latest/dev-workspace-template.json b/schemas/latest/dev-workspace-template.json index 7a7f90215..dab315317 100644 --- a/schemas/latest/dev-workspace-template.json +++ b/schemas/latest/dev-workspace-template.json @@ -684,7 +684,7 @@ }, { "required": [ - "registry" + "devfileRegistry" ] }, { @@ -705,6 +705,24 @@ "description": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container", "type": "string" }, + "devfileRegistry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", + "type": "string" + }, + "registryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string" + } + }, + "additionalProperties": false + }, "git": { "description": "Dockerfile's Git source", "type": "object", @@ -727,12 +745,12 @@ }, "additionalProperties": false }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "fileLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src. Defaults to Dockerfile.", "type": "string" }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" @@ -741,24 +759,6 @@ }, "additionalProperties": false }, - "registry": { - "description": "Dockerfile's Devfile Registry source", - "type": "object", - "required": [ - "id" - ], - "properties": { - "devfileRegistryUrl": { - "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", - "type": "string" - }, - "id": { - "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", - "type": "string" - } - }, - "additionalProperties": false - }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", "type": "boolean" @@ -1370,7 +1370,7 @@ }, { "required": [ - "registry" + "devfileRegistry" ] }, { @@ -1391,6 +1391,21 @@ "description": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container", "type": "string" }, + "devfileRegistry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "properties": { + "id": { + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", + "type": "string" + }, + "registryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string" + } + }, + "additionalProperties": false + }, "git": { "description": "Dockerfile's Git source", "type": "object", @@ -1410,12 +1425,12 @@ }, "additionalProperties": false }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "fileLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src. Defaults to Dockerfile.", "type": "string" }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" @@ -1424,21 +1439,6 @@ }, "additionalProperties": false }, - "registry": { - "description": "Dockerfile's Devfile Registry source", - "type": "object", - "properties": { - "devfileRegistryUrl": { - "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", - "type": "string" - }, - "id": { - "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", - "type": "string" - } - }, - "additionalProperties": false - }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", "type": "boolean" @@ -2158,7 +2158,7 @@ }, { "required": [ - "registry" + "devfileRegistry" ] }, { @@ -2179,6 +2179,21 @@ "description": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container", "type": "string" }, + "devfileRegistry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "properties": { + "id": { + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", + "type": "string" + }, + "registryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string" + } + }, + "additionalProperties": false + }, "git": { "description": "Dockerfile's Git source", "type": "object", @@ -2198,12 +2213,12 @@ }, "additionalProperties": false }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "fileLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src. Defaults to Dockerfile.", "type": "string" }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" @@ -2212,21 +2227,6 @@ }, "additionalProperties": false }, - "registry": { - "description": "Dockerfile's Devfile Registry source", - "type": "object", - "properties": { - "devfileRegistryUrl": { - "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", - "type": "string" - }, - "id": { - "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", - "type": "string" - } - }, - "additionalProperties": false - }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", "type": "boolean" @@ -2832,7 +2832,7 @@ }, { "required": [ - "registry" + "devfileRegistry" ] }, { @@ -2853,6 +2853,21 @@ "description": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container", "type": "string" }, + "devfileRegistry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "properties": { + "id": { + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", + "type": "string" + }, + "registryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string" + } + }, + "additionalProperties": false + }, "git": { "description": "Dockerfile's Git source", "type": "object", @@ -2872,12 +2887,12 @@ }, "additionalProperties": false }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "fileLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src. Defaults to Dockerfile.", "type": "string" }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" @@ -2886,21 +2901,6 @@ }, "additionalProperties": false }, - "registry": { - "description": "Dockerfile's Devfile Registry source", - "type": "object", - "properties": { - "devfileRegistryUrl": { - "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", - "type": "string" - }, - "id": { - "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", - "type": "string" - } - }, - "additionalProperties": false - }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", "type": "boolean" @@ -3223,7 +3223,7 @@ "additionalProperties": false }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects can only have at most one remote configured.", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" @@ -3307,7 +3307,7 @@ "additionalProperties": false }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects can only have at most one remote configured.", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" @@ -3431,7 +3431,7 @@ "additionalProperties": false }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects can only have at most one remote configured.", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" @@ -3537,7 +3537,7 @@ "additionalProperties": false }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects can only have at most one remote configured.", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" diff --git a/schemas/latest/dev-workspace.json b/schemas/latest/dev-workspace.json index 46535aff8..c9a8b1b60 100644 --- a/schemas/latest/dev-workspace.json +++ b/schemas/latest/dev-workspace.json @@ -697,7 +697,7 @@ }, { "required": [ - "registry" + "devfileRegistry" ] }, { @@ -718,6 +718,24 @@ "description": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container", "type": "string" }, + "devfileRegistry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", + "type": "string" + }, + "registryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string" + } + }, + "additionalProperties": false + }, "git": { "description": "Dockerfile's Git source", "type": "object", @@ -740,12 +758,12 @@ }, "additionalProperties": false }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "fileLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src. Defaults to Dockerfile.", "type": "string" }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" @@ -754,24 +772,6 @@ }, "additionalProperties": false }, - "registry": { - "description": "Dockerfile's Devfile Registry source", - "type": "object", - "required": [ - "id" - ], - "properties": { - "devfileRegistryUrl": { - "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", - "type": "string" - }, - "id": { - "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", - "type": "string" - } - }, - "additionalProperties": false - }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", "type": "boolean" @@ -1383,7 +1383,7 @@ }, { "required": [ - "registry" + "devfileRegistry" ] }, { @@ -1404,6 +1404,21 @@ "description": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container", "type": "string" }, + "devfileRegistry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "properties": { + "id": { + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", + "type": "string" + }, + "registryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string" + } + }, + "additionalProperties": false + }, "git": { "description": "Dockerfile's Git source", "type": "object", @@ -1423,12 +1438,12 @@ }, "additionalProperties": false }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "fileLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src. Defaults to Dockerfile.", "type": "string" }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" @@ -1437,21 +1452,6 @@ }, "additionalProperties": false }, - "registry": { - "description": "Dockerfile's Devfile Registry source", - "type": "object", - "properties": { - "devfileRegistryUrl": { - "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", - "type": "string" - }, - "id": { - "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", - "type": "string" - } - }, - "additionalProperties": false - }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", "type": "boolean" @@ -2171,7 +2171,7 @@ }, { "required": [ - "registry" + "devfileRegistry" ] }, { @@ -2192,6 +2192,21 @@ "description": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container", "type": "string" }, + "devfileRegistry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "properties": { + "id": { + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", + "type": "string" + }, + "registryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string" + } + }, + "additionalProperties": false + }, "git": { "description": "Dockerfile's Git source", "type": "object", @@ -2211,12 +2226,12 @@ }, "additionalProperties": false }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "fileLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src. Defaults to Dockerfile.", "type": "string" }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" @@ -2225,21 +2240,6 @@ }, "additionalProperties": false }, - "registry": { - "description": "Dockerfile's Devfile Registry source", - "type": "object", - "properties": { - "devfileRegistryUrl": { - "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", - "type": "string" - }, - "id": { - "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", - "type": "string" - } - }, - "additionalProperties": false - }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", "type": "boolean" @@ -2845,7 +2845,7 @@ }, { "required": [ - "registry" + "devfileRegistry" ] }, { @@ -2866,6 +2866,21 @@ "description": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container", "type": "string" }, + "devfileRegistry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "properties": { + "id": { + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", + "type": "string" + }, + "registryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string" + } + }, + "additionalProperties": false + }, "git": { "description": "Dockerfile's Git source", "type": "object", @@ -2885,12 +2900,12 @@ }, "additionalProperties": false }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "fileLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src. Defaults to Dockerfile.", "type": "string" }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" @@ -2899,21 +2914,6 @@ }, "additionalProperties": false }, - "registry": { - "description": "Dockerfile's Devfile Registry source", - "type": "object", - "properties": { - "devfileRegistryUrl": { - "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", - "type": "string" - }, - "id": { - "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", - "type": "string" - } - }, - "additionalProperties": false - }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", "type": "boolean" @@ -3236,7 +3236,7 @@ "additionalProperties": false }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects can only have at most one remote configured.", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" @@ -3320,7 +3320,7 @@ "additionalProperties": false }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects can only have at most one remote configured.", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" @@ -3444,7 +3444,7 @@ "additionalProperties": false }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects can only have at most one remote configured.", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" @@ -3550,7 +3550,7 @@ "additionalProperties": false }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects can only have at most one remote configured.", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" diff --git a/schemas/latest/devfile.json b/schemas/latest/devfile.json index 0cc9632e9..585a16fab 100644 --- a/schemas/latest/devfile.json +++ b/schemas/latest/devfile.json @@ -437,7 +437,7 @@ }, { "required": [ - "registry" + "devfileRegistry" ] }, { @@ -458,6 +458,24 @@ "description": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container", "type": "string" }, + "devfileRegistry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", + "type": "string" + }, + "registryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string" + } + }, + "additionalProperties": false + }, "git": { "description": "Dockerfile's Git source", "type": "object", @@ -480,12 +498,12 @@ }, "additionalProperties": false }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "fileLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src. Defaults to Dockerfile.", "type": "string" }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" @@ -494,24 +512,6 @@ }, "additionalProperties": false }, - "registry": { - "description": "Dockerfile's Devfile Registry source", - "type": "object", - "required": [ - "id" - ], - "properties": { - "devfileRegistryUrl": { - "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", - "type": "string" - }, - "id": { - "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", - "type": "string" - } - }, - "additionalProperties": false - }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", "type": "boolean" @@ -1261,7 +1261,7 @@ }, { "required": [ - "registry" + "devfileRegistry" ] }, { @@ -1282,6 +1282,21 @@ "description": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container", "type": "string" }, + "devfileRegistry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "properties": { + "id": { + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", + "type": "string" + }, + "registryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string" + } + }, + "additionalProperties": false + }, "git": { "description": "Dockerfile's Git source", "type": "object", @@ -1301,12 +1316,12 @@ }, "additionalProperties": false }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "fileLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src. Defaults to Dockerfile.", "type": "string" }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" @@ -1315,21 +1330,6 @@ }, "additionalProperties": false }, - "registry": { - "description": "Dockerfile's Devfile Registry source", - "type": "object", - "properties": { - "devfileRegistryUrl": { - "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", - "type": "string" - }, - "id": { - "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", - "type": "string" - } - }, - "additionalProperties": false - }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", "type": "boolean" @@ -1605,7 +1605,7 @@ "additionalProperties": false }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects can only have at most one remote configured.", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" @@ -1689,7 +1689,7 @@ "additionalProperties": false }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects can only have at most one remote configured.", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" @@ -1790,7 +1790,7 @@ "additionalProperties": false }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects can only have at most one remote configured.", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" @@ -1878,7 +1878,7 @@ "additionalProperties": false }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects can only have at most one remote configured.", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" diff --git a/schemas/latest/ide-targeted/dev-workspace-template-spec.json b/schemas/latest/ide-targeted/dev-workspace-template-spec.json index 6c7720577..7efab824e 100644 --- a/schemas/latest/ide-targeted/dev-workspace-template-spec.json +++ b/schemas/latest/ide-targeted/dev-workspace-template-spec.json @@ -569,7 +569,7 @@ }, { "required": [ - "registry" + "devfileRegistry" ] }, { @@ -592,6 +592,27 @@ "type": "string", "markdownDescription": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container" }, + "devfileRegistry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", + "type": "string", + "markdownDescription": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image." + }, + "registryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string", + "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." + } + }, + "additionalProperties": false, + "markdownDescription": "Dockerfile's Devfile Registry source" + }, "git": { "description": "Dockerfile's Git source", "type": "object", @@ -617,44 +638,23 @@ "additionalProperties": false, "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "fileLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src. Defaults to Dockerfile.", "type": "string", - "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." + "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src. Defaults to Dockerfile." }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" }, - "markdownDescription": "The remotes map which should be initialized in the git project. Must have at least one remote configured" + "markdownDescription": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured." } }, "additionalProperties": false, "markdownDescription": "Dockerfile's Git source" }, - "registry": { - "description": "Dockerfile's Devfile Registry source", - "type": "object", - "required": [ - "id" - ], - "properties": { - "devfileRegistryUrl": { - "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", - "type": "string", - "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." - }, - "id": { - "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", - "type": "string", - "markdownDescription": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image." - } - }, - "additionalProperties": false, - "markdownDescription": "Dockerfile's Devfile Registry source" - }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", "type": "boolean", @@ -1327,7 +1327,7 @@ }, { "required": [ - "registry" + "devfileRegistry" ] }, { @@ -1350,6 +1350,24 @@ "type": "string", "markdownDescription": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container" }, + "devfileRegistry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "properties": { + "id": { + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", + "type": "string", + "markdownDescription": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image." + }, + "registryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string", + "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." + } + }, + "additionalProperties": false, + "markdownDescription": "Dockerfile's Devfile Registry source" + }, "git": { "description": "Dockerfile's Git source", "type": "object", @@ -1372,41 +1390,23 @@ "additionalProperties": false, "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "fileLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src. Defaults to Dockerfile.", "type": "string", - "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." + "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src. Defaults to Dockerfile." }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" }, - "markdownDescription": "The remotes map which should be initialized in the git project. Must have at least one remote configured" + "markdownDescription": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured." } }, "additionalProperties": false, "markdownDescription": "Dockerfile's Git source" }, - "registry": { - "description": "Dockerfile's Devfile Registry source", - "type": "object", - "properties": { - "devfileRegistryUrl": { - "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", - "type": "string", - "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." - }, - "id": { - "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", - "type": "string", - "markdownDescription": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image." - } - }, - "additionalProperties": false, - "markdownDescription": "Dockerfile's Devfile Registry source" - }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", "type": "boolean", @@ -2210,7 +2210,7 @@ }, { "required": [ - "registry" + "devfileRegistry" ] }, { @@ -2233,6 +2233,24 @@ "type": "string", "markdownDescription": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container" }, + "devfileRegistry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "properties": { + "id": { + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", + "type": "string", + "markdownDescription": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image." + }, + "registryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string", + "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." + } + }, + "additionalProperties": false, + "markdownDescription": "Dockerfile's Devfile Registry source" + }, "git": { "description": "Dockerfile's Git source", "type": "object", @@ -2255,41 +2273,23 @@ "additionalProperties": false, "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "fileLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src. Defaults to Dockerfile.", "type": "string", - "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." + "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src. Defaults to Dockerfile." }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" }, - "markdownDescription": "The remotes map which should be initialized in the git project. Must have at least one remote configured" + "markdownDescription": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured." } }, "additionalProperties": false, "markdownDescription": "Dockerfile's Git source" }, - "registry": { - "description": "Dockerfile's Devfile Registry source", - "type": "object", - "properties": { - "devfileRegistryUrl": { - "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", - "type": "string", - "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." - }, - "id": { - "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", - "type": "string", - "markdownDescription": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image." - } - }, - "additionalProperties": false, - "markdownDescription": "Dockerfile's Devfile Registry source" - }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", "type": "boolean", @@ -2960,7 +2960,7 @@ }, { "required": [ - "registry" + "devfileRegistry" ] }, { @@ -2983,6 +2983,24 @@ "type": "string", "markdownDescription": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container" }, + "devfileRegistry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "properties": { + "id": { + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", + "type": "string", + "markdownDescription": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image." + }, + "registryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string", + "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." + } + }, + "additionalProperties": false, + "markdownDescription": "Dockerfile's Devfile Registry source" + }, "git": { "description": "Dockerfile's Git source", "type": "object", @@ -3005,41 +3023,23 @@ "additionalProperties": false, "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "fileLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src. Defaults to Dockerfile.", "type": "string", - "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." + "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src. Defaults to Dockerfile." }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" }, - "markdownDescription": "The remotes map which should be initialized in the git project. Must have at least one remote configured" + "markdownDescription": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured." } }, "additionalProperties": false, "markdownDescription": "Dockerfile's Git source" }, - "registry": { - "description": "Dockerfile's Devfile Registry source", - "type": "object", - "properties": { - "devfileRegistryUrl": { - "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", - "type": "string", - "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." - }, - "id": { - "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", - "type": "string", - "markdownDescription": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image." - } - }, - "additionalProperties": false, - "markdownDescription": "Dockerfile's Devfile Registry source" - }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", "type": "boolean", @@ -3404,12 +3404,12 @@ "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects can only have at most one remote configured.", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" }, - "markdownDescription": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects can only have at most one remote configured." + "markdownDescription": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured." } }, "additionalProperties": false, @@ -3500,12 +3500,12 @@ "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects can only have at most one remote configured.", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" }, - "markdownDescription": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects can only have at most one remote configured." + "markdownDescription": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured." } }, "additionalProperties": false, @@ -3640,12 +3640,12 @@ "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects can only have at most one remote configured.", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" }, - "markdownDescription": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects can only have at most one remote configured." + "markdownDescription": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured." } }, "additionalProperties": false, @@ -3758,12 +3758,12 @@ "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects can only have at most one remote configured.", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" }, - "markdownDescription": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects can only have at most one remote configured." + "markdownDescription": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured." } }, "additionalProperties": false, diff --git a/schemas/latest/ide-targeted/dev-workspace-template.json b/schemas/latest/ide-targeted/dev-workspace-template.json index b6f5c21cb..bc320a5bf 100644 --- a/schemas/latest/ide-targeted/dev-workspace-template.json +++ b/schemas/latest/ide-targeted/dev-workspace-template.json @@ -768,7 +768,7 @@ }, { "required": [ - "registry" + "devfileRegistry" ] }, { @@ -791,6 +791,27 @@ "type": "string", "markdownDescription": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container" }, + "devfileRegistry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", + "type": "string", + "markdownDescription": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image." + }, + "registryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string", + "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." + } + }, + "additionalProperties": false, + "markdownDescription": "Dockerfile's Devfile Registry source" + }, "git": { "description": "Dockerfile's Git source", "type": "object", @@ -816,44 +837,23 @@ "additionalProperties": false, "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "fileLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src. Defaults to Dockerfile.", "type": "string", - "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." + "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src. Defaults to Dockerfile." }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" }, - "markdownDescription": "The remotes map which should be initialized in the git project. Must have at least one remote configured" + "markdownDescription": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured." } }, "additionalProperties": false, "markdownDescription": "Dockerfile's Git source" }, - "registry": { - "description": "Dockerfile's Devfile Registry source", - "type": "object", - "required": [ - "id" - ], - "properties": { - "devfileRegistryUrl": { - "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", - "type": "string", - "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." - }, - "id": { - "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", - "type": "string", - "markdownDescription": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image." - } - }, - "additionalProperties": false, - "markdownDescription": "Dockerfile's Devfile Registry source" - }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", "type": "boolean", @@ -1526,7 +1526,7 @@ }, { "required": [ - "registry" + "devfileRegistry" ] }, { @@ -1549,6 +1549,24 @@ "type": "string", "markdownDescription": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container" }, + "devfileRegistry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "properties": { + "id": { + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", + "type": "string", + "markdownDescription": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image." + }, + "registryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string", + "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." + } + }, + "additionalProperties": false, + "markdownDescription": "Dockerfile's Devfile Registry source" + }, "git": { "description": "Dockerfile's Git source", "type": "object", @@ -1571,41 +1589,23 @@ "additionalProperties": false, "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "fileLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src. Defaults to Dockerfile.", "type": "string", - "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." + "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src. Defaults to Dockerfile." }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" }, - "markdownDescription": "The remotes map which should be initialized in the git project. Must have at least one remote configured" + "markdownDescription": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured." } }, "additionalProperties": false, "markdownDescription": "Dockerfile's Git source" }, - "registry": { - "description": "Dockerfile's Devfile Registry source", - "type": "object", - "properties": { - "devfileRegistryUrl": { - "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", - "type": "string", - "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." - }, - "id": { - "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", - "type": "string", - "markdownDescription": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image." - } - }, - "additionalProperties": false, - "markdownDescription": "Dockerfile's Devfile Registry source" - }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", "type": "boolean", @@ -2409,7 +2409,7 @@ }, { "required": [ - "registry" + "devfileRegistry" ] }, { @@ -2432,6 +2432,24 @@ "type": "string", "markdownDescription": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container" }, + "devfileRegistry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "properties": { + "id": { + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", + "type": "string", + "markdownDescription": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image." + }, + "registryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string", + "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." + } + }, + "additionalProperties": false, + "markdownDescription": "Dockerfile's Devfile Registry source" + }, "git": { "description": "Dockerfile's Git source", "type": "object", @@ -2454,41 +2472,23 @@ "additionalProperties": false, "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "fileLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src. Defaults to Dockerfile.", "type": "string", - "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." + "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src. Defaults to Dockerfile." }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" }, - "markdownDescription": "The remotes map which should be initialized in the git project. Must have at least one remote configured" + "markdownDescription": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured." } }, "additionalProperties": false, "markdownDescription": "Dockerfile's Git source" }, - "registry": { - "description": "Dockerfile's Devfile Registry source", - "type": "object", - "properties": { - "devfileRegistryUrl": { - "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", - "type": "string", - "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." - }, - "id": { - "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", - "type": "string", - "markdownDescription": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image." - } - }, - "additionalProperties": false, - "markdownDescription": "Dockerfile's Devfile Registry source" - }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", "type": "boolean", @@ -3159,7 +3159,7 @@ }, { "required": [ - "registry" + "devfileRegistry" ] }, { @@ -3182,6 +3182,24 @@ "type": "string", "markdownDescription": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container" }, + "devfileRegistry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "properties": { + "id": { + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", + "type": "string", + "markdownDescription": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image." + }, + "registryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string", + "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." + } + }, + "additionalProperties": false, + "markdownDescription": "Dockerfile's Devfile Registry source" + }, "git": { "description": "Dockerfile's Git source", "type": "object", @@ -3204,41 +3222,23 @@ "additionalProperties": false, "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "fileLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src. Defaults to Dockerfile.", "type": "string", - "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." + "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src. Defaults to Dockerfile." }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" }, - "markdownDescription": "The remotes map which should be initialized in the git project. Must have at least one remote configured" + "markdownDescription": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured." } }, "additionalProperties": false, "markdownDescription": "Dockerfile's Git source" }, - "registry": { - "description": "Dockerfile's Devfile Registry source", - "type": "object", - "properties": { - "devfileRegistryUrl": { - "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", - "type": "string", - "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." - }, - "id": { - "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", - "type": "string", - "markdownDescription": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image." - } - }, - "additionalProperties": false, - "markdownDescription": "Dockerfile's Devfile Registry source" - }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", "type": "boolean", @@ -3603,12 +3603,12 @@ "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects can only have at most one remote configured.", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" }, - "markdownDescription": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects can only have at most one remote configured." + "markdownDescription": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured." } }, "additionalProperties": false, @@ -3699,12 +3699,12 @@ "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects can only have at most one remote configured.", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" }, - "markdownDescription": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects can only have at most one remote configured." + "markdownDescription": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured." } }, "additionalProperties": false, @@ -3839,12 +3839,12 @@ "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects can only have at most one remote configured.", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" }, - "markdownDescription": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects can only have at most one remote configured." + "markdownDescription": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured." } }, "additionalProperties": false, @@ -3957,12 +3957,12 @@ "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects can only have at most one remote configured.", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" }, - "markdownDescription": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects can only have at most one remote configured." + "markdownDescription": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured." } }, "additionalProperties": false, diff --git a/schemas/latest/ide-targeted/dev-workspace.json b/schemas/latest/ide-targeted/dev-workspace.json index a3f3995e9..5d5fc8bf8 100644 --- a/schemas/latest/ide-targeted/dev-workspace.json +++ b/schemas/latest/ide-targeted/dev-workspace.json @@ -781,7 +781,7 @@ }, { "required": [ - "registry" + "devfileRegistry" ] }, { @@ -804,6 +804,27 @@ "type": "string", "markdownDescription": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container" }, + "devfileRegistry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", + "type": "string", + "markdownDescription": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image." + }, + "registryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string", + "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." + } + }, + "additionalProperties": false, + "markdownDescription": "Dockerfile's Devfile Registry source" + }, "git": { "description": "Dockerfile's Git source", "type": "object", @@ -829,44 +850,23 @@ "additionalProperties": false, "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "fileLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src. Defaults to Dockerfile.", "type": "string", - "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." + "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src. Defaults to Dockerfile." }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" }, - "markdownDescription": "The remotes map which should be initialized in the git project. Must have at least one remote configured" + "markdownDescription": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured." } }, "additionalProperties": false, "markdownDescription": "Dockerfile's Git source" }, - "registry": { - "description": "Dockerfile's Devfile Registry source", - "type": "object", - "required": [ - "id" - ], - "properties": { - "devfileRegistryUrl": { - "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", - "type": "string", - "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." - }, - "id": { - "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", - "type": "string", - "markdownDescription": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image." - } - }, - "additionalProperties": false, - "markdownDescription": "Dockerfile's Devfile Registry source" - }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", "type": "boolean", @@ -1539,7 +1539,7 @@ }, { "required": [ - "registry" + "devfileRegistry" ] }, { @@ -1562,6 +1562,24 @@ "type": "string", "markdownDescription": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container" }, + "devfileRegistry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "properties": { + "id": { + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", + "type": "string", + "markdownDescription": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image." + }, + "registryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string", + "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." + } + }, + "additionalProperties": false, + "markdownDescription": "Dockerfile's Devfile Registry source" + }, "git": { "description": "Dockerfile's Git source", "type": "object", @@ -1584,41 +1602,23 @@ "additionalProperties": false, "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "fileLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src. Defaults to Dockerfile.", "type": "string", - "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." + "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src. Defaults to Dockerfile." }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" }, - "markdownDescription": "The remotes map which should be initialized in the git project. Must have at least one remote configured" + "markdownDescription": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured." } }, "additionalProperties": false, "markdownDescription": "Dockerfile's Git source" }, - "registry": { - "description": "Dockerfile's Devfile Registry source", - "type": "object", - "properties": { - "devfileRegistryUrl": { - "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", - "type": "string", - "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." - }, - "id": { - "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", - "type": "string", - "markdownDescription": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image." - } - }, - "additionalProperties": false, - "markdownDescription": "Dockerfile's Devfile Registry source" - }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", "type": "boolean", @@ -2422,7 +2422,7 @@ }, { "required": [ - "registry" + "devfileRegistry" ] }, { @@ -2445,6 +2445,24 @@ "type": "string", "markdownDescription": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container" }, + "devfileRegistry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "properties": { + "id": { + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", + "type": "string", + "markdownDescription": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image." + }, + "registryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string", + "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." + } + }, + "additionalProperties": false, + "markdownDescription": "Dockerfile's Devfile Registry source" + }, "git": { "description": "Dockerfile's Git source", "type": "object", @@ -2467,41 +2485,23 @@ "additionalProperties": false, "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "fileLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src. Defaults to Dockerfile.", "type": "string", - "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." + "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src. Defaults to Dockerfile." }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" }, - "markdownDescription": "The remotes map which should be initialized in the git project. Must have at least one remote configured" + "markdownDescription": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured." } }, "additionalProperties": false, "markdownDescription": "Dockerfile's Git source" }, - "registry": { - "description": "Dockerfile's Devfile Registry source", - "type": "object", - "properties": { - "devfileRegistryUrl": { - "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", - "type": "string", - "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." - }, - "id": { - "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", - "type": "string", - "markdownDescription": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image." - } - }, - "additionalProperties": false, - "markdownDescription": "Dockerfile's Devfile Registry source" - }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", "type": "boolean", @@ -3172,7 +3172,7 @@ }, { "required": [ - "registry" + "devfileRegistry" ] }, { @@ -3195,6 +3195,24 @@ "type": "string", "markdownDescription": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container" }, + "devfileRegistry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "properties": { + "id": { + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", + "type": "string", + "markdownDescription": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image." + }, + "registryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string", + "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." + } + }, + "additionalProperties": false, + "markdownDescription": "Dockerfile's Devfile Registry source" + }, "git": { "description": "Dockerfile's Git source", "type": "object", @@ -3217,41 +3235,23 @@ "additionalProperties": false, "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "fileLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src. Defaults to Dockerfile.", "type": "string", - "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." + "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src. Defaults to Dockerfile." }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" }, - "markdownDescription": "The remotes map which should be initialized in the git project. Must have at least one remote configured" + "markdownDescription": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured." } }, "additionalProperties": false, "markdownDescription": "Dockerfile's Git source" }, - "registry": { - "description": "Dockerfile's Devfile Registry source", - "type": "object", - "properties": { - "devfileRegistryUrl": { - "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", - "type": "string", - "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." - }, - "id": { - "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", - "type": "string", - "markdownDescription": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image." - } - }, - "additionalProperties": false, - "markdownDescription": "Dockerfile's Devfile Registry source" - }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", "type": "boolean", @@ -3616,12 +3616,12 @@ "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects can only have at most one remote configured.", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" }, - "markdownDescription": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects can only have at most one remote configured." + "markdownDescription": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured." } }, "additionalProperties": false, @@ -3712,12 +3712,12 @@ "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects can only have at most one remote configured.", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" }, - "markdownDescription": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects can only have at most one remote configured." + "markdownDescription": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured." } }, "additionalProperties": false, @@ -3852,12 +3852,12 @@ "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects can only have at most one remote configured.", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" }, - "markdownDescription": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects can only have at most one remote configured." + "markdownDescription": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured." } }, "additionalProperties": false, @@ -3970,12 +3970,12 @@ "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects can only have at most one remote configured.", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" }, - "markdownDescription": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects can only have at most one remote configured." + "markdownDescription": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured." } }, "additionalProperties": false, diff --git a/schemas/latest/ide-targeted/devfile.json b/schemas/latest/ide-targeted/devfile.json index a5254183d..1d6011c44 100644 --- a/schemas/latest/ide-targeted/devfile.json +++ b/schemas/latest/ide-targeted/devfile.json @@ -478,7 +478,7 @@ }, { "required": [ - "registry" + "devfileRegistry" ] }, { @@ -501,6 +501,27 @@ "type": "string", "markdownDescription": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container" }, + "devfileRegistry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", + "type": "string", + "markdownDescription": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image." + }, + "registryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string", + "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." + } + }, + "additionalProperties": false, + "markdownDescription": "Dockerfile's Devfile Registry source" + }, "git": { "description": "Dockerfile's Git source", "type": "object", @@ -526,44 +547,23 @@ "additionalProperties": false, "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "fileLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src. Defaults to Dockerfile.", "type": "string", - "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." + "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src. Defaults to Dockerfile." }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" }, - "markdownDescription": "The remotes map which should be initialized in the git project. Must have at least one remote configured" + "markdownDescription": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured." } }, "additionalProperties": false, "markdownDescription": "Dockerfile's Git source" }, - "registry": { - "description": "Dockerfile's Devfile Registry source", - "type": "object", - "required": [ - "id" - ], - "properties": { - "devfileRegistryUrl": { - "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", - "type": "string", - "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." - }, - "id": { - "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", - "type": "string", - "markdownDescription": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image." - } - }, - "additionalProperties": false, - "markdownDescription": "Dockerfile's Devfile Registry source" - }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", "type": "boolean", @@ -1400,7 +1400,7 @@ }, { "required": [ - "registry" + "devfileRegistry" ] }, { @@ -1423,6 +1423,24 @@ "type": "string", "markdownDescription": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container" }, + "devfileRegistry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "properties": { + "id": { + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", + "type": "string", + "markdownDescription": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image." + }, + "registryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string", + "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." + } + }, + "additionalProperties": false, + "markdownDescription": "Dockerfile's Devfile Registry source" + }, "git": { "description": "Dockerfile's Git source", "type": "object", @@ -1445,41 +1463,23 @@ "additionalProperties": false, "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "fileLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src. Defaults to Dockerfile.", "type": "string", - "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." + "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src. Defaults to Dockerfile." }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" }, - "markdownDescription": "The remotes map which should be initialized in the git project. Must have at least one remote configured" + "markdownDescription": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured." } }, "additionalProperties": false, "markdownDescription": "Dockerfile's Git source" }, - "registry": { - "description": "Dockerfile's Devfile Registry source", - "type": "object", - "properties": { - "devfileRegistryUrl": { - "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", - "type": "string", - "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." - }, - "id": { - "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", - "type": "string", - "markdownDescription": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image." - } - }, - "additionalProperties": false, - "markdownDescription": "Dockerfile's Devfile Registry source" - }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", "type": "boolean", @@ -1788,12 +1788,12 @@ "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects can only have at most one remote configured.", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" }, - "markdownDescription": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects can only have at most one remote configured." + "markdownDescription": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured." } }, "additionalProperties": false, @@ -1884,12 +1884,12 @@ "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects can only have at most one remote configured.", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" }, - "markdownDescription": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects can only have at most one remote configured." + "markdownDescription": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured." } }, "additionalProperties": false, @@ -2000,12 +2000,12 @@ "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects can only have at most one remote configured.", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" }, - "markdownDescription": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects can only have at most one remote configured." + "markdownDescription": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured." } }, "additionalProperties": false, @@ -2100,12 +2100,12 @@ "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects can only have at most one remote configured.", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" }, - "markdownDescription": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects can only have at most one remote configured." + "markdownDescription": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured." } }, "additionalProperties": false, diff --git a/schemas/latest/ide-targeted/parent-overrides.json b/schemas/latest/ide-targeted/parent-overrides.json index fc2792bd1..8a238b797 100644 --- a/schemas/latest/ide-targeted/parent-overrides.json +++ b/schemas/latest/ide-targeted/parent-overrides.json @@ -455,7 +455,7 @@ }, { "required": [ - "registry" + "devfileRegistry" ] }, { @@ -478,6 +478,24 @@ "type": "string", "markdownDescription": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container" }, + "devfileRegistry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "properties": { + "id": { + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", + "type": "string", + "markdownDescription": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image." + }, + "registryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string", + "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." + } + }, + "additionalProperties": false, + "markdownDescription": "Dockerfile's Devfile Registry source" + }, "git": { "description": "Dockerfile's Git source", "type": "object", @@ -500,41 +518,23 @@ "additionalProperties": false, "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "fileLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src. Defaults to Dockerfile.", "type": "string", - "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." + "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src. Defaults to Dockerfile." }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" }, - "markdownDescription": "The remotes map which should be initialized in the git project. Must have at least one remote configured" + "markdownDescription": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured." } }, "additionalProperties": false, "markdownDescription": "Dockerfile's Git source" }, - "registry": { - "description": "Dockerfile's Devfile Registry source", - "type": "object", - "properties": { - "devfileRegistryUrl": { - "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", - "type": "string", - "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." - }, - "id": { - "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", - "type": "string", - "markdownDescription": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image." - } - }, - "additionalProperties": false, - "markdownDescription": "Dockerfile's Devfile Registry source" - }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", "type": "boolean", @@ -1205,7 +1205,7 @@ }, { "required": [ - "registry" + "devfileRegistry" ] }, { @@ -1228,6 +1228,24 @@ "type": "string", "markdownDescription": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container" }, + "devfileRegistry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "properties": { + "id": { + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", + "type": "string", + "markdownDescription": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image." + }, + "registryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string", + "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." + } + }, + "additionalProperties": false, + "markdownDescription": "Dockerfile's Devfile Registry source" + }, "git": { "description": "Dockerfile's Git source", "type": "object", @@ -1250,41 +1268,23 @@ "additionalProperties": false, "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "fileLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src. Defaults to Dockerfile.", "type": "string", - "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." + "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src. Defaults to Dockerfile." }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" }, - "markdownDescription": "The remotes map which should be initialized in the git project. Must have at least one remote configured" + "markdownDescription": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured." } }, "additionalProperties": false, "markdownDescription": "Dockerfile's Git source" }, - "registry": { - "description": "Dockerfile's Devfile Registry source", - "type": "object", - "properties": { - "devfileRegistryUrl": { - "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", - "type": "string", - "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." - }, - "id": { - "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", - "type": "string", - "markdownDescription": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image." - } - }, - "additionalProperties": false, - "markdownDescription": "Dockerfile's Devfile Registry source" - }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", "type": "boolean", @@ -1627,12 +1627,12 @@ "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects can only have at most one remote configured.", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" }, - "markdownDescription": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects can only have at most one remote configured." + "markdownDescription": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured." } }, "additionalProperties": false, @@ -1718,12 +1718,12 @@ "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects can only have at most one remote configured.", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" }, - "markdownDescription": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects can only have at most one remote configured." + "markdownDescription": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured." } }, "additionalProperties": false, diff --git a/schemas/latest/ide-targeted/plugin-overrides.json b/schemas/latest/ide-targeted/plugin-overrides.json index 61aa9d438..6cd389dce 100644 --- a/schemas/latest/ide-targeted/plugin-overrides.json +++ b/schemas/latest/ide-targeted/plugin-overrides.json @@ -444,7 +444,7 @@ }, { "required": [ - "registry" + "devfileRegistry" ] }, { @@ -467,6 +467,24 @@ "type": "string", "markdownDescription": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container" }, + "devfileRegistry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "properties": { + "id": { + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", + "type": "string", + "markdownDescription": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image." + }, + "registryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string", + "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." + } + }, + "additionalProperties": false, + "markdownDescription": "Dockerfile's Devfile Registry source" + }, "git": { "description": "Dockerfile's Git source", "type": "object", @@ -489,41 +507,23 @@ "additionalProperties": false, "markdownDescription": "Defines from what the project should be checked out. Required if there are more than one remote configured" }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "fileLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src. Defaults to Dockerfile.", "type": "string", - "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src." + "markdownDescription": "Location of the Dockerfile in the Git repository when using git as Dockerfile src. Defaults to Dockerfile." }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" }, - "markdownDescription": "The remotes map which should be initialized in the git project. Must have at least one remote configured" + "markdownDescription": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured." } }, "additionalProperties": false, "markdownDescription": "Dockerfile's Git source" }, - "registry": { - "description": "Dockerfile's Devfile Registry source", - "type": "object", - "properties": { - "devfileRegistryUrl": { - "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", - "type": "string", - "markdownDescription": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used." - }, - "id": { - "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", - "type": "string", - "markdownDescription": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image." - } - }, - "additionalProperties": false, - "markdownDescription": "Dockerfile's Devfile Registry source" - }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", "type": "boolean", diff --git a/schemas/latest/parent-overrides.json b/schemas/latest/parent-overrides.json index 514e5f000..f005314f6 100644 --- a/schemas/latest/parent-overrides.json +++ b/schemas/latest/parent-overrides.json @@ -410,7 +410,7 @@ }, { "required": [ - "registry" + "devfileRegistry" ] }, { @@ -431,6 +431,21 @@ "description": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container", "type": "string" }, + "devfileRegistry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "properties": { + "id": { + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", + "type": "string" + }, + "registryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string" + } + }, + "additionalProperties": false + }, "git": { "description": "Dockerfile's Git source", "type": "object", @@ -450,12 +465,12 @@ }, "additionalProperties": false }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "fileLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src. Defaults to Dockerfile.", "type": "string" }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" @@ -464,21 +479,6 @@ }, "additionalProperties": false }, - "registry": { - "description": "Dockerfile's Devfile Registry source", - "type": "object", - "properties": { - "devfileRegistryUrl": { - "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", - "type": "string" - }, - "id": { - "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", - "type": "string" - } - }, - "additionalProperties": false - }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", "type": "boolean" @@ -1084,7 +1084,7 @@ }, { "required": [ - "registry" + "devfileRegistry" ] }, { @@ -1105,6 +1105,21 @@ "description": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container", "type": "string" }, + "devfileRegistry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "properties": { + "id": { + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", + "type": "string" + }, + "registryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string" + } + }, + "additionalProperties": false + }, "git": { "description": "Dockerfile's Git source", "type": "object", @@ -1124,12 +1139,12 @@ }, "additionalProperties": false }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "fileLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src. Defaults to Dockerfile.", "type": "string" }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" @@ -1138,21 +1153,6 @@ }, "additionalProperties": false }, - "registry": { - "description": "Dockerfile's Devfile Registry source", - "type": "object", - "properties": { - "devfileRegistryUrl": { - "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", - "type": "string" - }, - "id": { - "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", - "type": "string" - } - }, - "additionalProperties": false - }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", "type": "boolean" @@ -1455,7 +1455,7 @@ "additionalProperties": false }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects can only have at most one remote configured.", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" @@ -1535,7 +1535,7 @@ "additionalProperties": false }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects can only have at most one remote configured.", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" diff --git a/schemas/latest/plugin-overrides.json b/schemas/latest/plugin-overrides.json index 273012896..f3e07779f 100644 --- a/schemas/latest/plugin-overrides.json +++ b/schemas/latest/plugin-overrides.json @@ -400,7 +400,7 @@ }, { "required": [ - "registry" + "devfileRegistry" ] }, { @@ -421,6 +421,21 @@ "description": "Path of source directory to establish build context. Defaults to ${PROJECT_ROOT} in the container", "type": "string" }, + "devfileRegistry": { + "description": "Dockerfile's Devfile Registry source", + "type": "object", + "properties": { + "id": { + "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", + "type": "string" + }, + "registryUrl": { + "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", + "type": "string" + } + }, + "additionalProperties": false + }, "git": { "description": "Dockerfile's Git source", "type": "object", @@ -440,12 +455,12 @@ }, "additionalProperties": false }, - "gitLocation": { - "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src.", + "fileLocation": { + "description": "Location of the Dockerfile in the Git repository when using git as Dockerfile src. Defaults to Dockerfile.", "type": "string" }, "remotes": { - "description": "The remotes map which should be initialized in the git project. Must have at least one remote configured", + "description": "The remotes map which should be initialized in the git project. Projects must have at least one remote configured while StarterProjects \u0026 Image Component's Git source can only have at most one remote configured.", "type": "object", "additionalProperties": { "type": "string" @@ -454,21 +469,6 @@ }, "additionalProperties": false }, - "registry": { - "description": "Dockerfile's Devfile Registry source", - "type": "object", - "properties": { - "devfileRegistryUrl": { - "description": "Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src. To ensure the Dockerfile gets resolved consistently in different environments, it is recommended to always specify the `devfileRegistryUrl` when `Id` is used.", - "type": "string" - }, - "id": { - "description": "Id in a devfile registry that contains a Dockerfile. The src in the OCI registry required for the Dockerfile build will be downloaded for building the image.", - "type": "string" - } - }, - "additionalProperties": false - }, "rootRequired": { "description": "Specify if a privileged builder pod is required.\n\nDefault value is `false`", "type": "boolean" From da87678c54e11cd1f92d7b5acd6b03a99e6d96b8 Mon Sep 17 00:00:00 2001 From: Maysun J Faisal Date: Wed, 15 Sep 2021 18:23:01 -0400 Subject: [PATCH 7/7] Review feedback: Update var name, nesting and test coverage Signed-off-by: Maysun J Faisal --- pkg/validation/errors.go | 28 +- pkg/validation/projects.go | 12 +- .../test-fixtures/components/image-empty.yaml | 1 + pkg/validation/variables/variables_command.go | 68 ++--- .../variables/variables_command_test.go | 43 ++- .../variables/variables_component.go | 258 +++++++++--------- .../variables/variables_component_test.go | 71 ++++- pkg/validation/variables/variables_project.go | 82 +++--- .../variables/variables_project_test.go | 67 ++++- 9 files changed, 404 insertions(+), 226 deletions(-) create mode 100644 pkg/validation/variables/test-fixtures/components/image-empty.yaml diff --git a/pkg/validation/errors.go b/pkg/validation/errors.go index 6fc520188..efb42a8c8 100644 --- a/pkg/validation/errors.go +++ b/pkg/validation/errors.go @@ -121,24 +121,24 @@ func (e *MissingProjectRemoteError) Error() string { return fmt.Sprintf("project %s should have at least one remote", e.projectName) } -//MissingStarterProjectRemoteError returns an error if the git remotes object under a starterProject is empty -type MissingStarterProjectRemoteError struct { - objectName string - projectName string +//MissingRemoteError returns an error if the git remotes object is empty +type MissingRemoteError struct { + objectType string + objectName string } -func (e *MissingStarterProjectRemoteError) Error() string { - return fmt.Sprintf("%s %s should have at least one remote", e.objectName, e.projectName) +func (e *MissingRemoteError) Error() string { + return fmt.Sprintf("%s %s should have at least one remote", e.objectType, e.objectName) } -//MultipleStarterProjectRemoteError returns an error if multiple git remotes are specified. There can only be one remote. -type MultipleStarterProjectRemoteError struct { - objectName string - projectName string +//MultipleRemoteError returns an error if multiple git remotes are specified. There can only be one remote. +type MultipleRemoteError struct { + objectType string + objectName string } -func (e *MultipleStarterProjectRemoteError) Error() string { - return fmt.Sprintf("%s %s should have one remote only", e.objectName, e.projectName) +func (e *MultipleRemoteError) Error() string { + return fmt.Sprintf("%s %s should have one remote only", e.objectType, e.objectName) } //MissingProjectCheckoutFromRemoteError returns an error if there are multiple git remotes but the checkoutFrom remote has not been specified @@ -152,13 +152,13 @@ func (e *MissingProjectCheckoutFromRemoteError) Error() string { //InvalidProjectCheckoutRemoteError returns an error if there is an unmatched, checkoutFrom remote specified type InvalidProjectCheckoutRemoteError struct { + objectType string objectName string - projectName string checkoutRemote string } func (e *InvalidProjectCheckoutRemoteError) Error() string { - return fmt.Sprintf("unable to find the checkout remote %s in the remotes for %s %s", e.checkoutRemote, e.objectName, e.projectName) + return fmt.Sprintf("unable to find the checkout remote %s in the remotes for %s %s", e.checkoutRemote, e.objectType, e.objectName) } // resolveErrorMessageWithImportAttributes returns an updated error message diff --git a/pkg/validation/projects.go b/pkg/validation/projects.go index 55df4ec7a..4cbc875c0 100644 --- a/pkg/validation/projects.go +++ b/pkg/validation/projects.go @@ -67,27 +67,27 @@ func ValidateProjects(projects []v1alpha2.Project) (returnedErr error) { } // validateRemoteMap checks if the checkout remote is present in the project remote map -func validateRemoteMap(remotes map[string]string, checkoutRemote, object, name string) error { +func validateRemoteMap(remotes map[string]string, checkoutRemote, objectType, objectName string) error { if _, ok := remotes[checkoutRemote]; !ok { - return &InvalidProjectCheckoutRemoteError{projectName: name, objectName: object, checkoutRemote: checkoutRemote} + return &InvalidProjectCheckoutRemoteError{objectName: objectName, objectType: objectType, checkoutRemote: checkoutRemote} } return nil } // validateSingleRemoteGitSrc validates a git src for a single remote only -func validateSingleRemoteGitSrc(object, name string, gitSource v1alpha2.GitLikeProjectSource) (err error) { +func validateSingleRemoteGitSrc(objectType, objectName string, gitSource v1alpha2.GitLikeProjectSource) (err error) { switch len(gitSource.Remotes) { case 0: - err = &MissingStarterProjectRemoteError{objectName: object, projectName: name} + err = &MissingRemoteError{objectType: objectType, objectName: objectName} case 1: if gitSource.CheckoutFrom != nil && gitSource.CheckoutFrom.Remote != "" { - err = validateRemoteMap(gitSource.Remotes, gitSource.CheckoutFrom.Remote, object, name) + err = validateRemoteMap(gitSource.Remotes, gitSource.CheckoutFrom.Remote, objectType, objectName) } default: // len(gitSource.Remotes) >= 2 - err = &MultipleStarterProjectRemoteError{objectName: object, projectName: name} + err = &MultipleRemoteError{objectType: objectType, objectName: objectName} } return err diff --git a/pkg/validation/variables/test-fixtures/components/image-empty.yaml b/pkg/validation/variables/test-fixtures/components/image-empty.yaml new file mode 100644 index 000000000..d8dd47d6c --- /dev/null +++ b/pkg/validation/variables/test-fixtures/components/image-empty.yaml @@ -0,0 +1 @@ +imageName: "myimage:xyz" diff --git a/pkg/validation/variables/variables_command.go b/pkg/validation/variables/variables_command.go index 8e9c08679..eb51b230a 100644 --- a/pkg/validation/variables/variables_command.go +++ b/pkg/validation/variables/variables_command.go @@ -41,31 +41,33 @@ func ValidateAndReplaceForCommands(variables map[string]string, commands []v1alp // validateAndReplaceForExecCommand validates the exec command data for global variable references and replaces them with the variable value func validateAndReplaceForExecCommand(variables map[string]string, exec *v1alpha2.ExecCommand) error { - var err error + if exec == nil { + return nil + } + + var err error invalidKeys := make(map[string]bool) - if exec != nil { - // Validate exec command line - if exec.CommandLine, err = validateAndReplaceDataWithVariable(exec.CommandLine, variables); err != nil { - checkForInvalidError(invalidKeys, err) - } + // Validate exec command line + if exec.CommandLine, err = validateAndReplaceDataWithVariable(exec.CommandLine, variables); err != nil { + checkForInvalidError(invalidKeys, err) + } - // Validate exec working dir - if exec.WorkingDir, err = validateAndReplaceDataWithVariable(exec.WorkingDir, variables); err != nil { - checkForInvalidError(invalidKeys, err) - } + // Validate exec working dir + if exec.WorkingDir, err = validateAndReplaceDataWithVariable(exec.WorkingDir, variables); err != nil { + checkForInvalidError(invalidKeys, err) + } - // Validate exec label - if exec.Label, err = validateAndReplaceDataWithVariable(exec.Label, variables); err != nil { - checkForInvalidError(invalidKeys, err) - } + // Validate exec label + if exec.Label, err = validateAndReplaceDataWithVariable(exec.Label, variables); err != nil { + checkForInvalidError(invalidKeys, err) + } - // Validate exec env - if len(exec.Env) > 0 { - if err = validateAndReplaceForEnv(variables, exec.Env); err != nil { - checkForInvalidError(invalidKeys, err) - } + // Validate exec env + if len(exec.Env) > 0 { + if err = validateAndReplaceForEnv(variables, exec.Env); err != nil { + checkForInvalidError(invalidKeys, err) } } @@ -74,15 +76,17 @@ func validateAndReplaceForExecCommand(variables map[string]string, exec *v1alpha // validateAndReplaceForCompositeCommand validates the composite command data for global variable references and replaces them with the variable value func validateAndReplaceForCompositeCommand(variables map[string]string, composite *v1alpha2.CompositeCommand) error { - var err error + if composite == nil { + return nil + } + + var err error invalidKeys := make(map[string]bool) - if composite != nil { - // Validate composite label - if composite.Label, err = validateAndReplaceDataWithVariable(composite.Label, variables); err != nil { - checkForInvalidError(invalidKeys, err) - } + // Validate composite label + if composite.Label, err = validateAndReplaceDataWithVariable(composite.Label, variables); err != nil { + checkForInvalidError(invalidKeys, err) } return newInvalidKeysError(invalidKeys) @@ -90,15 +94,17 @@ func validateAndReplaceForCompositeCommand(variables map[string]string, composit // validateAndReplaceForApplyCommand validates the apply command data for global variable references and replaces them with the variable value func validateAndReplaceForApplyCommand(variables map[string]string, apply *v1alpha2.ApplyCommand) error { - var err error + if apply == nil { + return nil + } + + var err error invalidKeys := make(map[string]bool) - if apply != nil { - // Validate apply label - if apply.Label, err = validateAndReplaceDataWithVariable(apply.Label, variables); err != nil { - checkForInvalidError(invalidKeys, err) - } + // Validate apply label + if apply.Label, err = validateAndReplaceDataWithVariable(apply.Label, variables); err != nil { + checkForInvalidError(invalidKeys, err) } return newInvalidKeysError(invalidKeys) diff --git a/pkg/validation/variables/variables_command_test.go b/pkg/validation/variables/variables_command_test.go index d5f34ae18..b94d2667d 100644 --- a/pkg/validation/variables/variables_command_test.go +++ b/pkg/validation/variables/variables_command_test.go @@ -1,6 +1,7 @@ package variables import ( + "reflect" "testing" "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" @@ -30,6 +31,13 @@ func TestValidateAndReplaceExecCommand(t *testing.T) { variableFile: "test-fixtures/variables/variables-notreferenced.yaml", wantErr: true, }, + { + name: "Not an exec command", + testFile: "test-fixtures/components/volume.yaml", + outputFile: "test-fixtures/components/volume.yaml", + variableFile: "test-fixtures/variables/variables-notreferenced.yaml", + wantErr: false, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -39,7 +47,12 @@ func TestValidateAndReplaceExecCommand(t *testing.T) { testVariable := make(map[string]string) readFileToStruct(t, tt.variableFile, &testVariable) - err := validateAndReplaceForExecCommand(testVariable, &testExecCommand) + var err error + if reflect.DeepEqual(testExecCommand, v1alpha2.ExecCommand{}) { + err = validateAndReplaceForExecCommand(testVariable, nil) + } else { + err = validateAndReplaceForExecCommand(testVariable, &testExecCommand) + } _, ok := err.(*InvalidKeysError) if tt.wantErr && !ok { t.Errorf("Expected InvalidKeysError error from test but got %+v", err) @@ -77,6 +90,13 @@ func TestValidateAndReplaceCompositeCommand(t *testing.T) { variableFile: "test-fixtures/variables/variables-notreferenced.yaml", wantErr: true, }, + { + name: "Not a composite command", + testFile: "test-fixtures/components/volume.yaml", + outputFile: "test-fixtures/components/volume.yaml", + variableFile: "test-fixtures/variables/variables-notreferenced.yaml", + wantErr: false, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -86,7 +106,12 @@ func TestValidateAndReplaceCompositeCommand(t *testing.T) { testVariable := make(map[string]string) readFileToStruct(t, tt.variableFile, &testVariable) - err := validateAndReplaceForCompositeCommand(testVariable, &testCompositeCommand) + var err error + if reflect.DeepEqual(testCompositeCommand, v1alpha2.CompositeCommand{}) { + err = validateAndReplaceForCompositeCommand(testVariable, nil) + } else { + err = validateAndReplaceForCompositeCommand(testVariable, &testCompositeCommand) + } _, ok := err.(*InvalidKeysError) if tt.wantErr && !ok { t.Errorf("Expected InvalidKeysError error from test but got %+v", err) @@ -124,6 +149,13 @@ func TestValidateAndReplaceApplyCommand(t *testing.T) { variableFile: "test-fixtures/variables/variables-notreferenced.yaml", wantErr: true, }, + { + name: "Not an apply command", + testFile: "test-fixtures/components/volume.yaml", + outputFile: "test-fixtures/components/volume.yaml", + variableFile: "test-fixtures/variables/variables-notreferenced.yaml", + wantErr: false, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -133,7 +165,12 @@ func TestValidateAndReplaceApplyCommand(t *testing.T) { testVariable := make(map[string]string) readFileToStruct(t, tt.variableFile, &testVariable) - err := validateAndReplaceForApplyCommand(testVariable, &testApplyCommand) + var err error + if reflect.DeepEqual(testApplyCommand, v1alpha2.ApplyCommand{}) { + err = validateAndReplaceForApplyCommand(testVariable, nil) + } else { + err = validateAndReplaceForApplyCommand(testVariable, &testApplyCommand) + } _, ok := err.(*InvalidKeysError) if tt.wantErr && !ok { t.Errorf("Expected InvalidKeysError error from test but got %+v", err) diff --git a/pkg/validation/variables/variables_component.go b/pkg/validation/variables/variables_component.go index 0bd237ad5..a42aa2f17 100644 --- a/pkg/validation/variables/variables_component.go +++ b/pkg/validation/variables/variables_component.go @@ -53,64 +53,66 @@ func ValidateAndReplaceForComponents(variables map[string]string, components []v // validateAndReplaceForContainerComponent validates the container component data for global variable references and replaces them with the variable value func validateAndReplaceForContainerComponent(variables map[string]string, container *v1alpha2.ContainerComponent) error { - var err error + if container == nil { + return nil + } + + var err error invalidKeys := make(map[string]bool) - if container != nil { - // Validate container image - if container.Image, err = validateAndReplaceDataWithVariable(container.Image, variables); err != nil { + // Validate container image + if container.Image, err = validateAndReplaceDataWithVariable(container.Image, variables); err != nil { + checkForInvalidError(invalidKeys, err) + } + + // Validate container commands + for i := range container.Command { + if container.Command[i], err = validateAndReplaceDataWithVariable(container.Command[i], variables); err != nil { checkForInvalidError(invalidKeys, err) } + } - // Validate container commands - for i := range container.Command { - if container.Command[i], err = validateAndReplaceDataWithVariable(container.Command[i], variables); err != nil { - checkForInvalidError(invalidKeys, err) - } + // Validate container args + for i := range container.Args { + if container.Args[i], err = validateAndReplaceDataWithVariable(container.Args[i], variables); err != nil { + checkForInvalidError(invalidKeys, err) } + } - // Validate container args - for i := range container.Args { - if container.Args[i], err = validateAndReplaceDataWithVariable(container.Args[i], variables); err != nil { - checkForInvalidError(invalidKeys, err) - } - } + // Validate memory limit + if container.MemoryLimit, err = validateAndReplaceDataWithVariable(container.MemoryLimit, variables); err != nil { + checkForInvalidError(invalidKeys, err) + } - // Validate memory limit - if container.MemoryLimit, err = validateAndReplaceDataWithVariable(container.MemoryLimit, variables); err != nil { - checkForInvalidError(invalidKeys, err) - } + // Validate memory request + if container.MemoryRequest, err = validateAndReplaceDataWithVariable(container.MemoryRequest, variables); err != nil { + checkForInvalidError(invalidKeys, err) + } - // Validate memory request - if container.MemoryRequest, err = validateAndReplaceDataWithVariable(container.MemoryRequest, variables); err != nil { - checkForInvalidError(invalidKeys, err) - } + // Validate source mapping + if container.SourceMapping, err = validateAndReplaceDataWithVariable(container.SourceMapping, variables); err != nil { + checkForInvalidError(invalidKeys, err) + } - // Validate source mapping - if container.SourceMapping, err = validateAndReplaceDataWithVariable(container.SourceMapping, variables); err != nil { + // Validate container env + if len(container.Env) > 0 { + if err = validateAndReplaceForEnv(variables, container.Env); err != nil { checkForInvalidError(invalidKeys, err) } + } - // Validate container env - if len(container.Env) > 0 { - if err = validateAndReplaceForEnv(variables, container.Env); err != nil { - checkForInvalidError(invalidKeys, err) - } - } - - // Validate container volume mounts - for i := range container.VolumeMounts { - if container.VolumeMounts[i].Path, err = validateAndReplaceDataWithVariable(container.VolumeMounts[i].Path, variables); err != nil { - checkForInvalidError(invalidKeys, err) - } + // Validate container volume mounts + for i := range container.VolumeMounts { + if container.VolumeMounts[i].Path, err = validateAndReplaceDataWithVariable(container.VolumeMounts[i].Path, variables); err != nil { + checkForInvalidError(invalidKeys, err) } + } - // Validate container endpoints - if len(container.Endpoints) > 0 { - if err = validateAndReplaceForEndpoint(variables, container.Endpoints); err != nil { - checkForInvalidError(invalidKeys, err) - } + // Validate container endpoints + if len(container.Endpoints) > 0 { + if err = validateAndReplaceForEndpoint(variables, container.Endpoints); err != nil { + checkForInvalidError(invalidKeys, err) } } @@ -141,26 +143,28 @@ func validateAndReplaceForEnv(variables map[string]string, env []v1alpha2.EnvVar // validateAndReplaceForKubernetesComponent validates the kubernetes component data for global variable references and replaces them with the variable value func validateAndReplaceForKubernetesComponent(variables map[string]string, kubernetes *v1alpha2.KubernetesComponent) error { - var err error + if kubernetes == nil { + return nil + } + + var err error invalidKeys := make(map[string]bool) - if kubernetes != nil { - // Validate kubernetes uri - if kubernetes.Uri, err = validateAndReplaceDataWithVariable(kubernetes.Uri, variables); err != nil { - checkForInvalidError(invalidKeys, err) - } + // Validate kubernetes uri + if kubernetes.Uri, err = validateAndReplaceDataWithVariable(kubernetes.Uri, variables); err != nil { + checkForInvalidError(invalidKeys, err) + } - // Validate kubernetes inlined - if kubernetes.Inlined, err = validateAndReplaceDataWithVariable(kubernetes.Inlined, variables); err != nil { - checkForInvalidError(invalidKeys, err) - } + // Validate kubernetes inlined + if kubernetes.Inlined, err = validateAndReplaceDataWithVariable(kubernetes.Inlined, variables); err != nil { + checkForInvalidError(invalidKeys, err) + } - // Validate kubernetes endpoints - if len(kubernetes.Endpoints) > 0 { - if err = validateAndReplaceForEndpoint(variables, kubernetes.Endpoints); err != nil { - checkForInvalidError(invalidKeys, err) - } + // Validate kubernetes endpoints + if len(kubernetes.Endpoints) > 0 { + if err = validateAndReplaceForEndpoint(variables, kubernetes.Endpoints); err != nil { + checkForInvalidError(invalidKeys, err) } } @@ -169,26 +173,28 @@ func validateAndReplaceForKubernetesComponent(variables map[string]string, kuber // validateAndReplaceForOpenShiftComponent validates the openshift component data for global variable references and replaces them with the variable value func validateAndReplaceForOpenShiftComponent(variables map[string]string, openshift *v1alpha2.OpenshiftComponent) error { - var err error + if openshift == nil { + return nil + } + + var err error invalidKeys := make(map[string]bool) - if openshift != nil { - // Validate openshift uri - if openshift.Uri, err = validateAndReplaceDataWithVariable(openshift.Uri, variables); err != nil { - checkForInvalidError(invalidKeys, err) - } + // Validate openshift uri + if openshift.Uri, err = validateAndReplaceDataWithVariable(openshift.Uri, variables); err != nil { + checkForInvalidError(invalidKeys, err) + } - // Validate openshift inlined - if openshift.Inlined, err = validateAndReplaceDataWithVariable(openshift.Inlined, variables); err != nil { - checkForInvalidError(invalidKeys, err) - } + // Validate openshift inlined + if openshift.Inlined, err = validateAndReplaceDataWithVariable(openshift.Inlined, variables); err != nil { + checkForInvalidError(invalidKeys, err) + } - // Validate openshift endpoints - if len(openshift.Endpoints) > 0 { - if err = validateAndReplaceForEndpoint(variables, openshift.Endpoints); err != nil { - checkForInvalidError(invalidKeys, err) - } + // Validate openshift endpoints + if len(openshift.Endpoints) > 0 { + if err = validateAndReplaceForEndpoint(variables, openshift.Endpoints); err != nil { + checkForInvalidError(invalidKeys, err) } } @@ -197,23 +203,21 @@ func validateAndReplaceForOpenShiftComponent(variables map[string]string, opensh // validateAndReplaceForImageComponent validates the image component data for global variable references and replaces them with the variable value func validateAndReplaceForImageComponent(variables map[string]string, image *v1alpha2.ImageComponent) error { - var err error - invalidKeys := make(map[string]bool) + if image == nil { + return nil + } - if image != nil { - // Validate image's image name - if image.ImageName, err = validateAndReplaceDataWithVariable(image.ImageName, variables); err != nil { - checkForInvalidError(invalidKeys, err) - } + var err error + invalidKeys := make(map[string]bool) - switch { - case image.Dockerfile != nil: - if err = validateAndReplaceForDockerfileImageComponent(variables, image.Dockerfile); err != nil { - checkForInvalidError(invalidKeys, err) - } - } + // Validate image's image name + if image.ImageName, err = validateAndReplaceDataWithVariable(image.ImageName, variables); err != nil { + checkForInvalidError(invalidKeys, err) + } + if err = validateAndReplaceForDockerfileImageComponent(variables, image.Dockerfile); err != nil { + checkForInvalidError(invalidKeys, err) } return newInvalidKeysError(invalidKeys) @@ -221,50 +225,50 @@ func validateAndReplaceForImageComponent(variables map[string]string, image *v1a // validateAndReplaceForDockerfileImageComponent validates the dockerfile image component data for global variable references and replaces them with the variable value func validateAndReplaceForDockerfileImageComponent(variables map[string]string, dockerfileImage *v1alpha2.DockerfileImage) error { - var err error - - invalidKeys := make(map[string]bool) - if dockerfileImage != nil { + if dockerfileImage == nil { + return nil + } - switch { - case dockerfileImage.Uri != "": - // Validate dockerfile image URI - if dockerfileImage.Uri, err = validateAndReplaceDataWithVariable(dockerfileImage.Uri, variables); err != nil { - checkForInvalidError(invalidKeys, err) - } - case dockerfileImage.Git != nil: - // Validate dockerfile Git location - if dockerfileImage.Git.FileLocation, err = validateAndReplaceDataWithVariable(dockerfileImage.Git.FileLocation, variables); err != nil { - checkForInvalidError(invalidKeys, err) - } + var err error + invalidKeys := make(map[string]bool) - gitProject := &dockerfileImage.Git.GitLikeProjectSource - if err = validateAndReplaceForGitProjectSource(variables, gitProject); err != nil { - checkForInvalidError(invalidKeys, err) - } - case dockerfileImage.DevfileRegistry != nil: - // Validate dockerfile devfile registry src - if dockerfileImage.DevfileRegistry.Id, err = validateAndReplaceDataWithVariable(dockerfileImage.DevfileRegistry.Id, variables); err != nil { - checkForInvalidError(invalidKeys, err) - } - if dockerfileImage.DevfileRegistry.RegistryUrl, err = validateAndReplaceDataWithVariable(dockerfileImage.DevfileRegistry.RegistryUrl, variables); err != nil { - checkForInvalidError(invalidKeys, err) - } + switch { + case dockerfileImage.Uri != "": + // Validate dockerfile image URI + if dockerfileImage.Uri, err = validateAndReplaceDataWithVariable(dockerfileImage.Uri, variables); err != nil { + checkForInvalidError(invalidKeys, err) } - - // Validate dockerfile image's build context - if dockerfileImage.BuildContext, err = validateAndReplaceDataWithVariable(dockerfileImage.BuildContext, variables); err != nil { + case dockerfileImage.Git != nil: + // Validate dockerfile Git location + if dockerfileImage.Git.FileLocation, err = validateAndReplaceDataWithVariable(dockerfileImage.Git.FileLocation, variables); err != nil { checkForInvalidError(invalidKeys, err) } - // Validate dockerfile image's args - for i := range dockerfileImage.Args { - if dockerfileImage.Args[i], err = validateAndReplaceDataWithVariable(dockerfileImage.Args[i], variables); err != nil { - checkForInvalidError(invalidKeys, err) - } + gitProject := &dockerfileImage.Git.GitLikeProjectSource + if err = validateAndReplaceForGitProjectSource(variables, gitProject); err != nil { + checkForInvalidError(invalidKeys, err) + } + case dockerfileImage.DevfileRegistry != nil: + // Validate dockerfile devfile registry src + if dockerfileImage.DevfileRegistry.Id, err = validateAndReplaceDataWithVariable(dockerfileImage.DevfileRegistry.Id, variables); err != nil { + checkForInvalidError(invalidKeys, err) + } + if dockerfileImage.DevfileRegistry.RegistryUrl, err = validateAndReplaceDataWithVariable(dockerfileImage.DevfileRegistry.RegistryUrl, variables); err != nil { + checkForInvalidError(invalidKeys, err) } + } + + // Validate dockerfile image's build context + if dockerfileImage.BuildContext, err = validateAndReplaceDataWithVariable(dockerfileImage.BuildContext, variables); err != nil { + checkForInvalidError(invalidKeys, err) + } + // Validate dockerfile image's args + for i := range dockerfileImage.Args { + if dockerfileImage.Args[i], err = validateAndReplaceDataWithVariable(dockerfileImage.Args[i], variables); err != nil { + checkForInvalidError(invalidKeys, err) + } } return newInvalidKeysError(invalidKeys) @@ -272,15 +276,17 @@ func validateAndReplaceForDockerfileImageComponent(variables map[string]string, // validateAndReplaceForVolumeComponent validates the volume component data for global variable references and replaces them with the variable value func validateAndReplaceForVolumeComponent(variables map[string]string, volume *v1alpha2.VolumeComponent) error { - var err error + if volume == nil { + return nil + } + + var err error invalidKeys := make(map[string]bool) - if volume != nil { - // Validate volume size - if volume.Size, err = validateAndReplaceDataWithVariable(volume.Size, variables); err != nil { - checkForInvalidError(invalidKeys, err) - } + // Validate volume size + if volume.Size, err = validateAndReplaceDataWithVariable(volume.Size, variables); err != nil { + checkForInvalidError(invalidKeys, err) } return newInvalidKeysError(invalidKeys) diff --git a/pkg/validation/variables/variables_component_test.go b/pkg/validation/variables/variables_component_test.go index c327dad51..95164198a 100644 --- a/pkg/validation/variables/variables_component_test.go +++ b/pkg/validation/variables/variables_component_test.go @@ -1,6 +1,7 @@ package variables import ( + "reflect" "testing" "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" @@ -30,6 +31,13 @@ func TestValidateAndReplaceContainerComponent(t *testing.T) { variableFile: "test-fixtures/variables/variables-notreferenced.yaml", wantErr: true, }, + { + name: "Not a container component", + testFile: "test-fixtures/components/volume.yaml", + outputFile: "test-fixtures/components/volume.yaml", + variableFile: "test-fixtures/variables/variables-notreferenced.yaml", + wantErr: false, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -39,7 +47,13 @@ func TestValidateAndReplaceContainerComponent(t *testing.T) { testVariable := make(map[string]string) readFileToStruct(t, tt.variableFile, &testVariable) - err := validateAndReplaceForContainerComponent(testVariable, &testContainerComponent) + var err error + if reflect.DeepEqual(testContainerComponent, v1alpha2.ContainerComponent{}) { + err = validateAndReplaceForContainerComponent(testVariable, nil) + } else { + err = validateAndReplaceForContainerComponent(testVariable, &testContainerComponent) + } + _, ok := err.(*InvalidKeysError) if tt.wantErr && !ok { t.Errorf("Expected InvalidKeysError error from test but got %+v", err) @@ -77,6 +91,13 @@ func TestValidateAndReplaceOpenShiftKubernetesComponent(t *testing.T) { variableFile: "test-fixtures/variables/variables-notreferenced.yaml", wantErr: true, }, + { + name: "Not an openshift or a kubernetes component", + testFile: "test-fixtures/components/volume.yaml", + outputFile: "test-fixtures/components/volume.yaml", + variableFile: "test-fixtures/variables/variables-notreferenced.yaml", + wantErr: false, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -89,7 +110,12 @@ func TestValidateAndReplaceOpenShiftKubernetesComponent(t *testing.T) { testVariable := make(map[string]string) readFileToStruct(t, tt.variableFile, &testVariable) - err := validateAndReplaceForOpenShiftComponent(testVariable, &testOpenshiftComponent) + var err error + if reflect.DeepEqual(testOpenshiftComponent, v1alpha2.OpenshiftComponent{}) { + err = validateAndReplaceForOpenShiftComponent(testVariable, nil) + } else { + err = validateAndReplaceForOpenShiftComponent(testVariable, &testOpenshiftComponent) + } if tt.wantErr && err == nil { t.Errorf("Expected error from test but got nil") } else if !tt.wantErr && err != nil { @@ -100,7 +126,11 @@ func TestValidateAndReplaceOpenShiftKubernetesComponent(t *testing.T) { assert.Equal(t, expectedOpenshiftComponent, testOpenshiftComponent, "The two values should be the same.") } - err = validateAndReplaceForKubernetesComponent(testVariable, &testKubernetesComponent) + if reflect.DeepEqual(testKubernetesComponent, v1alpha2.KubernetesComponent{}) { + err = validateAndReplaceForKubernetesComponent(testVariable, nil) + } else { + err = validateAndReplaceForKubernetesComponent(testVariable, &testKubernetesComponent) + } _, ok := err.(*InvalidKeysError) if tt.wantErr && !ok { t.Errorf("Expected InvalidKeysError error from test but got %+v", err) @@ -166,6 +196,20 @@ func TestValidateAndReplaceImageComponent(t *testing.T) { variableFile: "test-fixtures/variables/variables-notreferenced.yaml", wantErr: true, }, + { + name: "Not an image component", + testFile: "test-fixtures/components/volume.yaml", + outputFile: "test-fixtures/components/volume.yaml", + variableFile: "test-fixtures/variables/variables-notreferenced.yaml", + wantErr: false, + }, + { + name: "Not an image dockerfile component", + testFile: "test-fixtures/components/image-empty.yaml", + outputFile: "test-fixtures/components/image-empty.yaml", + variableFile: "test-fixtures/variables/variables-referenced.yaml", + wantErr: false, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -175,7 +219,12 @@ func TestValidateAndReplaceImageComponent(t *testing.T) { testVariable := make(map[string]string) readFileToStruct(t, tt.variableFile, &testVariable) - err := validateAndReplaceForImageComponent(testVariable, &testImageComponent) + var err error + if reflect.DeepEqual(testImageComponent, v1alpha2.ImageComponent{}) { + err = validateAndReplaceForImageComponent(testVariable, nil) + } else { + err = validateAndReplaceForImageComponent(testVariable, &testImageComponent) + } _, ok := err.(*InvalidKeysError) if tt.wantErr && !ok { t.Errorf("Expected InvalidKeysError error from test but got %+v", err) @@ -213,6 +262,13 @@ func TestValidateAndReplaceVolumeComponent(t *testing.T) { variableFile: "test-fixtures/variables/variables-notreferenced.yaml", wantErr: true, }, + { + name: "Not a volume component", + testFile: "test-fixtures/components/container.yaml", + outputFile: "test-fixtures/components/container.yaml", + variableFile: "test-fixtures/variables/variables-notreferenced.yaml", + wantErr: false, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -222,7 +278,12 @@ func TestValidateAndReplaceVolumeComponent(t *testing.T) { testVariable := make(map[string]string) readFileToStruct(t, tt.variableFile, &testVariable) - err := validateAndReplaceForVolumeComponent(testVariable, &testVolumeComponent) + var err error + if reflect.DeepEqual(testVolumeComponent, v1alpha2.VolumeComponent{}) { + err = validateAndReplaceForVolumeComponent(testVariable, nil) + } else { + err = validateAndReplaceForVolumeComponent(testVariable, &testVolumeComponent) + } _, ok := err.(*InvalidKeysError) if tt.wantErr && !ok { t.Errorf("Expected InvalidKeysError error from test but got %+v", err) diff --git a/pkg/validation/variables/variables_project.go b/pkg/validation/variables/variables_project.go index e257ffe0e..15afe4616 100644 --- a/pkg/validation/variables/variables_project.go +++ b/pkg/validation/variables/variables_project.go @@ -72,22 +72,23 @@ func ValidateAndReplaceForStarterProjects(variables map[string]string, starterPr // validateandReplaceForProjectSource validates a project source location for global variable references and replaces them with the variable value func validateandReplaceForProjectSource(variables map[string]string, projectSource *v1alpha2.ProjectSource) error { - var err error + if projectSource == nil { + return nil + } + var err error invalidKeys := make(map[string]bool) - if projectSource != nil { - switch { - case projectSource.Zip != nil: - if projectSource.Zip.Location, err = validateAndReplaceDataWithVariable(projectSource.Zip.Location, variables); err != nil { - checkForInvalidError(invalidKeys, err) - } - case projectSource.Git != nil: - gitProject := &projectSource.Git.GitLikeProjectSource - - if err = validateAndReplaceForGitProjectSource(variables, gitProject); err != nil { - checkForInvalidError(invalidKeys, err) - } + switch { + case projectSource.Zip != nil: + if projectSource.Zip.Location, err = validateAndReplaceDataWithVariable(projectSource.Zip.Location, variables); err != nil { + checkForInvalidError(invalidKeys, err) + } + case projectSource.Git != nil: + gitProject := &projectSource.Git.GitLikeProjectSource + + if err = validateAndReplaceForGitProjectSource(variables, gitProject); err != nil { + checkForInvalidError(invalidKeys, err) } } @@ -97,38 +98,39 @@ func validateandReplaceForProjectSource(variables map[string]string, projectSour // validateAndReplaceForGitProjectSource validates a project git src for global variable references and replaces them with the variable value func validateAndReplaceForGitProjectSource(variables map[string]string, gitProject *v1alpha2.GitLikeProjectSource) error { - var err error + if gitProject == nil { + return nil + } + var err error invalidKeys := make(map[string]bool) - if gitProject != nil { - if gitProject.CheckoutFrom != nil { - // validate git checkout revision - if gitProject.CheckoutFrom.Revision, err = validateAndReplaceDataWithVariable(gitProject.CheckoutFrom.Revision, variables); err != nil { - checkForInvalidError(invalidKeys, err) - } - - // // validate git checkout remote - if gitProject.CheckoutFrom.Remote, err = validateAndReplaceDataWithVariable(gitProject.CheckoutFrom.Remote, variables); err != nil { - checkForInvalidError(invalidKeys, err) - } + if gitProject.CheckoutFrom != nil { + // validate git checkout revision + if gitProject.CheckoutFrom.Revision, err = validateAndReplaceDataWithVariable(gitProject.CheckoutFrom.Revision, variables); err != nil { + checkForInvalidError(invalidKeys, err) } - // validate git remotes - for k := range gitProject.Remotes { - // validate remote map value - if gitProject.Remotes[k], err = validateAndReplaceDataWithVariable(gitProject.Remotes[k], variables); err != nil { - checkForInvalidError(invalidKeys, err) - } - - // validate remote map key - var updatedKey string - if updatedKey, err = validateAndReplaceDataWithVariable(k, variables); err != nil { - checkForInvalidError(invalidKeys, err) - } else if updatedKey != k { - gitProject.Remotes[updatedKey] = gitProject.Remotes[k] - delete(gitProject.Remotes, k) - } + // // validate git checkout remote + if gitProject.CheckoutFrom.Remote, err = validateAndReplaceDataWithVariable(gitProject.CheckoutFrom.Remote, variables); err != nil { + checkForInvalidError(invalidKeys, err) + } + } + + // validate git remotes + for k := range gitProject.Remotes { + // validate remote map value + if gitProject.Remotes[k], err = validateAndReplaceDataWithVariable(gitProject.Remotes[k], variables); err != nil { + checkForInvalidError(invalidKeys, err) + } + + // validate remote map key + var updatedKey string + if updatedKey, err = validateAndReplaceDataWithVariable(k, variables); err != nil { + checkForInvalidError(invalidKeys, err) + } else if updatedKey != k { + gitProject.Remotes[updatedKey] = gitProject.Remotes[k] + delete(gitProject.Remotes, k) } } diff --git a/pkg/validation/variables/variables_project_test.go b/pkg/validation/variables/variables_project_test.go index ca932fa57..a1d99a9e4 100644 --- a/pkg/validation/variables/variables_project_test.go +++ b/pkg/validation/variables/variables_project_test.go @@ -1,6 +1,7 @@ package variables import ( + "reflect" "testing" "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" @@ -125,6 +126,13 @@ func TestValidateAndReplaceProjectSrc(t *testing.T) { variableFile: "test-fixtures/variables/variables-notreferenced.yaml", wantErr: true, }, + { + name: "Not a project source", + testFile: "test-fixtures/components/volume.yaml", + outputFile: "test-fixtures/components/volume.yaml", + variableFile: "test-fixtures/variables/variables-notreferenced.yaml", + wantErr: false, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -134,7 +142,12 @@ func TestValidateAndReplaceProjectSrc(t *testing.T) { testVariable := make(map[string]string) readFileToStruct(t, tt.variableFile, &testVariable) - err := validateandReplaceForProjectSource(testVariable, &testProjectSrc) + var err error + if reflect.DeepEqual(testProjectSrc, v1alpha2.ProjectSource{}) { + err = validateandReplaceForProjectSource(testVariable, nil) + } else { + err = validateandReplaceForProjectSource(testVariable, &testProjectSrc) + } _, ok := err.(*InvalidKeysError) if tt.wantErr && !ok { t.Errorf("Expected InvalidKeysError error from test but got %+v", err) @@ -148,3 +161,55 @@ func TestValidateAndReplaceProjectSrc(t *testing.T) { }) } } + +func TestValidateAndReplaceGitProjectSrc(t *testing.T) { + + tests := []struct { + name string + testFile string + outputFile string + variableFile string + wantErr bool + }{ + { + name: "Good Git Substitution", + testFile: "test-fixtures/projects/git.yaml", + outputFile: "test-fixtures/projects/git-output.yaml", + variableFile: "test-fixtures/variables/variables-referenced.yaml", + wantErr: false, + }, + { + name: "Not a git roject source", + testFile: "test-fixtures/projects/zip.yaml", + outputFile: "test-fixtures/projects/zip.yaml", + variableFile: "test-fixtures/variables/variables-notreferenced.yaml", + wantErr: false, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + testProjectGitSrc := v1alpha2.GitLikeProjectSource{} + readFileToStruct(t, tt.testFile, &testProjectGitSrc) + + testVariable := make(map[string]string) + readFileToStruct(t, tt.variableFile, &testVariable) + + var err error + if reflect.DeepEqual(testProjectGitSrc, v1alpha2.GitLikeProjectSource{}) { + err = validateAndReplaceForGitProjectSource(testVariable, nil) + } else { + err = validateAndReplaceForGitProjectSource(testVariable, &testProjectGitSrc) + } + _, ok := err.(*InvalidKeysError) + if tt.wantErr && !ok { + t.Errorf("Expected InvalidKeysError error from test but got %+v", err) + } else if !tt.wantErr && err != nil { + t.Errorf("Got unexpected error: %s", err) + } else { + expectedProjectSrc := v1alpha2.GitLikeProjectSource{} + readFileToStruct(t, tt.outputFile, &expectedProjectSrc) + assert.Equal(t, expectedProjectSrc, testProjectGitSrc, "The two values should be the same.") + } + }) + } +}