Commit Graph

580 Commits

Author SHA1 Message Date
Akihiro Suda
f6e2ea7b96 build/common.sh: fix support for Rootless Docker
In the case of Rootless mode, `docker run` should not be
invoked with `--user`.

Fix issue 134669

Regression in PR 134510

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-10-20 20:21:05 +09:00
Benjamin Elder
5b9b8ec732 make localtime mount readonly 2025-10-16 10:26:13 -07:00
Benjamin Elder
feeeb4aa19 switch from rsync to cp, drop rsync requirement 2025-10-16 10:26:13 -07:00
Benjamin Elder
e71aa02f96 we no longer need to delete old docker images as we don't build a build-image anymore, we use pre-built kube-cross 2025-10-16 10:26:13 -07:00
Benjamin Elder
ff0a5fff38 cleanup lingering references to kube-build
.... excluding build container name and kube-cross version

TODO: build/build-image/cross/VERSION should probably just be a variable in the shell script
2025-10-16 10:26:13 -07:00
Kubernetes Prow Robot
fa19b99377 Merge pull request #134619 from chrischdi/pr-fixup-build-in-kube-cross-kube-git-version-file
build: build by running kube-cross directly should leverage a potential KUBE_GIT_VERSION_FILE
2025-10-15 17:19:34 -07:00
Christian Schlotter
bec429cd96 Review fixes 2025-10-15 18:57:34 +02:00
Christian Schlotter
8a43852c35 build: build by running kube-cross directly should leverage a potential KUBE_GIT_VERSION_FILE 2025-10-15 13:48:00 +02:00
Carlos Panato
15154374bc Bump images, dependencies and versions to go 1.25.3 and distroless iptables
Signed-off-by: Carlos Panato <ctadeu@gmail.com>
2025-10-15 09:41:57 +02:00
Benjamin Elder
7d2309f059 cleanup unused rsync utilities 2025-10-13 09:47:24 -07:00
Benjamin Elder
faa62c8ce6 cleanup KUBE_RSYNC_CONTAINER*, KUBE_DATA_CONTAINER*, DOCKER_MOUNT_ARGS 2025-10-13 09:47:24 -07:00
Benjamin Elder
36526c3815 delete more now-unused shell functions 2025-10-13 09:47:24 -07:00
Benjamin Elder
5a05c062c3 delete now unused kube::build::copy_output and kube::build::build_image 2025-10-13 09:47:24 -07:00
Benjamin Elder
581012fe06 build by running kube-cross directly
eliminate rsync dance, data container, and building a build image every time
2025-10-13 09:47:21 -07:00
Davanum Srinivas
e8d512d822 extract build vars setup into reusable function
pulled out all the build variable setup stuff from verify_prereqs into its own function since we need those vars in other places too (like make-clean)
2025-10-12 14:22:40 -04:00
Benjamin Elder
efda517d93 speed up make clean by narrowing recursive chmod 2025-10-09 16:55:36 -07:00
Kubernetes Prow Robot
8f372d2ac0 Merge pull request #133972 from pohly/build-data-race-detection-image
build: automatically choose a suitable base image
2025-09-30 12:32:16 -07:00
Davanum Srinivas
6dbc13fd13 Bump to go1.25.1 based images 2025-09-16 22:42:29 -04:00
Davanum Srinivas
3fc0498d6e Bump distroless-iptables to v0.7.8 2025-09-16 17:16:06 -04:00
Patrick Ohly
bbf896c35b build: automatically choose a suitable base image
When building some command dynamically through KUBE_CGO_OVERRIDES, the base
image for that command must provide a libc which matches what the command was
compiled against. If the runtime libc is too old, then it might not have the
right ABI (missing symbols or wrong version of those symbols).

A user or job shouldn't need to know which of the different Kubernetes images
is the right one, therefore the build scripts now use the same image that was
previously only used for kube-proxy also for other commands if they get build
dynamically. This does not increase the maintenance effort because a single
image bump remains sufficient and for e.g. a kind cluster it doesn't matter
that the kube-proxy base image is slightly larger than necessary for the other
commands - it only needs to be present once in the node image.
2025-09-12 12:12:26 +02:00
Patrick Ohly
23362e001c build: support -race in binaries
Since a few releases, Go supports `go build -race` and then produces
binaries which do data race detection when invoked. Some changes are needed to
enable using this in a kind cluster:

- `-race` must be passed when building dynamically linked binaries.
  Only those support -race because CGO is required.
  To avoid adding yet another env variables, the existing KUBE_RACE
  gets used to convey the intent.
- KUBE_RACE must be passed into the dockerized build.
- Logging the base image of a release image makes it easier
  to figure out whether the binary has a chance to run.

The base image is important because dynamically linked binaries need a base
image with libc. By default, control plane components are linked statically,
so users need to explicitly override the defaults:

    KUBE_RACE=-race KUBE_CGO_OVERRIDES="kube-apiserver kube-controller-manager kube-scheduler" KUBE_GORUNNER_IMAGE=gcr.io/k8s-staging-test-infra/kubekins-e2e:v20250815-171060767f-master kind build node-image ...

KUBE_GORUNNER_IMAGE changes the base image for kube-apiserver,
kube-controller-manager and kube-scheduler. The kubekins image was picked for
this example because a Prow job definition already uses it. Reusing
it in a job avoids the need to maintain another image definition.

Running conformance tests against such a cluster with alpha+beta features
enabled revealed one new data race:

    $ kubectl logs -n kube-system kube-controller-manager-kind-control-plane
    ...
    WARNING: DATA RACE
    Write at 0x00c00019a730 by goroutine 216:
    k8s.io/client-go/tools/leaderelection.(*LeaderElector).setObservedRecord()
         k8s.io/client-go/tools/leaderelection/leaderelection.go:529 +0x179
    k8s.io/client-go/tools/leaderelection.(*LeaderElector).tryCoordinatedRenew()
         k8s.io/client-go/tools/leaderelection/leaderelection.go:367 +0x5ca
    ...
2025-09-02 16:32:09 +02:00
Benjamin Elder
5a718ca28c remove stale Godeps filter from rsync 2025-08-26 18:24:24 -07:00
Benjamin Elder
d4e1d13480 add note about not adding to rsync invocations 2025-08-26 18:10:33 -07:00
Benjamin Elder
33a58e4bef stop excluding GOPATH from rsync
we aim to eliminate the rsync in favor of a bind mount eventually, adding new filters makes this harder
2025-08-26 18:10:32 -07:00
Carlos Panato
020b7052ca Bump dependencies, images and versions used to Go 1.24.6 and distroless iptables
Signed-off-by: Carlos Panato <ctadeu@gmail.com>
2025-08-14 09:46:06 +02:00
Carlos Panato
a06b3d356c Bump dependencies, images and versions used to Go 1.24.5 and distroless iptables
Signed-off-by: Carlos Panato <ctadeu@gmail.com>
2025-07-11 20:30:39 +02:00
Carlos Panato
e5f36796e3 Bump dependencies, images and versions used to Go 1.24.4 and distroless iptables
Signed-off-by: Carlos Panato <ctadeu@gmail.com>
2025-06-11 08:24:35 +02:00
Carlos Panato
488c94735c Bump dependencies, images and versions used to Go 1.24.3 and distroless iptables
Signed-off-by: Carlos Panato <ctadeu@gmail.com>
2025-05-23 08:58:13 -04:00
Arnaud Meukam
e467c9530b [Go] Bump dependencies, images and versions used to Go 1.24.2 and distroless-iptables
Signed-off-by: Arnaud Meukam <ameukam@gmail.com>
2025-04-18 15:49:48 +02:00
Rajalakshmi-Girish
5402baf4a2 Fix KUBE_BUILD_IMAGE_CROSS_TAG mismatch when KUBE_CROSS_VERSION is passed 2025-03-17 11:20:07 -07:00
cpanato
597b54720e Bump images, dependencies and versions to go 1.24.0
Signed-off-by: cpanato <ctadeu@gmail.com>
2025-02-26 11:26:54 +01:00
cpanato
8ee64ba6b5 Bump images, dependencies and versions to go 1.23.6 and distroless iptables
Signed-off-by: cpanato <ctadeu@gmail.com>
2025-02-10 14:04:37 -06:00
cpanato
0ca45bd4f8 Bump images, dependencies and versions to go 1.23.5 and distroless iptables
Signed-off-by: cpanato <ctadeu@gmail.com>
2025-02-03 18:26:38 +01:00
cpanato
2cb1cc9e3a Bump images, dependencies and versions to go 1.23.4 and distroless iptables
Signed-off-by: cpanato <ctadeu@gmail.com>
2024-12-30 09:05:16 +01:00
cpanato
cb42224952 Bump images, dependencies and versions to go 1.23.3 and distroless iptables
Signed-off-by: cpanato <ctadeu@gmail.com>
2024-11-19 09:57:41 +01:00
Kubernetes Prow Robot
5ffb0528dd Merge pull request #126214 from 20202200/20202200-patch-1
Fix a spelling error of hash in the description of the build script
2024-10-23 11:00:52 +01:00
Haitao Chen
e9cbbc7886 bump golang to 1.23.2
from 1.23.0
2024-10-15 18:43:50 -07:00
Marko Mudrinić
5572625d87 Revert "Merge pull request #127611 from haitch/haitao/k132-on-go123p1"
This reverts commit 37004f89b0, reversing
changes made to af879aebb1.
2024-10-04 19:11:07 +02:00
Haitao Chen
2f906a0c02 bump golang to 1.23.1
revert rest of the changes other than default-go-version
2024-09-28 21:41:03 -07:00
cpanato
e09c28ec69 update debian-base and setcap to bookworm-v1.0.4
Signed-off-by: cpanato <ctadeu@gmail.com>
2024-09-05 14:09:04 -06:00
cpanato
b0c17b124f Bump images, dependencies and versions to go 1.23.0
Signed-off-by: cpanato <ctadeu@gmail.com>
2024-09-02 10:42:04 -06:00
ArkaSaha30
d1dfeed505 Revert "Bump images, dependencies and versions to go 1.23rc1"
This reverts commit 5c269fecf8.
2024-07-29 13:55:03 +05:30
ArkaSaha30
c203b120c0 Revert "Bump images, dependencies and versions to go 1.23rc2"
This reverts commit 9d5a7ff859.
2024-07-29 13:54:16 +05:30
cpanato
9d5a7ff859 Bump images, dependencies and versions to go 1.23rc2
Signed-off-by: cpanato <ctadeu@gmail.com>
2024-07-19 11:33:28 +02:00
cpanato
5c269fecf8 Bump images, dependencies and versions to go 1.23rc1
Signed-off-by: cpanato <ctadeu@gmail.com>
2024-07-19 11:33:24 +02:00
AspirationalStride
a727522fa4 Update common.sh
A spelling error in the description of a word
2024-07-19 09:23:54 +08:00
cpanato
0e9308f3bc Bump images, dependencies and versions to go 1.22.5 and distroless iptables
Signed-off-by: cpanato <ctadeu@gmail.com>
2024-07-04 16:34:18 +02:00
cpanato
a3b193c6e9 [go] Bump images, dependencies and versions to go 1.22.4 and distroless iptables/setcap/debian-base
Signed-off-by: cpanato <ctadeu@gmail.com>
2024-06-06 18:13:15 +02:00
Kubernetes Prow Robot
9fc0315ce8 Merge pull request #125272 from mauri870/hotfix/GOTOOLCHAIN-make-verify
build: don't copy GOPATH out of docker container
2024-06-02 05:09:58 -07:00
Mauri de Souza Meneguzzo
c1238f345a build: don't copy GOPATH out of docker container
When using GOTOOLCHAIN with make verify the build results copied out of
the dockerized environment contains a go toolchain folder that is
write protected. In order to prevent failures during the cleanup step
opt-out of copying $GOPATH to the host.
2024-06-01 22:09:13 -03:00