@@ -385,10 +385,8 @@ func (c *Reconciler) prepare(ctx context.Context, tr *v1beta1.TaskRun) (*v1beta1
385385 var workspaceDeclarations []v1beta1.WorkspaceDeclaration
386386 // Propagating workspaces allows users to skip declarations
387387 // In order to validate the workspace bindings we create declarations based on
388- // the workspaces provided in the task run spec. This logic is hidden behind the
389- // alpha/beta feature gate since propagating workspaces is behind the beta feature gate.
390- // In addition, we only allow this feature for embedded taskSpec.
391- if config .FromContextOrDefaults (ctx ).FeatureFlags .EnableAPIFields != config .StableAPIFields && tr .Spec .TaskSpec != nil {
388+ // the workspaces provided in the task run spec. We only allow this feature for embedded taskSpec.
389+ if tr .Spec .TaskSpec != nil {
392390 for _ , ws := range tr .Spec .Workspaces {
393391 wspaceDeclaration := v1beta1.WorkspaceDeclaration {Name : ws .Name }
394392 workspaceDeclarations = append (workspaceDeclarations , wspaceDeclaration )
@@ -767,25 +765,23 @@ func applyParamsContextsResultsAndWorkspaces(ctx context.Context, tr *v1beta1.Ta
767765 ts = resources .ApplyStepExitCodePath (ts )
768766
769767 // Apply workspace resource substitution
770- if config .FromContextOrDefaults (ctx ).FeatureFlags .EnableAPIFields != config .StableAPIFields {
771- // propagate workspaces from taskrun to task.
772- twn := []string {}
773- for _ , tw := range ts .Workspaces {
774- twn = append (twn , tw .Name )
775- }
776-
777- for _ , trw := range tr .Spec .Workspaces {
778- skip := false
779- for _ , tw := range twn {
780- if tw == trw .Name {
781- skip = true
782- break
783- }
784- }
785- if ! skip {
786- ts .Workspaces = append (ts .Workspaces , v1beta1.WorkspaceDeclaration {Name : trw .Name })
768+ // propagate workspaces from taskrun to task.
769+ twn := []string {}
770+ for _ , tw := range ts .Workspaces {
771+ twn = append (twn , tw .Name )
772+ }
773+
774+ for _ , trw := range tr .Spec .Workspaces {
775+ skip := false
776+ for _ , tw := range twn {
777+ if tw == trw .Name {
778+ skip = true
779+ break
787780 }
788781 }
782+ if ! skip {
783+ ts .Workspaces = append (ts .Workspaces , v1beta1.WorkspaceDeclaration {Name : trw .Name })
784+ }
789785 }
790786 ts = resources .ApplyWorkspaces (ctx , ts , ts .Workspaces , tr .Spec .Workspaces , workspaceVolumes )
791787
0 commit comments