Skip to content

Commit da9c62d

Browse files
committed
Remove taskref/pipelineref deprecated bundle field
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]>
1 parent ee712cb commit da9c62d

29 files changed

+970
-1684
lines changed

docs/deprecations.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ The following features are deprecated but have not yet been removed.
2323
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------|-------------------------------------|
2424
| [Several fields of Task.Step are deprecated](https://github.com/tektoncd/pipeline/issues/4737) | v0.36.0 | Beta | Feb 25, 2023 |
2525
| [ClusterTask is deprecated](https://github.com/tektoncd/pipeline/issues/4476) | v0.41.0 | Beta | July 13, 2023 |
26-
| [`pipelineRef.bundle` and `taskRef.bundle` are deprecated](https://github.com/tektoncd/pipeline/issues/5514) | v0.41.0 | Alpha | July 13, 2023 |
2726
| [The `config-trusted-resources` configMap is deprecated](https://github.com/tektoncd/pipeline/issues/5852) | v0.45.0 | Alpha | v0.46.0 |
2827
| [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 |
2928
| [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 |
@@ -66,4 +65,4 @@ See [TEP-0074](https://github.com/tektoncd/community/blob/main/teps/0074-depreca
6665

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

69-
- [TaskRun.Status.ResourcesResult is deprecated and tombstoned #6301](https://github.com/tektoncd/pipeline/issues/6325)
68+
- [TaskRun.Status.ResourcesResult is deprecated and tombstoned #6301](https://github.com/tektoncd/pipeline/issues/6325)

docs/migrating-v1beta1-to-v1.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ In Tekton `v1`, the following fields have been changed:
5050
`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)
5151

5252
## Replacing `taskRef.bundle` and `pipelineRef.bundle` with Bundle Resolver <a id='replacing-taskRef.bundle-and-pipelineRef.bundle-with-bundle-resolver'> </a>
53+
54+
**Note: `taskRef.bundle` and `pipelineRef.bundle` are now removed from `v1beta1`. This is kept for "history" purposes**.
55+
5356
Bundle resolver in remote resolution should be used instead of `taskRun.spec.taskRef.bundle` and `pipelineRun.spec.pipelineRef.bundle`.
5457

5558
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.

docs/pipeline-api.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10746,7 +10746,8 @@ string
1074610746
<td>
1074710747
<em>(Optional)</em>
1074810748
<p>Bundle url reference to a Tekton Bundle.</p>
10749-
<p>Deprecated: Please use ResolverRef with the bundles resolver instead.</p>
10749+
<p>Deprecated: Please use ResolverRef with the bundles resolver instead.
10750+
The field is staying there for go client backward compatibility, but is not used/allowed anymore.</p>
1075010751
</td>
1075110752
</tr>
1075210753
<tr>
@@ -14298,7 +14299,8 @@ string
1429814299
<td>
1429914300
<em>(Optional)</em>
1430014301
<p>Bundle url reference to a Tekton Bundle.</p>
14301-
<p>Deprecated: Please use ResolverRef with the bundles resolver instead.</p>
14302+
<p>Deprecated: Please use ResolverRef with the bundles resolver instead.
14303+
The field is staying there for go client backward compatibility, but is not used/allowed anymore.</p>
1430214304
</td>
1430314305
</tr>
1430414306
<tr>

docs/pipelineruns.md

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,6 @@ A `Tekton Bundle` is an OCI artifact that contains Tekton resources like `Tasks`
158158

159159
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).
160160

161-
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.
162-
163-
{{< tabs >}}
164-
{{% tab "v1 & v1beta1" %}}
165161
```yaml
166162
spec:
167163
pipelineRef:
@@ -174,17 +170,6 @@ spec:
174170
- name: kind
175171
value: Pipeline
176172
```
177-
{{% /tab %}}
178-
179-
{{% tab "v1beta1" %}}
180-
```yaml
181-
spec:
182-
pipelineRef:
183-
name: mypipeline
184-
bundle: docker.io/myrepo/mycatalog:v1.0
185-
```
186-
{{% /tab %}}
187-
{{< /tabs >}}
188173

189174
The syntax and caveats are similar to using `Tekton Bundles` for `Task` references
190175
in [Pipelines](pipelines.md#tekton-bundles) or [TaskRuns](taskruns.md#tekton-bundles).

docs/pipelines.md

Lines changed: 8 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -585,45 +585,24 @@ There is currently a hard limit of 20 objects in a bundle.
585585

586586
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).
587587

588-
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.
589-
590-
591-
{{< tabs >}}
592-
{{% tab "v1 & v1beta1" %}}
593-
```yaml
594-
spec:
595-
taskRef:
596-
resolver: bundles
597-
params:
598-
- name: bundle
599-
value: docker.io/myrepo/mycatalog
600-
- name: name
601-
value: echo-task
602-
- name: kind
603-
value: Task
604-
```
605-
{{% /tab %}}
606-
607-
{{% tab "v1beta1" %}}
608588
```yaml
609589
spec:
610590
tasks:
611591
- name: hello-world
612592
taskRef:
613-
name: echo-task
614-
bundle: docker.com/myrepo/mycatalog
593+
resolver: bundles
594+
params:
595+
- name: bundle
596+
value: docker.io/myrepo/mycatalog
597+
- name: name
598+
value: echo-task
599+
- name: kind
600+
value: Task
615601
```
616-
{{% /tab %}}
617-
{{< /tabs >}}
618-
619-
Here, the `bundle` field is the full reference url to the artifact. The name is the
620-
`metadata.name` field of the `Task`.
621602

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

625-
{{< tabs >}}
626-
{{% tab "v1 & v1beta1" %}}
627606
```yaml
628607
spec:
629608
taskRef:
@@ -636,24 +615,9 @@ spec:
636615
- name: kind
637616
value: Task
638617
```
639-
{{% /tab %}}
640-
641-
{{% tab "v1beta1" %}}
642-
```yaml
643-
spec:
644-
tasks:
645-
- name: hello-world
646-
taskRef:
647-
name: echo-task
648-
bundle: docker.com/myrepo/mycatalog:v1.0.1
649-
```
650-
{{% /tab %}}
651-
{{< /tabs >}}
652618

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

655-
{{< tabs >}}
656-
{{% tab "v1 & v1beta1" %}}
657621
```yaml
658622
spec:
659623
taskRef:
@@ -666,19 +630,6 @@ spec:
666630
- name: kind
667631
value: Task
668632
```
669-
{{% /tab %}}
670-
671-
{{% tab "v1beta1" %}}
672-
```yaml
673-
spec:
674-
tasks:
675-
- name: hello-world
676-
taskRef:
677-
name: echo-task
678-
bundle: docker.io/myrepo/mycatalog@sha256:abc123
679-
```
680-
{{% /tab %}}
681-
{{< /tabs >}}
682633

683634
Any of the above options will fetch the image using the `ImagePullSecrets` attached to the
684635
`ServiceAccount` specified in the `PipelineRun`.

docs/taskruns.md

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,6 @@ A `Tekton Bundle` is an OCI artifact that contains Tekton resources like `Tasks`
120120

121121
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).
122122

123-
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.
124-
125-
{{< tabs >}}
126-
{{% tab "v1 & v1beta1" %}}
127123
```yaml
128124
spec:
129125
taskRef:
@@ -136,25 +132,9 @@ spec:
136132
- name: kind
137133
value: Task
138134
```
139-
{{% /tab %}}
140-
141-
{{% tab "v1beta1" %}}
142-
```yaml
143-
spec:
144-
taskRef:
145-
name: echo-task
146-
bundle: docker.io/myrepo/mycatalog
147-
```
148-
{{% /tab %}}
149-
{{< /tabs >}}
150-
151-
Here, the `bundle` field is the full reference url to the artifact. The name is the
152-
`metadata.name` field of the `Task`.
153135

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

156-
{{< tabs >}}
157-
{{% tab "v1 & v1beta1" %}}
158138
```yaml
159139
spec:
160140
taskRef:
@@ -167,22 +147,9 @@ spec:
167147
- name: kind
168148
value: Task
169149
```
170-
{{% /tab %}}
171-
172-
{{% tab "v1beta1" %}}
173-
```yaml
174-
spec:
175-
taskRef:
176-
name: echo-task
177-
bundle: docker.io/myrepo/mycatalog:v1.0.1
178-
```
179-
{{% /tab %}}
180-
{{< /tabs >}}
181150

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

184-
{{< tabs >}}
185-
{{% tab "v1 & v1beta1" %}}
186153
```yaml
187154
spec:
188155
taskRef:
@@ -195,17 +162,6 @@ spec:
195162
- name: kind
196163
value: Task
197164
```
198-
{{% /tab %}}
199-
200-
{{% tab "v1beta1" %}}
201-
```yaml
202-
spec:
203-
taskRef:
204-
name: echo-task
205-
bundle: docker.io/myrepo/mycatalog@sha256:abc123
206-
```
207-
{{% /tab %}}
208-
{{< /tabs >}}
209165

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

examples/v1beta1/taskruns/no-ci/tekton-bundles.yaml

Lines changed: 0 additions & 9 deletions
This file was deleted.

pkg/apis/config/feature_flags.go

Lines changed: 22 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -112,16 +112,16 @@ const (
112112
runningInEnvWithInjectedSidecarsKey = "running-in-environment-with-injected-sidecars"
113113
awaitSidecarReadinessKey = "await-sidecar-readiness"
114114
requireGitSSHSecretKnownHostsKey = "require-git-ssh-secret-known-hosts" //nolint:gosec
115-
enableTektonOCIBundles = "enable-tekton-oci-bundles"
116-
enableAPIFields = "enable-api-fields"
117-
sendCloudEventsForRuns = "send-cloudevents-for-runs"
118-
enforceNonfalsifiability = "enforce-nonfalsifiability"
119-
verificationNoMatchPolicy = "trusted-resources-verification-no-match-policy"
120-
enableProvenanceInStatus = "enable-provenance-in-status"
121-
resultExtractionMethod = "results-from"
122-
maxResultSize = "max-result-size"
123-
setSecurityContextKey = "set-security-context"
124-
coscheduleKey = "coschedule"
115+
// enableTektonOCIBundles = "enable-tekton-oci-bundles"
116+
enableAPIFields = "enable-api-fields"
117+
sendCloudEventsForRuns = "send-cloudevents-for-runs"
118+
enforceNonfalsifiability = "enforce-nonfalsifiability"
119+
verificationNoMatchPolicy = "trusted-resources-verification-no-match-policy"
120+
enableProvenanceInStatus = "enable-provenance-in-status"
121+
resultExtractionMethod = "results-from"
122+
maxResultSize = "max-result-size"
123+
setSecurityContextKey = "set-security-context"
124+
coscheduleKey = "coschedule"
125125
)
126126

127127
// DefaultFeatureFlags holds all the default configurations for the feature flags configmap.
@@ -146,13 +146,15 @@ var (
146146
DefaultEnableStepActions = PerFeatureFlag{
147147
Name: EnableStepActions,
148148
Stability: AlphaAPIFields,
149-
Enabled: DefaultAlphaFeatureEnabled}
149+
Enabled: DefaultAlphaFeatureEnabled,
150+
}
150151

151152
// DefaultEnableArtifacts is the default PerFeatureFlag value for EnableStepActions
152153
DefaultEnableArtifacts = PerFeatureFlag{
153154
Name: EnableStepActions,
154155
Stability: AlphaAPIFields,
155-
Enabled: DefaultAlphaFeatureEnabled}
156+
Enabled: DefaultAlphaFeatureEnabled,
157+
}
156158

157159
// DefaultEnableParamEnum is the default PerFeatureFlag value for EnableParamEnum
158160
DefaultEnableParamEnum = PerFeatureFlag{
@@ -171,13 +173,13 @@ type FeatureFlags struct {
171173
DisableCredsInit bool
172174
RunningInEnvWithInjectedSidecars bool
173175
RequireGitSSHSecretKnownHosts bool
174-
EnableTektonOCIBundles bool
175-
ScopeWhenExpressionsToTask bool
176-
EnableAPIFields string
177-
SendCloudEventsForRuns bool
178-
AwaitSidecarReadiness bool
179-
EnforceNonfalsifiability string
180-
EnableKeepPodOnCancel bool
176+
// EnableTektonOCIBundles bool // Deprecated: this is now ignored
177+
ScopeWhenExpressionsToTask bool
178+
EnableAPIFields string
179+
SendCloudEventsForRuns bool
180+
AwaitSidecarReadiness bool
181+
EnforceNonfalsifiability string
182+
EnableKeepPodOnCancel bool
181183
// VerificationNoMatchPolicy is the feature flag for "trusted-resources-verification-no-match-policy"
182184
// VerificationNoMatchPolicy can be set to "ignore", "warn" and "fail" values.
183185
// ignore: skip trusted resources verification when no matching verification policies found
@@ -291,19 +293,6 @@ func NewFeatureFlagsFromMap(cfgMap map[string]string) (*FeatureFlags, error) {
291293
if err := setPerFeatureFlag(EnableArtifacts, DefaultEnableArtifacts, &tc.EnableArtifacts); err != nil {
292294
return nil, err
293295
}
294-
// Given that they are alpha features, Tekton Bundles and Custom Tasks should be switched on if
295-
// enable-api-fields is "alpha". If enable-api-fields is not "alpha" then fall back to the value of
296-
// each feature's individual flag.
297-
//
298-
// Note: the user cannot enable "alpha" while disabling bundles or custom tasks - that would
299-
// defeat the purpose of having a single shared gate for all alpha features.
300-
if tc.EnableAPIFields == AlphaAPIFields {
301-
tc.EnableTektonOCIBundles = true
302-
} else {
303-
if err := setFeature(enableTektonOCIBundles, DefaultEnableTektonOciBundles, &tc.EnableTektonOCIBundles); err != nil {
304-
return nil, err
305-
}
306-
}
307296
return &tc, nil
308297
}
309298

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

0 commit comments

Comments
 (0)