-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document all locations that variable substitution is available #2927
Document all locations that variable substitution is available #2927
Conversation
/kind documentation |
/release-note-none |
@psschwei please squash three commits into one 🙏 |
| --- | ----- | | ||
| `Task` | `credentials.path` | | ||
| `Task` | `spec.steps[].name` | | ||
| `Task` | `spec.steps[].image` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is great 👍
docs/variables.md
Outdated
| `Task` | `spec.steps[].env.valuefrom.secretkeyref.name` | | ||
| `Task` | `spec.steps[].env.valuefrom.secretkeyref.value` | | ||
| `Task` | `spec.steps[].env.valuefrom.configmapkeyref.name` | | ||
| `Task` | `spec.steps[].env.valuefrom.configmapkeyref.value` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these five can be combined into one single spec.steps[].env
, @sbwsg thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My one concern is that we don't provide substitution for all fields under env
- for example we don't substitute the .env.name
field, nor any fields under .env.fieldRef
or .env.resourceFieldRef
.
My feeling is we should be more specific rather than less due to that. wdyt @pritidesai ?
/test pull-tekton-pipeline-unit-tests |
docs/variables.md
Outdated
@@ -113,3 +113,36 @@ variable via `resources.inputs.<resourceName>.<variableName>` or | |||
| `name` | The name of the resource. | | |||
| `type` | Type value of `"cloudEvent"`. | | |||
| `target-uri` | The URI to hit with cloud event payloads. | | |||
|
|||
## Variables that can be substituted in a CRD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest "Task fields that accept variable substitutions" for the title here.
docs/variables.md
Outdated
| `Task` | `spec.steps[].image` | | ||
| `Task` | `spec.steps[].env.value` | | ||
| `Task` | `spec.steps[].env.valuefrom.secretkeyref.name` | | ||
| `Task` | `spec.steps[].env.valuefrom.secretkeyref.value` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should .key
instead of .value
? Similarly for configmapkeyref
.
https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#configmapkeyselector-v1-core
docs/variables.md
Outdated
| `Task` | `spec.steps[].env.valuefrom.secretkeyref.name` | | ||
| `Task` | `spec.steps[].env.valuefrom.secretkeyref.value` | | ||
| `Task` | `spec.steps[].env.valuefrom.configmapkeyref.name` | | ||
| `Task` | `spec.steps[].env.valuefrom.configmapkeyref.value` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My one concern is that we don't provide substitution for all fields under env
- for example we don't substitute the .env.name
field, nor any fields under .env.fieldRef
or .env.resourceFieldRef
.
My feeling is we should be more specific rather than less due to that. wdyt @pritidesai ?
docs/variables.md
Outdated
| `Task` | `spec.steps[].env.valuefrom.configmapkeyref.value` | | ||
| `Task` | `spec.steps[].volumemounts.name` | | ||
| `Task` | `spec.steps[].volumemounts.mountpath` | | ||
| `Task` | `spec.steps[].volumemounts.submountpath` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| `Task` | `spec.volumes[].persistentvolumeclaim.claimname` | | ||
| `Task` | `spec.volumes[].projected.sources.configmap.name` | | ||
| `Task` | `spec.volumes[].projected.sources.secret.name` | | ||
| `Task` | `spec.volumes[].projected.sources.serviceaccounttoken.audience` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These were also very recently added:
spec.volumes[].csi.nodepublishsecretref.name
spec.volumes[].csi.volumeattributes.*
That second one is a map of unspecified string keys so I'm not sure what the best way is to express it other than to use an *
.
docs/variables.md
Outdated
| `Task` | `spec.sidecars[].image` | | ||
| `Task` | `spec.sidecars[].env.value` | | ||
| `Task` | `spec.sidecars[].env.valuefrom.secretkeyref.name` | | ||
| `Task` | `spec.sidecars[].env.valuefrom.secretkeyref.value` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment as above wrt .key
vs .value
for secrets and configmaps.
docs/variables.md
Outdated
| `Task` | `spec.sidecars[].env.valuefrom.configmapkeyref.value` | | ||
| `Task` | `spec.sidecars[].volumemounts.name` | | ||
| `Task` | `spec.sidecars[].volumemounts.mountpath` | | ||
| `Task` | `spec.sidecars[].volumemounts.submountpath` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and here submountpath
-> subpath
I think.
0a1af4d
to
8d26e01
Compare
docs/variables.md
Outdated
|
||
| CRD | Field | | ||
| --- | ----- | | ||
| `Task` | `credentials.path` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is in error I think. It isn't a field that can receive variables.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a very useful improvement, thank you! I think this just needs to have commits squashed into 1 and then I'll approve.
Oh, also, do you plan to include Pipeline locations in this PR as well? Or prefer to merge as-is and tackle Pipeline locations separately? |
Thanks for the great review! Made it really easy for me. :)
I was planning to do them both in the same PR, but I can split them up if that's easier. Let me know which you'd prefer. |
Together in the same PR would be great. |
08fde5c
to
c441126
Compare
Will get the pipeline subs in later this week. Sorry for the delay in completing this! |
a76cd16
to
e4a9cbf
Compare
/assign @pritidesai |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vdemeester The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
docs/variables.md
Outdated
| `Task` | `spec.sidecars[].volumemounts.mountpath` | | ||
| `Task` | `spec.sidecars[].volumemounts.subpath` | | ||
| `Pipeline` | `spec.tasks[].params[].value` | | ||
| `Pipeline` | `spec.tasks[].conditions[].params[].value` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more to add here: Pipeline
| spec.results[].value
adding variable substitutions for pipelines
2c6cc01
to
4b63f1d
Compare
/lgtm Fantastic, thanks for taking this on. |
Changes
Fixes #2605 , adding a table to docs/variables.md with locations in our CRDs where variables will be successfully interpolated into.
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
See the contribution guide for more details.
Double check this list of stuff that's easy to miss:
cmd
dir, please updatethe release Task to build and release this image.
Reviewer Notes
If API changes are included, additive changes must be approved by at least two OWNERS and backwards incompatible changes must be approved by more than 50% of the OWNERS, and they must first be added in a backwards compatible way.