-
Notifications
You must be signed in to change notification settings - Fork 4.2k
cleanup(vpa): remove go vendoring #7572
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
Merged
k8s-ci-robot
merged 5 commits into
kubernetes:master
from
davidspek:feat/vpa-remove-go-mod
Dec 9, 2024
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
0b6e7be
cleanup(vpa): remove vendor directory
davidspek 41c6eee
cleanup(vpa): add gitignore for vendor
davidspek f3a50a7
cleanup: tidy go mod
davidspek 99e2f7f
fix(vpa): update dockerfiles to work without vendor
davidspek 82908da
fix: undo change to nonroot distroless
davidspek File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
# vendor directories | ||
vendor/ | ||
e2e/vendor/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 0 additions & 20 deletions
20
vertical-pod-autoscaler/vendor/github.com/beorn7/perks/LICENSE
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Could we replace all these copy statements with just one?
COPY . .
Similar to https://github.com/GoogleContainerTools/distroless?tab=readme-ov-file#examples-with-docker?
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 reason for these separate copy statements is to maximize layer caching. First copying the
go.mod
andgo.sum
and then downloading the dependencies before before copying any application code allows the layer containing all the dependencies to be cached during a container build. This can make a big difference for build times, especially when doing development. For this same reason the Go code is being explicitly copied into the container instead of a more global copy so that changes to other files (or the addition of new ones) that aren't part of the codebase don't trigger a new image build. Technically this could also be done with a.dockerignore
file, but then any new files or directories would need to be added there, and in my opinion having it copied in the Dockerfile explicitly also helps for clarity. This is also the standard way Dockerfiles are created for projects usingkubebuilder
and I believe can be seen as best practice.Uh oh!
There was an error while loading. Please reload this page.
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.
What about:
And later:
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.
That should also work, although technically a little less good for layer caching.
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.
Since both operations are a copy, I don't think there will be a noticeable different to the user if one those layers had to be re executed
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.
@raywainman What's your view on this? I'd like to get this sorted so it can be merged and we can move forward with the dependency upgrade PR.
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.
Layer caching seems like a reasonable reason to do this. LGTM.