Skip to content

Commit

Permalink
Deprecate spec.sources
Browse files Browse the repository at this point in the history
This deprecates the `spec.sources` field, thereby deprecating the
"remote artifact" download feature. Per discussion in the Beta API
workshop, this feature will be removed from Shipwright once the beta
API reaches stability.
  • Loading branch information
adambkaplan committed Sep 7, 2022
1 parent 64f18e8 commit 518abf7
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 8 deletions.
12 changes: 8 additions & 4 deletions deploy/crds/shipwright.io_buildruns.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -419,8 +419,10 @@ spec:
type: string
type: object
sources:
description: Sources slice of BuildSource, defining external build
artifacts complementary to VCS (`.spec.source`) data.
description: "Sources slice of BuildSource, defining external
build artifacts complementary to VCS (`.spec.source`) data.
\n NOTICE: Multiple sources in a build are deprecated. This
feature will be removed in a future release."
items:
description: BuildSource remote artifact definition, also known
as "sources". Simple "name" and "url" pairs, initially without
Expand Down Expand Up @@ -4224,8 +4226,10 @@ spec:
type: string
type: object
sources:
description: Sources slice of BuildSource, defining external build
artifacts complementary to VCS (`.spec.source`) data.
description: "Sources slice of BuildSource, defining external
build artifacts complementary to VCS (`.spec.source`) data.
\n NOTICE: Multiple sources in a build are deprecated. This
feature will be removed in a future release."
items:
description: BuildSource remote artifact definition, also known
as "sources". Simple "name" and "url" pairs, initially without
Expand Down
6 changes: 4 additions & 2 deletions deploy/crds/shipwright.io_builds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,10 @@ spec:
type: string
type: object
sources:
description: Sources slice of BuildSource, defining external build
artifacts complementary to VCS (`.spec.source`) data.
description: "Sources slice of BuildSource, defining external build
artifacts complementary to VCS (`.spec.source`) data. \n NOTICE:
Multiple sources in a build are deprecated. This feature will be
removed in a future release."
items:
description: BuildSource remote artifact definition, also known
as "sources". Simple "name" and "url" pairs, initially without
Expand Down
6 changes: 4 additions & 2 deletions docs/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ SPDX-License-Identifier: Apache-2.0
A `Build` resource allows the user to define:

- source
- sources
- sources (**this is deprecated, and will be removed in a future release**)
- strategy
- params
- builder
Expand Down Expand Up @@ -86,7 +86,7 @@ The `Build` definition supports the following fields:
- 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.sources` - [Sources](#Sources) describes a slice of artifacts that will be imported into the project context before the actual build process starts.
- `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`.
- `spec.output.annotations` - Refers to a list of `key/value` that could be used to [annotate](https://github.com/opencontainers/image-spec/blob/main/annotations.md) the output image.
Expand Down Expand Up @@ -708,6 +708,8 @@ spec:

### Sources

**Note: This feature has been deprecated, and will be removed in a future release**.

Sources represent remote artifacts, as in external entities added to the build context before the actual Build starts. Therefore, you may employ `.spec.sources` to download artifacts from external repositories.

```yaml
Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/build/v1alpha1/build_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ const LocalCopy BuildSourceType = "LocalCopy"

// HTTP defines a (HTTP) remote artifact, which will be downloaded into the build POD, right before
// the build process starts. Represents a remote dependency.
//
// NOTICE: HTTP artifact downloads are deprecated. This feature will be removed in a future release.
const HTTP BuildSourceType = "HTTP"

// BuildSource remote artifact definition, also known as "sources". Simple "name" and "url" pairs,
Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/build/v1alpha1/build_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ type BuildSpec struct {
// (`.spec.source`) data.
//
// +optional
//
// NOTICE: Multiple sources in a build are deprecated. This feature will be removed in a future release.
Sources []BuildSource `json:"sources,omitempty"`

// Trigger defines the scenarios where a new build should be triggered.
Expand Down

0 comments on commit 518abf7

Please sign in to comment.