-
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
Merge place-tools and step-init together #4826
Merge place-tools and step-init together #4826
Conversation
Note: This is not removing the |
The following is the coverage report on the affected files.
|
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 looks good so far, thanks for doing this!
case InitCommand: | ||
// If invoked in "init mode" (`entrypoint init <src> <dst> [<step-name>]`), | ||
// it will copy the src path to the dst path (like CopyCommand), and initialize | ||
// the /tekton/steps forder (like StepInitCommand) |
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.
// the /tekton/steps forder (like StepInitCommand) | |
// the /tekton/steps folder (like StepInitCommand) |
/retest |
13f0400
to
6c34216
Compare
The following is the coverage report on the affected files.
|
6c34216
to
6db845e
Compare
The following is the coverage report on the affected files.
|
6db845e
to
2b67426
Compare
The following is the coverage report on the affected files.
|
/retest |
2b67426
to
62f1338
Compare
The following is the coverage report on the affected files.
|
pkg/pod/pod.go
Outdated
// Initialize any workingDirs under /workspace. | ||
if workingDirInit := workingDirInit(b.Images.WorkingDirInitImage, stepContainers); workingDirInit != nil { | ||
initContainers = append(initContainers, *workingDirInit) | ||
} | ||
|
||
// place the entrypoint first in case other init containers rely on its |
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.
Given that we always want the entrypoint first, why not just do this before we add anything else to initContainers
?
pkg/pod/pod.go
Outdated
func tektonDirInit(image string, steps []v1beta1.Step) corev1.Container { | ||
cmd := make([]string, 0, len(steps)+2) | ||
cmd = append(cmd, "/ko-app/entrypoint", "step-init") | ||
// prepareInitContainers generate a few init containers based of a set of command (in images) and volumes to run |
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.
Should be prepareInitContainer generates an init container...
rather than the plural containers
there now. =)
// Rewrite steps with entrypoint binary. Append the entrypoint init | ||
// container to place the entrypoint binary. Also add timeout flags | ||
// to entrypoint binary. | ||
prepareInitContainer := corev1.Container{ |
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'd rename this to just initContainer
.
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.
Renamed to entrypointInitContainer
🙃
This is part of an effort to reduce the number of init container to the minimum. Both place-tools and step-init are using the same image and can be easily and safely merged together. This has few benefits, but the main one is that it reduces the number of container to run, and thus doesn't reduce the max size of a Result. Signed-off-by: Andrew Bayer <[email protected]> Signed-off-by: Vincent Demeester <[email protected]>
62f1338
to
f5a7fdf
Compare
The following is the coverage report on the affected files.
|
/test pull-tekton-pipeline-build-tests |
/retest |
/lgtm Cutting down on the number of init containers is great - looking forward to seeing more of them get folded in! |
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.
Really nice! Ideally we will have a single init container eventually?
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: afrittoli 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 |
@afrittoli That's the goal. =) @vdemeester and I chatted about this and merging them together one by one seemed the best approach! |
#4519 is relevant |
Yes the goal is to reduce it to one 😇 |
Changes
This is part of an effort to reduce the number of init container to
the minimum. Both place-tools and step-init are using the same image
and can be easily and safely merged together.
This has few benefits, but the main one is that it reduces the number
of container to run, and thus doesn't reduce the max size of a Result.
Signed-off-by: Andrew Bayer [email protected]
Signed-off-by: Vincent Demeester [email protected]
/kind bug
/cc @imjasonh @dibyom @lbernick @abayer
This is the first part of a bigger refactoring aiming to tackle #4808
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
functionality, content, code)
(if there are no user facing changes, use release note "NONE")
Release Notes