Skip to content

Commit

Permalink
Deprecate Build Builder and Dockerfile Fields
Browse files Browse the repository at this point in the history
Deprecate the following fields in the `Build` spec object:

- `builder` - this is specific to source-to-image.
- `dockerfile` - this is specific to Dockerfile-based tools.
  • Loading branch information
adambkaplan committed Sep 7, 2022
1 parent c7ddd69 commit 5eaca8a
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 14 deletions.
26 changes: 18 additions & 8 deletions deploy/crds/shipwright.io_buildruns.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,11 @@ spec:
description: BuildSpec refers to an embedded build specification
properties:
builder:
description: Builder refers to the image containing the build
tools inside which the source code would be built.
description: "Builder refers to the image containing the build
tools inside which the source code would be built. \n NOTICE:
Builder is deprecated, and will be removed in a future release.
Build strategies which rely on \"builder\" should provide an
equivalent parameter instead."
properties:
annotations:
additionalProperties:
Expand Down Expand Up @@ -103,9 +106,11 @@ spec:
- image
type: object
dockerfile:
description: Dockerfile is the path to the Dockerfile to be used
description: "Dockerfile is the path to the Dockerfile to be used
for build strategies which bank on the Dockerfile for building
an image.
an image. \n NOTICE: Dockerfile is deprecated, and will be removed
in a future release. Build strategies which rely on \"dockerfile\"
should provide an equivalent parameter instead."
type: string
env:
description: Env contains additional environment variables that
Expand Down Expand Up @@ -3879,8 +3884,11 @@ spec:
description: BuildSpec is the Build Spec of this BuildRun.
properties:
builder:
description: Builder refers to the image containing the build
tools inside which the source code would be built.
description: "Builder refers to the image containing the build
tools inside which the source code would be built. \n NOTICE:
Builder is deprecated, and will be removed in a future release.
Build strategies which rely on \"builder\" should provide an
equivalent parameter instead."
properties:
annotations:
additionalProperties:
Expand Down Expand Up @@ -3910,9 +3918,11 @@ spec:
- image
type: object
dockerfile:
description: Dockerfile is the path to the Dockerfile to be used
description: "Dockerfile is the path to the Dockerfile to be used
for build strategies which bank on the Dockerfile for building
an image.
an image. \n NOTICE: Dockerfile is deprecated, and will be removed
in a future release. Build strategies which rely on \"dockerfile\"
should provide an equivalent parameter instead."
type: string
env:
description: Env contains additional environment variables that
Expand Down
14 changes: 10 additions & 4 deletions deploy/crds/shipwright.io_builds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,11 @@ spec:
description: BuildSpec defines the desired state of Build
properties:
builder:
description: Builder refers to the image containing the build tools
inside which the source code would be built.
description: "Builder refers to the image containing the build tools
inside which the source code would be built. \n NOTICE: Builder
is deprecated, and will be removed in a future release. Build strategies
which rely on \"builder\" should provide an equivalent parameter
instead."
properties:
annotations:
additionalProperties:
Expand Down Expand Up @@ -90,8 +93,11 @@ spec:
- image
type: object
dockerfile:
description: Dockerfile is the path to the Dockerfile to be used for
build strategies which bank on the Dockerfile for building an image.
description: "Dockerfile is the path to the Dockerfile to be used
for build strategies which bank on the Dockerfile for building an
image. \n NOTICE: Dockerfile is deprecated, and will be removed
in a future release. Build strategies which rely on \"dockerfile\"
should provide an equivalent parameter instead."
type: string
env:
description: Env contains additional environment variables that should
Expand Down
6 changes: 4 additions & 2 deletions docs/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ The `Build` definition supports the following fields:
- [`metadata`](https://kubernetes.io/docs/concepts/overview/working-with-objects/kubernetes-objects/#required-fields) - Metadata that identify the CRD instance, for example the name of the `Build`.
- `spec.source` - Refers to the location of the source code, for example a Git repository or source bundle image.
- `spec.strategy` - Refers to the `BuildStrategy` to be used, see the [examples](../samples/buildstrategy)
- `spec.builder.image` - Refers to the image containing the build tools to build the source code. (_Use this path for Dockerless strategies, this is just required for `source-to-image` buildStrategy_)
- `spec.builder.image` - Refers to the image containing the build tools to build the source code. (_Use this path for Dockerless strategies, this is just required for `source-to-image` buildStrategy_) **This field has been deprecated, and will be removed in a future release.**
- `spec.output`- Refers to the location where the generated image would be pushed.
- `spec.output.credentials.name`- Reference an existing secret to get access to the container registry.

- Optional:
- `spec.paramValues` - Refers to a name-value(s) list to specify values for `parameters` defined in the `BuildStrategy`.
- `spec.dockerfile` - Path to a Dockerfile to be used for building an image. (_Use this path for strategies that require a Dockerfile_)
- `spec.dockerfile` - Path to a Dockerfile to be used for building an image. (_Use this path for strategies that require a Dockerfile_). **This field has been deprecated, and will be removed in a future release.**
- `spec.sources` - [Sources](#Sources) describes a slice of artifacts that will be imported into the project context before the actual build process starts. **This field has been deprecated, and will be removed in a future release.**
- `spec.timeout` - Defines a custom timeout. The value needs to be parsable by [ParseDuration](https://golang.org/pkg/time/#ParseDuration), for example, `5m`. The default is ten minutes. You can overwrite the value in the `BuildRun`.
- `metadata.annotations[build.shipwright.io/build-run-deletion]` - Defines if delete all related BuildRuns when deleting the Build. The default is `false`.
Expand Down Expand Up @@ -417,6 +417,8 @@ Here, we pass three items in the `build-args` array:

### Defining the Builder or Dockerfile

**Note: Builder and Dockerfile options are deprecated, and will be removed in a future release.**

In the `Build` resource, you use the `spec.builder` or `spec.dockerfile` parameters to specify the image that contains the tools to build the final image. For example, the following Build definition specifies a `Dockerfile` image.

```yaml
Expand Down
6 changes: 6 additions & 0 deletions pkg/apis/build/v1alpha1/build_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,19 @@ type BuildSpec struct {
// Builder refers to the image containing the build tools inside which
// the source code would be built.
//
// NOTICE: Builder is deprecated, and will be removed in a future release.
// Build strategies which rely on "builder" should provide an equivalent parameter instead.
//
// +optional
Builder *Image `json:"builder,omitempty"`

// Dockerfile is the path to the Dockerfile to be used for
// build strategies which bank on the Dockerfile for building
// an image.
//
// NOTICE: Dockerfile is deprecated, and will be removed in a future release.
// Build strategies which rely on "dockerfile" should provide an equivalent parameter instead.
//
// +optional
Dockerfile *string `json:"dockerfile,omitempty"`

Expand Down

0 comments on commit 5eaca8a

Please sign in to comment.