Skip to content

Commit

Permalink
CSI workspace to Beta
Browse files Browse the repository at this point in the history
This commit removes the alpha feature gate for the csi workspace so that it
becomes a beta feature.
  • Loading branch information
JeromeJu authored and tekton-robot committed Oct 25, 2022
1 parent b2aa3a4 commit f1b6812
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 31 deletions.
1 change: 0 additions & 1 deletion docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,6 @@ Features currently in "alpha" are:
| [Matrix](./matrix.md) | [TEP-0090](https://github.com/tektoncd/community/blob/main/teps/0090-matrix.md) | [v0.38.0](https://github.com/tektoncd/pipeline/releases/tag/v0.38.0) | |
| [Embedded Statuses](pipelineruns.md#configuring-usage-of-taskrun-and-run-embedded-statuses) | [TEP-0100](https://github.com/tektoncd/community/blob/main/teps/0100-embedded-taskruns-and-runs-status-in-pipelineruns.md) | [v0.35.0](https://github.com/tektoncd/pipeline/releases/tag/v0.35.0) | embedded-status |
| [Task-level Resource Requirements](compute-resources.md#task-level-compute-resources-configuration) | [TEP-0104](https://github.com/tektoncd/community/blob/main/teps/0104-tasklevel-resource-requirements.md) | [v0.39.0](https://github.com/tektoncd/pipeline/releases/tag/v0.39.0) | |
| [CSI Workspace Type](workspaces.md#csi) | N/A | [v0.38.0](https://github.com/tektoncd/pipeline/releases/tag/v0.38.0) | |
| [Object Params and Results](pipelineruns.md#specifying-parameters) | [TEP-0075](https://github.com/tektoncd/community/blob/main/teps/0075-object-param-and-result-types.md) | [v0.38.0](https://github.com/tektoncd/pipeline/releases/tag/v0.38.0) | |
| [Array Results](pipelineruns.md#specifying-parameters) | [TEP-0076](https://github.com/tektoncd/community/blob/main/teps/0076-array-result-types.md) | [v0.38.0](https://github.com/tektoncd/pipeline/releases/tag/v0.38.0) | |

Expand Down
3 changes: 0 additions & 3 deletions docs/workspaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -534,9 +534,6 @@ workspaces:

##### `csi`

This is an alpha feature. The `enable-api-fields` feature flag [must be set to `"alpha"`](./install.md)
for csi volume source to function.

The `csi` field references a [`csi` volume](https://kubernetes.io/docs/concepts/storage/volumes/#csi).
Using a `csi` volume has the following limitations:

Expand Down
4 changes: 2 additions & 2 deletions pkg/apis/pipeline/v1/workspace_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ func (b *WorkspaceBinding) Validate(ctx context.Context) (errs *apis.FieldError)
return apis.ErrMissingField("projected.sources")
}

// The csi workspace is only supported when the alpha feature gate is enabled.
// 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.AlphaAPIFields).ViaField("workspaces")
errs := version.ValidateEnabledAPIFields(ctx, "csi workspace type", config.BetaAPIFields).ViaField("workspaces")
if errs != nil {
return errs
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/apis/pipeline/v1/workspace_validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func TestWorkspaceBindingValidateValid(t *testing.T) {
Driver: "my-csi",
},
},
wc: config.EnableAlphaAPIFields,
wc: config.EnableBetaAPIFields,
}} {
t.Run(tc.name, func(t *testing.T) {
ctx := context.Background()
Expand Down Expand Up @@ -172,7 +172,7 @@ func TestWorkspaceBindingValidateInvalid(t *testing.T) {
Projected: &corev1.ProjectedVolumeSource{},
},
}, {
name: "csi workspace should be disallowed without alpha feature gate",
name: "csi workspace should be disallowed without beta feature gate",
binding: &v1.WorkspaceBinding{
Name: "beth",
CSI: &corev1.CSIVolumeSource{
Expand All @@ -187,7 +187,7 @@ func TestWorkspaceBindingValidateInvalid(t *testing.T) {
Driver: "",
},
},
wc: config.EnableAlphaAPIFields,
wc: config.EnableBetaAPIFields,
}} {
t.Run(tc.name, func(t *testing.T) {
ctx := context.Background()
Expand Down
13 changes: 2 additions & 11 deletions pkg/apis/pipeline/v1beta1/workspace_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ package v1beta1
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 @@ -73,16 +71,9 @@ func (b *WorkspaceBinding) Validate(ctx context.Context) (errs *apis.FieldError)
return apis.ErrMissingField("projected.sources")
}

// The csi workspace is only supported when the alpha 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.AlphaAPIFields).ViaField("workspaces")
if errs != nil {
return errs
}
if b.CSI.Driver == "" {
return apis.ErrMissingField("csi.driver")
}
if b.CSI != nil && b.CSI.Driver == "" {
return apis.ErrMissingField("csi.driver")
}

return nil
Expand Down
11 changes: 0 additions & 11 deletions pkg/apis/pipeline/v1beta1/workspace_validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"context"
"testing"

"github.com/tektoncd/pipeline/pkg/apis/config"
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
Expand Down Expand Up @@ -110,7 +109,6 @@ func TestWorkspaceBindingValidateValid(t *testing.T) {
Driver: "my-csi",
},
},
wc: config.EnableAlphaAPIFields,
}} {
t.Run(tc.name, func(t *testing.T) {
ctx := context.Background()
Expand Down Expand Up @@ -171,14 +169,6 @@ func TestWorkspaceBindingValidateInvalid(t *testing.T) {
Name: "beth",
Projected: &corev1.ProjectedVolumeSource{},
},
}, {
name: "csi workspace should be disallowed without alpha feature gate",
binding: &v1beta1.WorkspaceBinding{
Name: "beth",
CSI: &corev1.CSIVolumeSource{
Driver: "csi-driver",
},
},
}, {
name: "Provide csi without a driver",
binding: &v1beta1.WorkspaceBinding{
Expand All @@ -187,7 +177,6 @@ func TestWorkspaceBindingValidateInvalid(t *testing.T) {
Driver: "",
},
},
wc: config.EnableAlphaAPIFields,
}} {
t.Run(tc.name, func(t *testing.T) {
ctx := context.Background()
Expand Down

0 comments on commit f1b6812

Please sign in to comment.