Add ImageVolumeSource as a workspace binding type - #10593
Conversation
|
|
|
/kind feature |
There was a problem hiding this comment.
Pull request overview
Adds feature-gated Kubernetes image volumes as workspace bindings for TaskRuns and PipelineRuns.
Changes:
- Extends v1/v1beta1 workspace APIs, validation, conversion, and volume creation.
- Adds parameter substitution and tests.
- Documents Kubernetes requirements.
Reviewed changes
Copilot reviewed 13 out of 15 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
pkg/workspace/apply.go |
Creates image volumes and substitutes references. |
pkg/workspace/apply_test.go |
Tests image mounting and substitution. |
pkg/apis/pipeline/v1beta1/zz_generated.deepcopy.go |
Deep-copies image sources. |
pkg/apis/pipeline/v1beta1/workspace_validation.go |
Validates and gates image bindings. |
pkg/apis/pipeline/v1beta1/workspace_validation_test.go |
Tests v1beta1 validation. |
pkg/apis/pipeline/v1beta1/workspace_types.go |
Adds the v1beta1 image field. |
pkg/apis/pipeline/v1beta1/workspace_conversion.go |
Converts image bindings between APIs. |
pkg/apis/pipeline/v1beta1/pipelinerun_validation_test.go |
Updates source-field expectations. |
pkg/apis/pipeline/v1/zz_generated.deepcopy.go |
Deep-copies image sources. |
pkg/apis/pipeline/v1/workspace_validation.go |
Validates and gates image bindings. |
pkg/apis/pipeline/v1/workspace_validation_test.go |
Tests v1 validation. |
pkg/apis/pipeline/v1/workspace_types.go |
Adds the v1 image field. |
pkg/apis/pipeline/v1/pipelinerun_validation_test.go |
Updates source-field expectations. |
pkg/apis/config/feature_flags.go |
Defines the feature flag. |
docs/workspaces.md |
Documents image workspaces. |
Files not reviewed (2)
- pkg/apis/pipeline/v1/zz_generated.deepcopy.go: Generated file
- pkg/apis/pipeline/v1beta1/zz_generated.deepcopy.go: Generated file
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| // Image represents a volume populated from a container image's filesystem. | ||
| // The image is pulled at pod startup. Contents are mounted read-only. | ||
| // Requires Kubernetes 1.31+ with the ImageVolume feature gate enabled. | ||
| // +optional | ||
| Image *corev1.ImageVolumeSource `json:"image,omitempty"` |
| // DefaultEnableImageWorkspaceFlag is the default PerFeatureFlag value for "enable-image-workspace" | ||
| DefaultEnableImageWorkspaceFlag = PerFeatureFlag{ | ||
| Name: EnableImageWorkspace, | ||
| Stability: AlphaAPIFields, | ||
| Enabled: DefaultAlphaFeatureEnabled, | ||
| } |
| sink.Secret = w.Secret | ||
| sink.Projected = w.Projected | ||
| sink.CSI = w.CSI | ||
| sink.Image = w.Image |
a6aa9b0 to
c81fbcd
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
c81fbcd to
e2e35dc
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 22 out of 26 changed files in this pull request and generated 1 comment.
Files not reviewed (4)
- pkg/apis/pipeline/v1/openapi_generated.go: Generated file
- pkg/apis/pipeline/v1/zz_generated.deepcopy.go: Generated file
- pkg/apis/pipeline/v1beta1/openapi_generated.go: Generated file
- pkg/apis/pipeline/v1beta1/zz_generated.deepcopy.go: Generated file
Add support for Kubernetes Image Volumes (corev1.ImageVolumeSource) as a new workspace volume source type in WorkspaceBinding. This allows users to mount container image filesystems as read-only workspace volumes in TaskRuns and PipelineRuns. The feature is gated behind the "enable-image-workspace" per-feature flag at alpha stability, disabled by default. Changes: - Add Image field to WorkspaceBinding in v1 and v1beta1 APIs - Add "enable-image-workspace" per-feature flag (alpha, default off) - Add validation requiring image.reference when Image is set - Gate Image workspace usage behind the feature flag - Add Image to allVolumeSourceFields (also adds missing projected/csi) - Add volume creation and parameter substitution support - Add v1beta1 <-> v1 conversion - Update deepcopy functions - Add documentation with Kubernetes version requirements - Add tests for validation, feature gating, volume creation, and parameter substitution Fixes: tektoncd#10592 Signed-off-by: Benny Zlotnik <bzlotnik@redhat.com> Assisted-by: claude-opus-4.6
e2e35dc to
531c771
Compare
Add support for Kubernetes Image Volumes (corev1.ImageVolumeSource) as a new workspace volume source type in WorkspaceBinding. This allows users to mount container image filesystems as read-only workspace volumes in TaskRuns and PipelineRuns.
The feature is gated behind the "enable-image-workspace" per-feature flag at alpha stability, disabled by default.
Changes:
Fixes: #10592
Changes
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
/kind <type>. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tepRelease Notes
/kind feature