-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Go workspaces for k/k and k/staging/* #123529
Conversation
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.
/lgtm
/approve
One non-blocking nit, unhold at will. May the rebase conflict odds be ever in your favor.
_KUBE_OUTPUT_SUBPATH="${KUBE_OUTPUT_SUBPATH:-_output/local}" | ||
export KUBE_OUTPUT="${KUBE_ROOT}/${_KUBE_OUTPUT_SUBPATH}" |
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.
non-blocking nit, could be a follow-up cleanup, but this would get you one less ambient bash var:
_KUBE_OUTPUT_SUBPATH="${KUBE_OUTPUT_SUBPATH:-_output/local}" | |
export KUBE_OUTPUT="${KUBE_ROOT}/${_KUBE_OUTPUT_SUBPATH}" | |
export KUBE_OUTPUT="${KUBE_ROOT}/${KUBE_OUTPUT_SUBPATH:-_output/local}" |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dims, liggitt, thockin 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 |
/unhold Fire in the hole! |
Live picture of @thockin !! |
What's the over/under on time to first explosion? |
@thockin - as soon as |
/honk |
In response to this:
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 cannot figure how to load the github UI for this comment - it just
doesn't work. So I will reply by email and see if ti works
At the time of removal it was an exact duplicate. The PR has a lot of
commits :)
`--trim-path-prefix` has no meaning anymore. The way that packages and
paths are processed in Go workspaces is TOTALLY different than what we were
doing before. There's no more "read a package name, glue a directory to
the front of it, then strip a prefix" sort of logic. The bad news is that
it's a break and I don't see how to fix it. The good news is that the new
approach is better in every way.
`--input-dirs` was "cleaned up" because it makes callers easier and "this
is a breaking change anyway".
I know that my excuses are little comfort - I am sorry that some consumers
are broken, but I spent months trying to find a way to fix this without a
break, and I failed. If you need to old behavior, you can pin to the older
tags of k8s.io/code-generator until you are ready.
… Message ID: <kubernetes/kubernetes/pull/123529/review/2062602093
***@***.***>
|
Thanks, I figured out that the flags were changed for all commands (not just openapi-gen) after I posted the question and removed my comment because of that (sorry for the confusion). For future reference: the flags changed in a breaking way, but all functionality is still there. |
Fixes: ``` go: 'go mod vendor' cannot be run in workspace mode. Run 'go work vendor' to vendor the workspace or set 'GOWORK=off' to exit workspace mode. ``` Kubernetes project has moved to using go workspaces kubernetes/kubernetes#123529 Signed-off-by: Priyanka Saggu <[email protected]>
New import path - k8s.io/utils/cpuset kubernetes/kubernetes#116761 Signed-off-by: Priyanka Saggu <[email protected]> update import path for cpuset module New import path - k8s.io/utils/cpuset kubernetes/kubernetes#116761 Signed-off-by: Priyanka Saggu <[email protected]> update `go mod vendor` to `go work vendor` Fixes: ``` go: 'go mod vendor' cannot be run in workspace mode. Run 'go work vendor' to vendor the workspace or set 'GOWORK=off' to exit workspace mode. ``` Kubernetes project has moved to using go workspaces kubernetes/kubernetes#123529 Signed-off-by: Priyanka Saggu <[email protected]> remove btf fuzzer reference github.com/cilium/ebpf/internal/btf fuzzer tests are not present in this path. TODO: commenting it to test ebpf whether fuzz tests are now fixed. Signed-off-by: Priyanka Saggu <[email protected]> disable `FuzzParseQuantity` fuzz target To bypass the following error, will get back to it later. ``` + compile_native_go_fuzzer k8s.io/kubernetes/test/fuzz/fuzzing FuzzParseQuantity fuzz_parse_quantity ../../../../pkg/kubelet/util/swap/swap_util.go:45: invalid argument: index 5 out of bounds [0:5] ../../../../pkg/kubelet/util/swap/swap_util.go:45: invalid argument: index 6 out of bounds [0:5] ../../../../pkg/kubelet/util/swap/swap_util.go:113: invalid argument: index 5 out of bounds [0:5] ../../../../pkg/kubelet/util/swap/swap_util.go:113: invalid argument: index 6 out of bounds [0:5] 2024/06/08 14:22:11 failed to build packages:exit status 1 ``` Signed-off-by: Priyanka Saggu <[email protected]> disabling import of k8s.io/kubernetes/pkg/kubelet/cm Signed-off-by: Priyanka Saggu <[email protected]>
@thockin
|
This is not a good place for such questions. Please use Slack the next time. You are asking for a command in the Could |
KEP: kubernetes/enhancements#4402
This is a new PR based on #122624, to clear the lengthy history.
What is it?
The main Kubernetes git repo (github.com/kubernetes/kubernetes, colloquially called "k/k") is the embodiment of evolution. When it was created, the only way to build Go applications was GOPATH. Over time we built tooling which understood GOPATH, and it leaked into many parts of our build, test, and release systems. Then Go added modules, in part because GOPATH was unpleasant and had a tendency to leak into tools. We adopted modules, but we also added the idea of "staging" repositories - a way to eat our cake and have, too. We get the benefits of a monorepo (atomic commits, fast iteration across repos) and then publish those to standalone repos for downstream consumption. To make this work with modules, we abused GOPATH even harder and wrote even more tools.
The Go project saw what we (and others) were doing and did not like it. So they created workspaces. They basically created a solution that is purpose-built for us.
Let's use it.
On reviewing: Review each commit individually. This PR was crafted in lock-step with a series of gengo commits, but since those are merged and gengo is in a different repo, we can't really see those any more. This means that a lot of things don't work at each commit in this PR. This is the only way this could be a sane PR to review though (if you call this sane).
I fully expect that once this merges we will find a long-tail of out-of-tree impacts (tests which need to use go 1.22, etc).
One major aspect of this is code-generation. It's FAR simpler now, but how does it perform? After factoring out build time (by doing a full build first) we can see it has little impact:
before:
after:
/kind bug
/kind cleanup
/kind feature
/kind api-change