-
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
Specify Params in Pipeline #263
Comments
Hey @bkuschel ! Thanks for opening this issue :D I think we may have this functionality already, though let me know if this isn't what you're looking for. You could have a helm task like this: kind: Task
metadata:
name: deploy-with-helm
namespace: default
spec:
inputs:
resources:
- name: workspace
type: git
...
params:
- name: namespace
...
steps:
- name: deploy
image: kubernetes-helm
command: ['helm']
args:
- 'install'
- '--namespace'
- '${inputs.params.namespace}' Then you could use templating in the Pipeline to provide the value of the namespace parameter: kind: Pipeline
...
- name: deploy-bundle-test
taskRef:
name: deploy-with-kubectl
inputSourceBindings:
- name: workspace
resourceRef:
name: guestbook
params:
- name: namespace
value: "${inputs.resources.workspace.revision}" (From #64) But you can only use inputs and outputs from the Task in the templating - I'm thinking what you want is some kind of "global" parameter (like in #254) that you can use for the namespace and pass into Tasks throughout the Pipeline? |
(Note: if we do want a "pipeline wide variable" I'm thinking that evolving |
Yeah, I know my first example in #254 was based on the idea of Pipeline parameters that can be referenced by all the Tasks contained in the Pipeline, so we don't have to duplicate setting Task parameters multiple times. |
But you can only use inputs and outputs from the Task in the templating - I'm thinking what you want is some kind of "global" parameter @bobcatfish right, something that is PipelineRun specific (ie, pertains only to a particular run of the pipeline). |
Cool, sounds good to me! Anyone have any other ideas besides extending |
Another idea would be to have a field in the |
In #282 we are getting rid of |
@bkuschel I updated the description pretty significantly, let me know (or update it!) if this no longer expresses what you're looking for |
yes, pipeline is good but I was thinking of being able to provide this through PipelineRun as well. Here's the specific scenario..
So at this point, if I am to fire off a pipelinerun for a particular environment i'd need to pass in the unique repositories for the environment as well as the parameters that eventually make their way down to the steps as environmental variables. If this is only provided through pipeline, i'd need to redefine the pipeline for every run which makes it difficult to separate out the commonality between environments. One idea i had was to create a resource that is just a bag of properties that's passed around. I hope that makes sense. |
(sorry for the super delayed reply @bkuschel , this shouldn't be the norm!)
Interesting suggestion - in earlier iterations of the Pipeline we had something called It'd be interesting to see if we can find a design for something similar that works with our latest CRDs. I'm planning to create an issue in the near future talking about how event triggering systems would create new PipelineRuns - in the current design they end up needing to make a lot of PipelineResources as well, but if we had some kind of "parameters" type, it could be possible to provide overrides instead 🤔 |
So my initial thinking on this is that we probably need to have the ability to specify parameters themselves (with options for a default value for the parameter or if a value for the parameter is required, perhaps) in |
/assign abayer |
Thanks @abayer !! 🎉 |
I'm still wondering if there's anything else we want to allow parameter values to be used in, but for now, it really seemed like |
Expected Behavior
We want to be able to provide Pipeline wide parameters which can be used in templating across Tasks.
For example, I should be able to create something like this (spec for params can be different!)
Actual Behavior
PipelineRun only accepts Resources, not parameters. We can specify templating within a Pipeline, but it only references Resources within the Task that uses the templating, there is no concept of global templating.
Additional Info
For example, have a pipeline with a helm deployment step that has a parameter that specifies the namespace to install into (for isolation.)
Strongly related to: #254
Note that one strange thing here is that:
Task
level, we express parameters we want inTasks
, and we specify the params we're actually using within the `TaskRunPipeline
level, the params exist within thePipeline
only, and are never provided in thePipelineRun
In the future we may want to consider moving more
params
into PipelineRuns??? Maybe!The text was updated successfully, but these errors were encountered: