Skip to content

Commit

Permalink
Update Stability Level for CSI and Projected Volume Workspaces
Browse files Browse the repository at this point in the history
This commit updates the stability level for csi and projected
volume workspaces, which have both been documented as they have
became stable according to TEP096.
  • Loading branch information
JeromeJu authored and tekton-robot committed Jul 21, 2023
1 parent 1871c30 commit 443e380
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 31 deletions.
2 changes: 0 additions & 2 deletions docs/additional-configs.md
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,6 @@ Features currently in "beta" are:
| [Object Parameters and Results](pipelineruns.md#specifying-parameters) | [TEP-0075](https://github.com/tektoncd/community/blob/main/teps/0075-object-param-and-result-types.md) | | [v0.46.0](https://github.com/tektoncd/pipeline/releases/tag/v0.46.0) | | No |
| [Remote Tasks](./taskruns.md#remote-tasks) and [Remote Pipelines](./pipelineruns.md#remote-pipelines) | [TEP-0060](https://github.com/tektoncd/community/blob/main/teps/0060-remote-resolution.md) | | [v0.41.0](https://github.com/tektoncd/pipeline/releases/tag/v0.41.0) | | No |
| [`Provenance` field in Status](pipeline-api.md#provenance)| [issue#5550](https://github.com/tektoncd/pipeline/issues/5550)| [v0.41.0](https://github.com/tektoncd/pipeline/releases/tag/v0.41.0)| [v0.48.0](https://github.com/tektoncd/pipeline/releases/tag/v0.48.0) | `enable-provenance-in-status`| No |
| [CSI workspaces](workspaces.md#csi)| [issue#4446](https://github.com/tektoncd/pipeline/issues/4446)| [v0.38.0](https://github.com/tektoncd/pipeline/releases/tag/v0.38.0)| [v0.41.0](https://github.com/tektoncd/pipeline/releases/tag/v0.41.0) | | No |
| [Projected volume workspaces](workspaces.md#projected)| [issue#5075](https://github.com/tektoncd/pipeline/issues/5075)| [v0.38.0](https://github.com/tektoncd/pipeline/releases/tag/v0.38.0)| [v0.41.0](https://github.com/tektoncd/pipeline/releases/tag/v0.41.0) | | No |
| [Isolated `Step` & `Sidecar` `Workspaces`](./workspaces.md#isolated-workspaces) | [TEP-0029](https://github.com/tektoncd/community/blob/main/teps/0029-step-workspaces.md) | [v0.24.0](https://github.com/tektoncd/pipeline/releases/tag/v0.24.0) | [v0.50.0](https://github.com/tektoncd/pipeline/releases/tag/v0.50.0) | | Yes |

## Enabling larger results using sidecar logs
Expand Down
12 changes: 0 additions & 12 deletions pkg/apis/pipeline/v1/workspace_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ package v1
import (
"context"

"github.com/tektoncd/pipeline/pkg/apis/config"
"github.com/tektoncd/pipeline/pkg/apis/version"
"k8s.io/apimachinery/pkg/api/equality"
"knative.dev/pkg/apis"
)
Expand Down Expand Up @@ -68,25 +66,15 @@ func (b *WorkspaceBinding) Validate(ctx context.Context) (errs *apis.FieldError)
return apis.ErrMissingField("secret.secretName")
}

// The projected workspace is only supported when the beta feature gate is enabled.
// For a Projected volume to work, you must provide at least one source.
if b.Projected != nil && len(b.Projected.Sources) == 0 {
errs := version.ValidateEnabledAPIFields(ctx, "projected workspace type", config.BetaAPIFields).ViaField("workspaces")
if errs != nil {
return errs
}
if len(b.Projected.Sources) == 0 {
return apis.ErrMissingField("projected.sources")
}
}

// The csi workspace is only supported when the beta feature gate is enabled.
// For a CSI to work, you must provide and have installed the driver to use.
if b.CSI != nil {
errs := version.ValidateEnabledAPIFields(ctx, "csi workspace type", config.BetaAPIFields).ViaField("workspaces")
if errs != nil {
return errs
}
if b.CSI.Driver == "" {
return apis.ErrMissingField("csi.driver")
}
Expand Down
17 changes: 0 additions & 17 deletions pkg/apis/pipeline/v1/workspace_validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ func TestWorkspaceBindingValidateValid(t *testing.T) {
}},
},
},
wc: config.EnableBetaAPIFields,
}, {
name: "Valid csi",
binding: &v1.WorkspaceBinding{
Expand All @@ -111,7 +110,6 @@ func TestWorkspaceBindingValidateValid(t *testing.T) {
Driver: "my-csi",
},
},
wc: config.EnableBetaAPIFields,
}} {
t.Run(tc.name, func(t *testing.T) {
ctx := context.Background()
Expand Down Expand Up @@ -165,28 +163,13 @@ func TestWorkspaceBindingValidateInvalid(t *testing.T) {
Name: "beth",
Secret: &corev1.SecretVolumeSource{},
},
}, {
name: "projected workspace should be disallowed without beta feature gate",
binding: &v1.WorkspaceBinding{
Name: "beth",
Projected: &corev1.ProjectedVolumeSource{},
},
}, {
name: "Provide projected without sources",
binding: &v1.WorkspaceBinding{
Name: "beth",
Projected: &corev1.ProjectedVolumeSource{},
},
wc: config.EnableBetaAPIFields,
}, {
name: "csi workspace should be disallowed without beta feature gate",
binding: &v1.WorkspaceBinding{
Name: "beth",
CSI: &corev1.CSIVolumeSource{
Driver: "csi-driver",
},
},
wc: config.EnableStableAPIFields,
}, {
name: "Provide csi without a driver",
binding: &v1.WorkspaceBinding{
Expand Down

0 comments on commit 443e380

Please sign in to comment.