Skip to content

Commit

Permalink
Remove alpha feature gate from projected workspaces
Browse files Browse the repository at this point in the history
This removes the alpha feature gate that is currently guarding projected
workspaces so they become a stable feature.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
  • Loading branch information
0xFelix authored and tekton-robot committed Sep 21, 2022
1 parent 7186154 commit fa60785
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 36 deletions.
1 change: 0 additions & 1 deletion docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,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) | |
| [Projected Workspace Type](workspaces.md#projected) | N/A | [v0.38.0](https://github.com/tektoncd/pipeline/releases/tag/v0.38.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 @@ -514,9 +514,6 @@ workspaces:

##### `projected`

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

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

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

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

// The csi workspace is only supported when the alpha feature gate is enabled.
Expand Down
8 changes: 0 additions & 8 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.EnableAlphaAPIFields,
}, {
name: "Valid csi",
binding: &v1.WorkspaceBinding{
Expand Down Expand Up @@ -166,19 +165,12 @@ func TestWorkspaceBindingValidateInvalid(t *testing.T) {
Name: "beth",
Secret: &corev1.SecretVolumeSource{},
},
}, {
name: "projected workspace should be disallowed without alpha 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.EnableAlphaAPIFields,
}, {
name: "csi workspace should be disallowed without alpha feature gate",
binding: &v1.WorkspaceBinding{
Expand Down
10 changes: 2 additions & 8 deletions pkg/apis/pipeline/v1beta1/workspace_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,9 @@ func (b *WorkspaceBinding) Validate(ctx context.Context) (errs *apis.FieldError)
return apis.ErrMissingField("secret.secretName")
}

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

// The csi workspace is only supported when the alpha feature gate is enabled.
Expand Down
8 changes: 0 additions & 8 deletions pkg/apis/pipeline/v1beta1/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.EnableAlphaAPIFields,
}, {
name: "Valid csi",
binding: &v1beta1.WorkspaceBinding{
Expand Down Expand Up @@ -166,19 +165,12 @@ func TestWorkspaceBindingValidateInvalid(t *testing.T) {
Name: "beth",
Secret: &corev1.SecretVolumeSource{},
},
}, {
name: "projected workspace should be disallowed without alpha feature gate",
binding: &v1beta1.WorkspaceBinding{
Name: "beth",
Projected: &corev1.ProjectedVolumeSource{},
},
}, {
name: "Provide projected without sources",
binding: &v1beta1.WorkspaceBinding{
Name: "beth",
Projected: &corev1.ProjectedVolumeSource{},
},
wc: config.EnableAlphaAPIFields,
}, {
name: "csi workspace should be disallowed without alpha feature gate",
binding: &v1beta1.WorkspaceBinding{
Expand Down

0 comments on commit fa60785

Please sign in to comment.