Skip to content
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

Change podconvert.MakePod func into a configuration struct with methods #2982

Merged
merged 1 commit into from Jul 23, 2020
Merged

Conversation

ghost
Copy link

@ghost ghost commented Jul 21, 2020

Changes

While working on a feature to optionally disable Tekton's built-in credentials
initialization process, it became apparent that the podconvert.MakePod func
would need an extra boolean argument in its signature. The signature is already
quite long which makes reading it difficult.

This commit separates the signature into configuration options and the task
spec / run arguments. In a follow-up commit I plan to add the boolean flag described
above as another configuration option in the PodBuilder struct.

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

Release Notes

NONE

@tekton-robot tekton-robot added release-note-none Denotes a PR that doesnt merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 21, 2020
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/taskrun/taskrun.go 76.5% 76.6% 0.1

@vdemeester
Copy link
Member

/kind cleanup

@tekton-robot tekton-robot added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Jul 21, 2020
Copy link
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
one absolute nit that I am ashamed to even have commented 😝

@@ -1760,7 +1760,13 @@ func makePod(taskRun *v1beta1.TaskRun, task *v1beta1.Task) (*corev1.Pod, error)
return nil, err
}

return podconvert.MakePod(context.Background(), images, taskRun, task.Spec, kubeclient, entrypointCache, true)
builder := podconvert.PodBuilder{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: it bothers me it's not named the same as above 😹 but that's definitely a nit 😂

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm, i'm open to changing the naming, no big deal, but i'm not 100% clear what name you want - right now it's podconvert.Builder after golangci-lint corrected me. What's your preferred name?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was speaker about the variable name builder (and above podBuilder) 😊

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 21, 2020
While working on a feature to optionally disable Tekton's built-in credentials
initialization process, it became apparent that the podconvert.MakePod func
would need an extra boolean argument in its signature. The signature is already
quite long which makes reading it difficult.

This commit separates the signature into configuration options and the task
spec / run. In a follow-up commit I plan to add the boolean flag described
above as another configuration option in the PodBuilder struct.
@tekton-robot tekton-robot removed the lgtm Indicates that a PR is ready to be merged. label Jul 21, 2020
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/taskrun/taskrun.go 76.5% 76.6% 0.1

@dlorenc
Copy link
Contributor

dlorenc commented Jul 21, 2020

I went back and forth in my head twice on whether or not the kubernetes client should be on this struct vs. left as a function paramter but think I settled on the way you did it here. Nice!

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 21, 2020
@nikhil-thomas
Copy link
Member

/lgtm

@dlorenc
Copy link
Contributor

dlorenc commented Jul 23, 2020

/approve

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dlorenc

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 23, 2020
@tekton-robot tekton-robot merged commit 7453c40 into tektoncd:master Jul 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesnt merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants