tektoncd / pipeline

A cloud-native Pipeline resource.
https://tekton.dev
Apache License 2.0
8.52k stars 1.78k forks source link

Variables are not replaced in workspace mountPath #3786

Closed afrittoli closed 3 years ago

afrittoli commented 3 years ago

Expected Behavior

Variables are replaced in the mountPath: For instance:

spec:
  params:
    - name: package
      description: package to release (e.g. github.com/<org>/<project>)
      default: github.com/tektoncd/pipeline
  workspaces:
    - name: source
      description: The workspace where the repo has been cloned
      mountPath: /go/src/$(params.package)

The workspace is mounted to /go/src/github.com/tektoncd/pipeline

Actual Behavior

The workspace is mounted to /go/src/$(params.package)

Steps to Reproduce the Problem

  1. Create a task with the spec from the example
  2. Add a step that prints $(workspaces.source.path)
  3. Run the task

Additional Info

Client Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.3", GitCommit:"2e7996e3e2712684bc73f0dec0200d64eec7fe40", GitTreeState:"clean", BuildDate:"2020-05-21T14:51:23Z", GoVersion:"go1.14.3", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"19", GitVersion:"v1.19.1", GitCommit:"206bcadf021e76c27513500ca24182692aabd17e", GitTreeState:"clean", BuildDate:"2020-09-14T07:30:52Z", GoVersion:"go1.15", Compiler:"gc", Platform:"linux/amd64"}
Client version: 0.16.0
Pipeline version: v0.21.0
Triggers version: v0.11.2
Dashboard version: v0.14.0
afrittoli commented 3 years ago

/cc @sbwsg

ghost commented 3 years ago

There's already a PR for this: https://github.com/tektoncd/pipeline/pull/3380 that just needs a couple edits to get mergeable.

/cc @khalkie

bobcatfish commented 3 years ago

I think I'm being pedantic, but is this a bug? Doesn't seem like we list this as a field you can replace in (yet)

https://github.com/tektoncd/pipeline/blob/master/docs/variables.md#fields-that-accept-variable-substitutions

/kind feature

bobcatfish commented 3 years ago

(yes, i am currently looking at the bug count for our WG meeting XD)

tekton-robot commented 3 years ago

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale with a justification. Stale issues rot after an additional 30d of inactivity and eventually close. If this issue is safe to close now please do so with /close with a justification. If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/lifecycle stale

Send feedback to tektoncd/plumbing.

nikhil-thomas commented 3 years ago

/remove-lifecycle stale

this issue is being addressed in https://github.com/tektoncd/pipeline/pull/3934