-
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
Parameter substitution not working in ClusterTask.spec.steps.imagePullPolicy #3423
Comments
it would seem the problem has to do with kube trying to validate the resulting container spec before the variable substituion happens.... |
@itewk I think we do not support variable interpolation in |
@vdemeester is there a list somewhere of which paramters do support variable interpolation? |
https://github.com/tektoncd/pipeline/blob/master/docs/variables.md#fields-that-accept-variable-substitutions should list all the places you can put variables at the moment. |
@sbwsg sweet. I guess this should be changed to an RFE then? |
/kind feature |
Closes tektoncd#3423 Add variable expansion in Tasks for fields: - `spec.steps[].imagePullPolicy` - `spec.sidecar[].imagePullPolicy`
Hey @rinckm and all, I want to explore this a bit before we add it since it seems to me like ImagePullPolicy is a very k8s specific thing and while we do add k8s specific stuff into our API I want to make sure we really need to before we do (https://github.com/tektoncd/community/blob/master/design-principles.md#conformance)
@vdemeester it sounds like you think we SHOULD replace this - do we replace other container spec fields? |
I would say, yes and no (on
The variable interpolation is selective and I am pretty sure we don't go through the |
@bobcatfish See |
Is it possible to understand the use case a bit more where you need to use this value inside your Tasks @rinckm? (Want to make sure there isn't some other feature we could provide instead that would solve your problem even better) |
@bobcatfish my use case is being able to control at runtime when calling a pipeline whether to used the cached images or pull the latest. This comes in most handy when doing intigration testing of the workflow itself and testing with updated task container images. This is likley a crazy ask, that i am guessing has already been discussed somewhere, but why isn't there variable substitution in every field within |
I want to allow that a user of the Task can specify the image and the corresponding imagePullPolicy. |
Thanks for explaining your use cases @itewk and @rinckm , that makes perfect sense to me! I also looked at your examples more closely and I had this backwards 🤦♀️ - I thought we were adding a variable that allows you to grab the ImagePullPolicy that was already set (e.g. something like "echo $(steps.imagePullPolicy)") but now i understand you want to SET the ImagePullPolicy at runtime which makes way more sense XD. (I can also see why you were confused by me saying this is "k8s specific" @vdemeester 🙏 😆 ) |
This is maybe different than what you're asking for but it also kinda sounds like you might want to be able to specify a step template at runtime 🤔 I was hoping that podTemplate would let you set the ImagePullPolicy at runtime but it doesn't since that's at the level of the pod and not the individual containers/steps |
Closes tektoncd#3423 Add variable expansion in Tasks for fields: - `spec.steps[].imagePullPolicy` - `spec.sidecar[].imagePullPolicy`
Closes #3423 Add variable expansion in Tasks for fields: - `spec.steps[].imagePullPolicy` - `spec.sidecar[].imagePullPolicy`
@rinckm thank you |
Expected Behavior
This should work:
Actual Behavior
Get the following error:
It would apear from the error that for some reason variable substitution is not happenin gin the
ClusterTask.spec.steps.imagePullPolicy
value. I would have assumed that could do variable substitution in anything underClusterTask.spec.steps.
Steps to Reproduce the Problem
Additional Info
Kubernetes version:
Output of
kubectl version
:Tekton Pipeline version:
Output of
tkn version
orkubectl get pods -n tekton-pipelines -l app=tekton-pipelines-controller -o=jsonpath='{.items[0].metadata.labels.version}'
Installed via OpenShift Pipelines Operator, can't find a
tekton-pipelines-controller
OpenShift Pipelines Operator: 1.1.1
OpenShift-Pipelines: v0.14.3
OpenShift-Pipelines-Triggers: v0.6.1
OpenShift-Pipelines-ClusterTasks: v0.14
The text was updated successfully, but these errors were encountered: