-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[v2] Add builtin kpt (Go1.16) #6367
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
Conversation
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
Blocked by docker/golang-cross docker/golang-cross#54 docker/golang-cross#64 |
Discussed with @yuwenma separately, but embedding kpt (a ~50mb) binary is not really a workable solution. We have a similar request around We do include a reasonably up-to-date kpt in the |
} | ||
|
||
func getKptInstallPath() string { | ||
paths := filepath.SplitList(os.Getenv("PATH")) |
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.
as a user, I'd prefer skaffold not to install something to PATH[0] on my computer. PATH[0] has no significance as far as I know. on my machine it points to /Users/ahmetb/.krew/bin
:) and most devs will make similar edits to PATH.
|
||
// UseBuiltinKpt guarantees the `kpt` always exists in $PATH/bin. `kpt` is needed in skaffold render. | ||
func UseBuiltinKpt() error { | ||
err := os.WriteFile(getKptInstallPath(), kpt, os.ModePerm) |
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.
would it be better to
- create tmpdir (+defer delete)
- write kpt there + chmod
- update running process's env via os.Setenv and add tmpdir
- now the os/exec should be running kpt via tmpdir?
Currently this is blocked on - #6790. @briandealwis do we have plans on prioritizing updating skaffold's CI & release process to use go1.16 in an upcoming milestone? |
Turning Skaffold from a 50MB → 100MB+ binary is not a workable solution and needs to be rethought. We can have a skaffold+kpt .tar.gz/.zip bundle. |
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.
ok
This comment was marked as spam.
This comment was marked as spam.
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.
ok
This comment was marked as spam.
This comment was marked as spam.
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.
ok
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.
ok
closing this PR. Lets address this once we decide to distribute kpt via skaffold. |
Related: #5673
Description
Some skaffold CMDs (e.g.
render
,dev
,run
) requires kpt CLI to hydrate the manifests. In case users do not havekpt
or the rightkpt
version installed, we embed the kpt executable in the skaffold CLI, and installs for users if and only if a kpt executable is required but not found. This gives current skaffold users a smoother experience when switching to v2The matching kpt OS and Arch will be decided in skaffold build (
make install
) and copied to pkg/skaffold/render/embed/kpt before building skaffold.This builtin kpt uses the Go 1.16 "embed" feature
PR is tested manually. No unittests (since it requires different OS and ARC), integration tests are needed.