-
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
Add default pod template support #1541
Conversation
Hi @eddycharly. Thanks for your PR. I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
We should stick to what we do for the rest, aka, a Task step containerspec takes over the same field the stepTemplate field. In that case, a user using |
@vdemeester thanks for the feedback. i agree that sticking to what is already done is good for consistency. Trying to build right now, my changes introduce a cyclic dependency as config needs v1alpha1 (for How would you recommend solving this dependency issue ? Should i create an interface ? A package to hold structs like |
I think we have a little bit time to think about that. I would want to wait for other feedback on this feature before tackling this issue. That said, on top of my head, we can extract the sturct into a package and use type aliasing to not have the cyclic dependency. I might take this approach for #1526 (more or less). |
Just trying to figure out what would have to be done to implement it... in case it is accepted ;) Still waiting for feedback/discussion of course. |
I would suggest not trying to perform a merge. My preference would be that the pod gets either the one specified on the TaskRun or the default if not specified, not an amalgamation of both. |
@sbwsg @vdemeester should i go ahead with this or do you think it's useless ? |
@eddycharly I think it make sense 👼 and I think, as a start I do like @sbwsg suggestion. If there is no PodTemplate on a TaskRun, let's use the one from the default (if any), and if there is a PodTemplate, it overrides them all 👼 |
/ok-to-test |
The following is the coverage report on pkg/.
|
@vdemeester to resolve the cyclic reference issue i had with pod.go, i moved it in |
The following is the coverage report on pkg/.
|
hum 🤔 why is there a cyclic reference issue ? |
It introduces a dependency from |
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.
It introduces a dependency from
config
tov1alpha1
(to deserialize the pod template struct from the config map), butv1alpha1
already depends onconfig
...
ah dang… then we need to at least use type aliasing to make sure we don't break downstream go user of tektoncd/pipeline (like dashboard, cli, …).
I would prefer a package like pod
for moving the pod.go
code, so something like pkg/apis/pipeline/pod/
with a template.go
file in there ?
And in v1alpha1/pod.go
having,
// […]
package v1alpha1
import (
// […]
"github.com/tektoncd/pipeline/pkg/apis/pipeline/pod"
// […]
)
// […]
type PodTemplate = pod.PodTemplate
wdyt ?
The following is the coverage report on pkg/.
|
The following is the coverage report on pkg/.
|
fixed review comments use ghodss/yaml go mod tidy
The following is the coverage report on pkg/.
|
Outch.. conficts :( |
Thanks for keeping at this @eddycharly ! To resolve the conflicts you'll need to rebase your branch onto the latest version of master and then force push, then we can lgtm and merge. Let us know if you want us to point you in the right direction to do that! |
The following is the coverage report on pkg/.
|
The following is the coverage report on pkg/.
|
/test pull-tekton-pipeline-integration-tests |
@bobcatfish i resolved the conflicts. |
This is happening over in #1888 as well, re-opened tektoncd/plumbing#29 |
boskos seems to be out of resources :( |
/test pull-tekton-pipeline-integration-tests |
Sorry about this @eddycharly trying to figure out what's going on 😭 |
Thanks for your support @bobcatfish ! |
/test pull-tekton-pipeline-integration-tests |
1 similar comment
/test pull-tekton-pipeline-integration-tests |
/test pull-tekton-pipeline-integration-tests |
1 similar comment
/test pull-tekton-pipeline-integration-tests |
@bobcatfish all tests are passing now. Can you give a look please ? |
@eddycharly can you squash your commits ? |
fix taskrun tests
The following is the coverage report on pkg/.
|
/test tekton-pipeline-unit-tests |
@eddycharly: The following tests failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
@vdemeester any idea why unit tests are failing ? |
@eddycharly interesting… I thought we fixed that test… There might be a slight race in there still… 🤔 |
This PR adds support for a default pod template through the default
ConfigMap
.This is useful when one wants to apply a pod template to all task and pipeline runs, for example specifying a node selector, a security policy, etc...
When a pod template is specified for a
PipelineRun
orTaskRun
it takes precedence over the default pod template.Therefore, the default pod template only applies to
PipelineRun
orTaskRun
that don't have a pod template.Submitter Checklist