Skip to content

Build k8s using latest commit of golang #132197

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

Conversation

dims
Copy link
Member

@dims dims commented Jun 9, 2025

Run "gimme master" and use the newly built binaries. Adjust GOROOT_BOOTSTRAP so we can use the golang that is already on disk to build the new commit from golang.

To enable this, edit .go-version and set the version to

devel

and then run make quick-release (for example)

/kind cleanup

Context: please see kubernetes/test-infra#34918, We currently build a full kube-cross image when it is not really needed at all. It's flaky and we get throttled and it's a mess!. Since we already allow building against different versions of golang, we should just ensure we support this use case as well.

What type of PR is this?

What this PR does / why we need it:

Which issue(s) this PR is related to:

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jun 9, 2025
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the needs-priority Indicates a PR lacks a `priority/foo` label and requires one. label Jun 9, 2025
@dims
Copy link
Member Author

dims commented Jun 9, 2025

/assign @liggitt @BenTheElder

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 9, 2025
@@ -524,6 +524,15 @@ kube::golang::internal::verify_go_version() {
if [ "${GOTOOLCHAIN:-auto}" != 'auto' ]; then
# no-op, just respect GOTOOLCHAIN
:
elif [ "${GO_VERSION:-}" == 'devel' ]; then
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 sort of hoping we could move towards the GOTOOLCHAIN standard, we have a lot of ways to configure this currently, and it would be nice to rely on go tooling instead of shell/gimmee when possible.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

possibly, i was trying to stay within the current boundaries and not introduce more things.

Copy link
Member Author

Choose a reason for hiding this comment

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

we can open an issue and ask for help if needed.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done! #132204

Copy link
Member

Choose a reason for hiding this comment

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

This still means we've just expanded the surface area of GO_VERSION.

Is devel a typical name for this in go?

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

and i did not want to use "master"

Copy link
Member

Choose a reason for hiding this comment

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

ACK. I just worry a little bit about the behemoth of an "API" we have around this, it's kind of like cluster/, very hard to improve because the user API is poorly defined. GOTOOLCHAIN got us close to removing this bit.

@@ -314,8 +314,10 @@ _setup_bootstrap() {
# _compile "dir"
_compile() {
(
if grep -q GOROOT_BOOTSTRAP "${1}/src/make.bash" &>/dev/null; then
_setup_bootstrap || return 1
if [[ -z "${GOROOT_BOOTSTRAP}" ]]; then
Copy link
Member

Choose a reason for hiding this comment

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

is there an upstream commit we should sync to instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

I did not see any changes in this area in upstream @BenTheElder. They had only updated the list of versions above.

Copy link
Member

Choose a reason for hiding this comment

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

previously this code wasn't actually modified IIRC, only copied locally so we don't have to curl | bash

Copy link
Member

Choose a reason for hiding this comment

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

we should probably document any changes we make and consider upstreaming them

Copy link
Member Author

Choose a reason for hiding this comment

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

pretty static repo, but will try - https://github.com/travis-ci/gimme/commits/master

@dims dims force-pushed the support-building-k8s-using-go-tip-master branch from 0126604 to 71817d6 Compare June 9, 2025 20:59
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dims

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

@dims
Copy link
Member Author

dims commented Jun 9, 2025

/sig testing

@k8s-ci-robot k8s-ci-robot added sig/testing Categorizes an issue or PR as relevant to SIG Testing. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jun 9, 2025
@dims dims changed the title Build k8s using latest commit of golang [WIP] Build k8s using latest commit of golang Jun 9, 2025
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 9, 2025
Run "gimme master" and use the newly built binaries. Adjust
GOROOT_BOOTSTRAP so we can use the golang that is already
on disk to build the new commit from golang.

To enable this, edit `.go-version` and set the version to
```
devel
```

and then run `make quick-release` (for example)

Signed-off-by: Davanum Srinivas <[email protected]>
@dims dims force-pushed the support-building-k8s-using-go-tip-master branch from 71817d6 to c85ac59 Compare June 9, 2025 21:41
@dims dims changed the title [WIP] Build k8s using latest commit of golang Build k8s using latest commit of golang Jun 9, 2025
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 9, 2025
@dims dims mentioned this pull request Jun 10, 2025
@dims
Copy link
Member Author

dims commented Jun 10, 2025

@BenTheElder opened #132204 for follow up.

/assign @ameukam @upodroid

Are you ok landing this please? need to get back to kubernetes/test-infra#34918 once this lands

@ameukam
Copy link
Member

ameukam commented Jun 10, 2025

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 10, 2025
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 1aaa61079cb2386bd67ffcdc172bd129c1c3f97e

@k8s-ci-robot k8s-ci-robot merged commit 1a200ab into kubernetes:master Jun 10, 2025
15 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.34 milestone Jun 10, 2025
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. release-note-none Denotes a PR that doesn't merit a release note. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants