Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove taskref/pipelineref deprecated bundle field #7789

Merged
merged 1 commit into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -67,4 +66,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 @@ -11138,7 +11138,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 @@ -14887,7 +14888,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.

49 changes: 19 additions & 30 deletions pkg/apis/config/feature_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,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 Down Expand Up @@ -184,13 +184,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 @@ -305,25 +305,14 @@ func NewFeatureFlagsFromMap(cfgMap map[string]string) (*FeatureFlags, error) {
if err := setPerFeatureFlag(EnableArtifacts, DefaultEnableArtifacts, &tc.EnableArtifacts); err != nil {
return nil, err
}

if err := setFeatureInlineSpec(cfgMap, DisableInlineSpec, DefaultDisableInlineSpec, &tc.DisableInlineSpec); err != nil {
return nil, err
}
if err := setPerFeatureFlag(EnableConciseResolverSyntax, DefaultEnableConciseResolverSyntax, &tc.EnableConciseResolverSyntax); 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
7 changes: 0 additions & 7 deletions pkg/apis/config/feature_flags_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ func TestNewFeatureFlagsFromConfigMap(t *testing.T) {
RequireGitSSHSecretKnownHosts: false,
DisableCredsInit: config.DefaultDisableCredsInit,
AwaitSidecarReadiness: config.DefaultAwaitSidecarReadiness,
EnableTektonOCIBundles: config.DefaultEnableTektonOciBundles,
EnableAPIFields: config.DefaultEnableAPIFields,
SendCloudEventsForRuns: config.DefaultSendCloudEventsForRuns,
VerificationNoMatchPolicy: config.DefaultNoMatchPolicyConfig,
Expand All @@ -68,7 +67,6 @@ func TestNewFeatureFlagsFromConfigMap(t *testing.T) {
RunningInEnvWithInjectedSidecars: false,
AwaitSidecarReadiness: false,
RequireGitSSHSecretKnownHosts: true,
EnableTektonOCIBundles: true,
EnableAPIFields: "alpha",
SendCloudEventsForRuns: true,
EnforceNonfalsifiability: "spire",
Expand All @@ -93,7 +91,6 @@ func TestNewFeatureFlagsFromConfigMap(t *testing.T) {
EnableAPIFields: "alpha",
// These are prescribed as true by enabling "alpha" API fields, even
// if the submitted text value is "false".
EnableTektonOCIBundles: true,
EnforceNonfalsifiability: config.DefaultEnforceNonfalsifiability,
DisableAffinityAssistant: config.DefaultDisableAffinityAssistant,
DisableCredsInit: config.DefaultDisableCredsInit,
Expand All @@ -119,7 +116,6 @@ func TestNewFeatureFlagsFromConfigMap(t *testing.T) {
{
expectedConfig: &config.FeatureFlags{
EnableAPIFields: "stable",
EnableTektonOCIBundles: true,
EnforceNonfalsifiability: config.DefaultEnforceNonfalsifiability,
DisableAffinityAssistant: config.DefaultDisableAffinityAssistant,
DisableCredsInit: config.DefaultDisableCredsInit,
Expand All @@ -141,7 +137,6 @@ func TestNewFeatureFlagsFromConfigMap(t *testing.T) {
{
expectedConfig: &config.FeatureFlags{
EnableAPIFields: "beta",
EnableTektonOCIBundles: config.DefaultEnableTektonOciBundles,
EnforceNonfalsifiability: config.DefaultEnforceNonfalsifiability,
DisableAffinityAssistant: config.DefaultDisableAffinityAssistant,
DisableCredsInit: config.DefaultDisableCredsInit,
Expand All @@ -164,7 +159,6 @@ func TestNewFeatureFlagsFromConfigMap(t *testing.T) {
expectedConfig: &config.FeatureFlags{
EnableAPIFields: config.DefaultEnableAPIFields,
EnforceNonfalsifiability: config.EnforceNonfalsifiabilityWithSpire,
EnableTektonOCIBundles: config.DefaultEnableTektonOciBundles,
VerificationNoMatchPolicy: config.DefaultNoMatchPolicyConfig,
RunningInEnvWithInjectedSidecars: config.DefaultRunningInEnvWithInjectedSidecars,
AwaitSidecarReadiness: config.DefaultAwaitSidecarReadiness,
Expand Down Expand Up @@ -220,7 +214,6 @@ func TestNewFeatureFlagsFromEmptyConfigMap(t *testing.T) {
RunningInEnvWithInjectedSidecars: config.DefaultRunningInEnvWithInjectedSidecars,
AwaitSidecarReadiness: config.DefaultAwaitSidecarReadiness,
RequireGitSSHSecretKnownHosts: config.DefaultRequireGitSSHSecretKnownHosts,
EnableTektonOCIBundles: config.DefaultEnableTektonOciBundles,
EnableAPIFields: config.DefaultEnableAPIFields,
SendCloudEventsForRuns: config.DefaultSendCloudEventsForRuns,
EnforceNonfalsifiability: config.DefaultEnforceNonfalsifiability,
Expand Down
Loading