Skip to content

Commit

Permalink
Remove taskref/pipelineref deprecated bundle field
Browse files Browse the repository at this point in the history
This field has been deprecated for about a year and half. So this is
"removing" this field from v1beta1 (it's not present in v1 already).

The field is kept in the go code to provide a backward compatibility
for client code (like chains, …) but it will be disallowed by the
webhook. It will also be completely ignore by the rest of the code.

Signed-off-by: Vincent Demeester <[email protected]>
  • Loading branch information
vdemeester committed Apr 3, 2024
1 parent ee712cb commit da9c62d
Show file tree
Hide file tree
Showing 29 changed files with 970 additions and 1,684 deletions.
3 changes: 1 addition & 2 deletions docs/deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ The following features are deprecated but have not yet been removed.
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------|-------------------------------------|
| [Several fields of Task.Step are deprecated](https://github.com/tektoncd/pipeline/issues/4737) | v0.36.0 | Beta | Feb 25, 2023 |
| [ClusterTask is deprecated](https://github.com/tektoncd/pipeline/issues/4476) | v0.41.0 | Beta | July 13, 2023 |
| [`pipelineRef.bundle` and `taskRef.bundle` are deprecated](https://github.com/tektoncd/pipeline/issues/5514) | v0.41.0 | Alpha | July 13, 2023 |
| [The `config-trusted-resources` configMap is deprecated](https://github.com/tektoncd/pipeline/issues/5852) | v0.45.0 | Alpha | v0.46.0 |
| [The `default-cloud-events-sink` setting in the `config-defaults` configMap is deprecated](https://github.com/tektoncd/pipeline/pull/6883) in favour of the new `config-events` configMap. | v0.50.0 | N/A | v0.59.0 |
| [v1beta1 Tasks, TaskRuns, Pipelines, and PipelineRuns are deprecated in favor of v1](https://github.com/tektoncd/pipeline/issues/5541) | v0.50.0 | Beta | v0.62.0 |
Expand Down Expand Up @@ -66,4 +65,4 @@ See [TEP-0074](https://github.com/tektoncd/community/blob/main/teps/0074-depreca

- The generic pipelineResources functions including inputs and outputs resources and the `from` type

- [TaskRun.Status.ResourcesResult is deprecated and tombstoned #6301](https://github.com/tektoncd/pipeline/issues/6325)
- [TaskRun.Status.ResourcesResult is deprecated and tombstoned #6301](https://github.com/tektoncd/pipeline/issues/6325)
3 changes: 3 additions & 0 deletions docs/migrating-v1beta1-to-v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ In Tekton `v1`, the following fields have been changed:
`PipelineResources` and the `resources` fields of Task, TaskRun, Pipeline and PipelineRun have been removed. Please use `Tasks` instead. For more information, see [Replacing PipelineResources](https://github.com/tektoncd/pipeline/blob/main/docs/pipelineresources.md)

## Replacing `taskRef.bundle` and `pipelineRef.bundle` with Bundle Resolver <a id='replacing-taskRef.bundle-and-pipelineRef.bundle-with-bundle-resolver'> </a>

**Note: `taskRef.bundle` and `pipelineRef.bundle` are now removed from `v1beta1`. This is kept for "history" purposes**.

Bundle resolver in remote resolution should be used instead of `taskRun.spec.taskRef.bundle` and `pipelineRun.spec.pipelineRef.bundle`.

The [`enable-bundles-resolver`](https://github.com/tektoncd/pipeline/blob/main/docs/install.md#customizing-the-pipelines-controller-behavior) feature flag must be enabled to use this feature.
Expand Down
6 changes: 4 additions & 2 deletions docs/pipeline-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -10746,7 +10746,8 @@ string
<td>
<em>(Optional)</em>
<p>Bundle url reference to a Tekton Bundle.</p>
<p>Deprecated: Please use ResolverRef with the bundles resolver instead.</p>
<p>Deprecated: Please use ResolverRef with the bundles resolver instead.
The field is staying there for go client backward compatibility, but is not used/allowed anymore.</p>
</td>
</tr>
<tr>
Expand Down Expand Up @@ -14298,7 +14299,8 @@ string
<td>
<em>(Optional)</em>
<p>Bundle url reference to a Tekton Bundle.</p>
<p>Deprecated: Please use ResolverRef with the bundles resolver instead.</p>
<p>Deprecated: Please use ResolverRef with the bundles resolver instead.
The field is staying there for go client backward compatibility, but is not used/allowed anymore.</p>
</td>
</tr>
<tr>
Expand Down
15 changes: 0 additions & 15 deletions docs/pipelineruns.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,6 @@ A `Tekton Bundle` is an OCI artifact that contains Tekton resources like `Tasks`

You can reference a `Tekton bundle` in a `TaskRef` in both `v1` and `v1beta1` using [remote resolution](./bundle-resolver.md#pipeline-resolution). The example syntax shown below for `v1` uses remote resolution and requires enabling [beta features](./additional-configs.md#beta-features).

In `v1beta1`, you can also reference a `Tekton bundle` using OCI bundle syntax, which has been deprecated in favor of remote resolution. The example shown below for `v1beta1` uses OCI bundle syntax, and requires enabling `enable-tekton-oci-bundles: "true"` feature flag.
{{< tabs >}}
{{% tab "v1 & v1beta1" %}}
```yaml
spec:
pipelineRef:
Expand All @@ -174,17 +170,6 @@ spec:
- name: kind
value: Pipeline
```
{{% /tab %}}
{{% tab "v1beta1" %}}
```yaml
spec:
pipelineRef:
name: mypipeline
bundle: docker.io/myrepo/mycatalog:v1.0
```
{{% /tab %}}
{{< /tabs >}}

The syntax and caveats are similar to using `Tekton Bundles` for `Task` references
in [Pipelines](pipelines.md#tekton-bundles) or [TaskRuns](taskruns.md#tekton-bundles).
Expand Down
65 changes: 8 additions & 57 deletions docs/pipelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -585,45 +585,24 @@ There is currently a hard limit of 20 objects in a bundle.

You can reference a `Tekton bundle` in a `TaskRef` in both `v1` and `v1beta1` using [remote resolution](./bundle-resolver.md#pipeline-resolution). The example syntax shown below for `v1` uses remote resolution and requires enabling [beta features](./additional-configs.md#beta-features).

In `v1beta1`, you can also reference a `Tekton bundle` using OCI bundle syntax, which has been deprecated in favor of remote resolution. The example shown below for `v1beta1` uses OCI bundle syntax, and requires enabling `enable-tekton-oci-bundles: "true"` feature flag.
{{< tabs >}}
{{% tab "v1 & v1beta1" %}}
```yaml
spec:
taskRef:
resolver: bundles
params:
- name: bundle
value: docker.io/myrepo/mycatalog
- name: name
value: echo-task
- name: kind
value: Task
```
{{% /tab %}}
{{% tab "v1beta1" %}}
```yaml
spec:
tasks:
- name: hello-world
taskRef:
name: echo-task
bundle: docker.com/myrepo/mycatalog
resolver: bundles
params:
- name: bundle
value: docker.io/myrepo/mycatalog
- name: name
value: echo-task
- name: kind
value: Task
```
{{% /tab %}}
{{< /tabs >}}
Here, the `bundle` field is the full reference url to the artifact. The name is the
`metadata.name` field of the `Task`.

You may also specify a `tag` as you would with a Docker image which will give you a fixed,
repeatable reference to a `Task`.

{{< tabs >}}
{{% tab "v1 & v1beta1" %}}
```yaml
spec:
taskRef:
Expand All @@ -636,24 +615,9 @@ spec:
- name: kind
value: Task
```
{{% /tab %}}

{{% tab "v1beta1" %}}
```yaml
spec:
tasks:
- name: hello-world
taskRef:
name: echo-task
bundle: docker.com/myrepo/mycatalog:v1.0.1
```
{{% /tab %}}
{{< /tabs >}}

You may also specify a fixed digest instead of a tag.

{{< tabs >}}
{{% tab "v1 & v1beta1" %}}
```yaml
spec:
taskRef:
Expand All @@ -666,19 +630,6 @@ spec:
- name: kind
value: Task
```
{{% /tab %}}

{{% tab "v1beta1" %}}
```yaml
spec:
tasks:
- name: hello-world
taskRef:
name: echo-task
bundle: docker.io/myrepo/mycatalog@sha256:abc123
```
{{% /tab %}}
{{< /tabs >}}

Any of the above options will fetch the image using the `ImagePullSecrets` attached to the
`ServiceAccount` specified in the `PipelineRun`.
Expand Down
44 changes: 0 additions & 44 deletions docs/taskruns.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,6 @@ A `Tekton Bundle` is an OCI artifact that contains Tekton resources like `Tasks`

You can reference a `Tekton bundle` in a `TaskRef` in both `v1` and `v1beta1` using [remote resolution](./bundle-resolver.md#pipeline-resolution). The example syntax shown below for `v1` uses remote resolution and requires enabling [beta features](./additional-configs.md#beta-features).

In `v1beta1`, you can also reference a `Tekton bundle` using OCI bundle syntax, which has been deprecated in favor of remote resolution. The example shown below for `v1beta1` uses OCI bundle syntax, and requires enabling `enable-tekton-oci-bundles: "true"` feature flag.
{{< tabs >}}
{{% tab "v1 & v1beta1" %}}
```yaml
spec:
taskRef:
Expand All @@ -136,25 +132,9 @@ spec:
- name: kind
value: Task
```
{{% /tab %}}
{{% tab "v1beta1" %}}
```yaml
spec:
taskRef:
name: echo-task
bundle: docker.io/myrepo/mycatalog
```
{{% /tab %}}
{{< /tabs >}}
Here, the `bundle` field is the full reference url to the artifact. The name is the
`metadata.name` field of the `Task`.

You may also specify a `tag` as you would with a Docker image which will give you a repeatable reference to a `Task`.

{{< tabs >}}
{{% tab "v1 & v1beta1" %}}
```yaml
spec:
taskRef:
Expand All @@ -167,22 +147,9 @@ spec:
- name: kind
value: Task
```
{{% /tab %}}

{{% tab "v1beta1" %}}
```yaml
spec:
taskRef:
name: echo-task
bundle: docker.io/myrepo/mycatalog:v1.0.1
```
{{% /tab %}}
{{< /tabs >}}

You may also specify a fixed digest instead of a tag which ensures the referenced task is constant.

{{< tabs >}}
{{% tab "v1 & v1beta1" %}}
```yaml
spec:
taskRef:
Expand All @@ -195,17 +162,6 @@ spec:
- name: kind
value: Task
```
{{% /tab %}}

{{% tab "v1beta1" %}}
```yaml
spec:
taskRef:
name: echo-task
bundle: docker.io/myrepo/mycatalog@sha256:abc123
```
{{% /tab %}}
{{< /tabs >}}

A working example can be found [here](../examples/v1beta1/taskruns/no-ci/tekton-bundles.yaml).

Expand Down
9 changes: 0 additions & 9 deletions examples/v1beta1/taskruns/no-ci/tekton-bundles.yaml

This file was deleted.

55 changes: 22 additions & 33 deletions pkg/apis/config/feature_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,16 @@ const (
runningInEnvWithInjectedSidecarsKey = "running-in-environment-with-injected-sidecars"
awaitSidecarReadinessKey = "await-sidecar-readiness"
requireGitSSHSecretKnownHostsKey = "require-git-ssh-secret-known-hosts" //nolint:gosec
enableTektonOCIBundles = "enable-tekton-oci-bundles"
enableAPIFields = "enable-api-fields"
sendCloudEventsForRuns = "send-cloudevents-for-runs"
enforceNonfalsifiability = "enforce-nonfalsifiability"
verificationNoMatchPolicy = "trusted-resources-verification-no-match-policy"
enableProvenanceInStatus = "enable-provenance-in-status"
resultExtractionMethod = "results-from"
maxResultSize = "max-result-size"
setSecurityContextKey = "set-security-context"
coscheduleKey = "coschedule"
// enableTektonOCIBundles = "enable-tekton-oci-bundles"
enableAPIFields = "enable-api-fields"
sendCloudEventsForRuns = "send-cloudevents-for-runs"
enforceNonfalsifiability = "enforce-nonfalsifiability"
verificationNoMatchPolicy = "trusted-resources-verification-no-match-policy"
enableProvenanceInStatus = "enable-provenance-in-status"
resultExtractionMethod = "results-from"
maxResultSize = "max-result-size"
setSecurityContextKey = "set-security-context"
coscheduleKey = "coschedule"
)

// DefaultFeatureFlags holds all the default configurations for the feature flags configmap.
Expand All @@ -146,13 +146,15 @@ var (
DefaultEnableStepActions = PerFeatureFlag{
Name: EnableStepActions,
Stability: AlphaAPIFields,
Enabled: DefaultAlphaFeatureEnabled}
Enabled: DefaultAlphaFeatureEnabled,
}

// DefaultEnableArtifacts is the default PerFeatureFlag value for EnableStepActions
DefaultEnableArtifacts = PerFeatureFlag{
Name: EnableStepActions,
Stability: AlphaAPIFields,
Enabled: DefaultAlphaFeatureEnabled}
Enabled: DefaultAlphaFeatureEnabled,
}

// DefaultEnableParamEnum is the default PerFeatureFlag value for EnableParamEnum
DefaultEnableParamEnum = PerFeatureFlag{
Expand All @@ -171,13 +173,13 @@ type FeatureFlags struct {
DisableCredsInit bool
RunningInEnvWithInjectedSidecars bool
RequireGitSSHSecretKnownHosts bool
EnableTektonOCIBundles bool
ScopeWhenExpressionsToTask bool
EnableAPIFields string
SendCloudEventsForRuns bool
AwaitSidecarReadiness bool
EnforceNonfalsifiability string
EnableKeepPodOnCancel bool
// EnableTektonOCIBundles bool // Deprecated: this is now ignored
ScopeWhenExpressionsToTask bool
EnableAPIFields string
SendCloudEventsForRuns bool
AwaitSidecarReadiness bool
EnforceNonfalsifiability string
EnableKeepPodOnCancel bool
// VerificationNoMatchPolicy is the feature flag for "trusted-resources-verification-no-match-policy"
// VerificationNoMatchPolicy can be set to "ignore", "warn" and "fail" values.
// ignore: skip trusted resources verification when no matching verification policies found
Expand Down Expand Up @@ -291,19 +293,6 @@ func NewFeatureFlagsFromMap(cfgMap map[string]string) (*FeatureFlags, error) {
if err := setPerFeatureFlag(EnableArtifacts, DefaultEnableArtifacts, &tc.EnableArtifacts); err != nil {
return nil, err
}
// Given that they are alpha features, Tekton Bundles and Custom Tasks should be switched on if
// enable-api-fields is "alpha". If enable-api-fields is not "alpha" then fall back to the value of
// each feature's individual flag.
//
// Note: the user cannot enable "alpha" while disabling bundles or custom tasks - that would
// defeat the purpose of having a single shared gate for all alpha features.
if tc.EnableAPIFields == AlphaAPIFields {
tc.EnableTektonOCIBundles = true
} else {
if err := setFeature(enableTektonOCIBundles, DefaultEnableTektonOciBundles, &tc.EnableTektonOCIBundles); err != nil {
return nil, err
}
}
return &tc, nil
}

Expand Down Expand Up @@ -349,7 +338,7 @@ func setCoschedule(cfgMap map[string]string, defaultValue string, disabledAffini
// setEnforceNonFalsifiability sets the "enforce-nonfalsifiability" flag based on the content of a given map.
// If the feature gate is invalid, then an error is returned.
func setEnforceNonFalsifiability(cfgMap map[string]string, feature *string) error {
var value = DefaultEnforceNonfalsifiability
value := DefaultEnforceNonfalsifiability
if cfg, ok := cfgMap[enforceNonfalsifiability]; ok {
value = strings.ToLower(cfg)
}
Expand Down
Loading

0 comments on commit da9c62d

Please sign in to comment.