From 8538ca3c0b1ea394586259f74157768363b31abf Mon Sep 17 00:00:00 2001 From: Tomas Kral Date: Fri, 8 Oct 2021 10:19:22 +0200 Subject: [PATCH] go mod vendor --- .../workspaces/v1alpha2/component_image.go | 38 +++++++++ .../v1alpha2/component_image_dockerfile.go | 81 +++++++++++++++++++ 2 files changed, 119 insertions(+) create mode 100644 vendor/github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2/component_image.go create mode 100644 vendor/github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2/component_image_dockerfile.go diff --git a/vendor/github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2/component_image.go b/vendor/github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2/component_image.go new file mode 100644 index 00000000000..c6e7e6b7777 --- /dev/null +++ b/vendor/github.com/devfile/api/v2/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/vendor/github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2/component_image_dockerfile.go b/vendor/github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2/component_image_dockerfile.go new file mode 100644 index 00000000000..4743825e254 --- /dev/null +++ b/vendor/github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2/component_image_dockerfile.go @@ -0,0 +1,81 @@ +package v1alpha2 + +// 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;DevfileRegistry;Git +type DockerfileSrcType string + +const ( + 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"` + DockerfileSrc `json:",inline"` + Dockerfile `json:",inline"` +} + +// +union +type DockerfileSrc struct { + // Type of Dockerfile src + // + + // +unionDiscriminator + // +optional + 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. + // +optional + Uri string `json:"uri,omitempty"` + + // Dockerfile's Devfile Registry source + // +optional + DevfileRegistry *DockerfileDevfileRegistrySource `json:"devfileRegistry,omitempty"` + + // Dockerfile's Git source + // +optional + Git *DockerfileGitProjectSource `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"` +} + +type DockerfileDevfileRegistrySource struct { + // 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. + // To ensure the Dockerfile gets resolved consistently in different environments, + // it is recommended to always specify the `devfileRegistryUrl` when `Id` is used. + // +optional + RegistryUrl string `json:"registryUrl,omitempty"` +} + +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. + // Defaults to Dockerfile. + // +optional + FileLocation string `json:"fileLocation,omitempty"` +}