Commit Graph

121913 Commits

Author SHA1 Message Date
Tim Hockin
35aa5b3c69
Change verify-fieldname-docs to new setup_env 2024-02-29 22:06:09 -08:00
Tim Hockin
0d30f918fa
Change verify-description to new setup_env 2024-02-29 22:06:08 -08:00
Tim Hockin
bad67dc973
Fix golangci-lint for workspaces 2024-02-29 22:06:07 -08:00
Tim Hockin
3163fc4f69
Change update-golangci-lint-config to new setup_env 2024-02-29 22:06:06 -08:00
Tim Hockin
714f8a0855
Change verify-yamlfmt to new setup_env 2024-02-29 22:06:06 -08:00
Tim Hockin
3dc447708b
Change verify-gofmt to new setup_env 2024-02-29 22:06:05 -08:00
Tim Hockin
d785f13c05
Change verify-licenses to new setup_env 2024-02-29 22:06:04 -08:00
Tim Hockin
974276e4a0
Change update-openapi-spec to new setup_env 2024-02-29 22:06:03 -08:00
Tim Hockin
2ee339b023
Simplify verify-cli-conventions; use new setup_env 2024-02-29 22:06:02 -08:00
Tim Hockin
2924b90d75
Change verify-api-groups.sh to s/vendor/staging/
I'm really not sure what this particular file check is doing, but that's
for tomorrow.
2024-02-29 22:06:01 -08:00
Tim Hockin
b725fd20c2
Fix update/verify-mocks.sh
There appears to be a bug in `go generate` for workspaces which will be
fixed in the 1.22.1 release.
2024-02-29 22:06:00 -08:00
Tim Hockin
58ab5eea89
Remove some references to GOPATH 2024-02-29 22:05:59 -08:00
Tim Hockin
5f490b4fe8
Clarify, document KUBE_OUTPUT_* variables 2024-02-29 22:05:42 -08:00
Kubernetes Prow Robot
3df07e446b
Merge pull request #123599 from bobbypage/bump-cadvisor-v0.49.0
Bump cAdvisor to v0.49.0
2024-02-29 21:51:47 -08:00
Kubernetes Prow Robot
6f42da171b
Merge pull request #123565 from ah8ad3/update-help-text-kubectl-create-token
Implement to accept zero as a default value for kubectl create token duration
2024-02-29 21:51:41 -08:00
Oleg Guba
e6dd36759f [kubernetes/scheduler] use lockless diagnosis collection in findNodesThatPassFilters 2024-02-29 20:43:50 -08:00
Kubernetes Prow Robot
5fd3bc076b
Merge pull request #123603 from pacoxu/patch-11
fix UT failure TestPrintIPAddressList
2024-02-29 20:18:18 -08:00
Paco Xu
e9b30a0d29 fix UT failure TestPrintIPAddressList 2024-03-01 11:15:36 +08:00
Kubernetes Prow Robot
5cf4fbe524
Merge pull request #123458 from aramase/aramase/i/min_jwt_payload
add min valid jwt payload to API docs for structured authn config
2024-02-29 15:11:40 -08:00
Kubernetes Prow Robot
56a1b075cd
Merge pull request #122870 from wzshiming/kep-2681
Promote KEP-2681 to GA in 1.30
2024-02-29 15:11:33 -08:00
David Porter
c05e541793 Bump cAdvisor to v0.49.0
Signed-off-by: David Porter <david@porter.me>
2024-02-29 14:21:49 -08:00
Kubernetes Prow Robot
0d50a398df
Merge pull request #123598 from liggitt/remotecommand-cleanup
Remotecommand test flake cleanup
2024-02-29 13:40:48 -08:00
Jordan Liggitt
6c1a935da2
Keep streams from being set up after closeAllStreamReaders is called 2024-02-29 15:31:55 -05:00
Igor Velichkovich
a51a5b4622 kep-3716 GA, remove feature gate 2024-02-29 14:14:19 -06:00
Jordan Liggitt
26484df210
Make websocket heartbeat test timing less flaky 2024-02-29 15:10:28 -05:00
Jordan Liggitt
fc86811cbe
Avoid logging binary junk for frame write failure 2024-02-29 15:09:34 -05:00
Jiahui Feng
e257522889 add transient types to admission test. 2024-02-29 12:08:43 -08:00
Kubernetes Prow Robot
4c71261872
Merge pull request #123095 from reinka/test/eviction-manager-pid-pressure
add unit test for eviction manager pid pressure
2024-02-29 11:55:28 -08:00
Kubernetes Prow Robot
67a06c2056
Merge pull request #122293 from mengjiao-liu/controller-reconsider-log-verbosity
kube-controller-manager: readjust log verbosity
2024-02-29 11:55:21 -08:00
Anish Ramasekar
b57d7d6ad7
add min valid jwt payload to API docs for structured authn config
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
2024-02-29 11:08:39 -08:00
Kubernetes Prow Robot
d8122df1b7
Merge pull request #123555 from neolit123/1.30-fix-apiserver-authz-arg-defaulting
kubeadm: fix a bug in defaulting apiserver "authorizaion-mode"
2024-02-29 09:49:08 -08:00
Kubernetes Prow Robot
3718932d9a
Merge pull request #123590 from aojea/revert-123310-update/dns/v1.23.0
Revert "Update kubedns and nodelocaldns to v1.23.0"
2024-02-29 07:48:36 -08:00
Antonio Ojea
8b035cd582
Revert "Update kubedns and nodelocaldns to v1.23.0" 2024-02-29 15:40:49 +01:00
Kubernetes Prow Robot
331ced5606
Merge pull request #123579 from pohly/scheduler-perf-create-strict-validation
scheduler_perf: fail when input YAML is invalid
2024-02-29 05:05:52 -08:00
Kubernetes Prow Robot
03f24068da
Merge pull request #123341 from neolit123/1.30-health-check-all-cp-components
kubeadm: introduce the WaitForAllControlPlaneComponents feature gate
2024-02-29 05:05:42 -08:00
Sascha Grunert
e38531e9a2
Add image_id to CRI ContainerStatus message
There is a conversion function `ConvertPodStatusToRunningPod`, which
can override the `Container.ImageID` into a digested reference from the
`ContainerStatus` CRI RPC, which gets mapped from the `image_ref`:

411c29c39f/pkg/kubelet/container/helpers.go (L259-L292)

To avoid that failure case, we now introduce the same `image_id` into
the container status and let runtimes separate the fields.

We also add a note that the mapping from the digested reference of the
CRI to the Kubernetes Pod API `ImageID` field is intentional and should
not change.

Follow-up on: https://github.com/kubernetes/kubernetes/pull/123508

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2024-02-29 12:41:55 +01:00
Kubernetes Prow Robot
70383f3701
Merge pull request #119561 from payall4u/fix-kubelet-panic-when-allocate-device
Fix kubelet panic when allocate resource for pod.
2024-02-29 03:06:54 -08:00
Sunil Shivanand
e6ed0f37c6 Add apiserver_watch_cache_read_wait metric to cache refresh time
Signed-off-by: Sunil Shivanand <padlar@live.com>
2024-02-29 11:07:13 +01:00
Kubernetes Prow Robot
411c29c39f
Merge pull request #123331 from aojea/ccm_update
CCM wait for providerID to initialize the Node object
2024-02-29 01:50:02 -08:00
Kubernetes Prow Robot
234f0fcfc3
Merge pull request #122676 from p0lyn0mial/upstream-watch-cache-init-events-ordering
apiserver/storage: improve RunWatchSemanticInitialEventsExtended test
2024-02-29 01:49:48 -08:00
Patrick Ohly
d6851ec735 scheduler_perf: fail when input YAML is invalid
The YAML files get decoded into an unstructured object, without validation, and
then sent to the apiserver with a generic client. The default behavior is to
issue a warning to the client, which gets logged by client-go. What we want
instead is an error that causes the test to fail in a clean way right at the
beginning.
2024-02-29 09:53:16 +01:00
Tim Hockin
f47e0cb779
Rename KUBE_OUTPUT_BINPATH -> KUBE_OUTPUT_BIN
"...PATH" doesn't add anything and confuses it with KUBE_OUTPUT_SUBPATH.
2024-02-29 00:22:14 -08:00
Tim Hockin
aaf6fc07d8
Make build scripts use Go import paths
This helps 2 things:
1) output is cleaner
2) whether a build is static or non-static depends on string matching,
   which is easier after this

If you specify a `...` pattern, this will preserve it, which breaks the
static/non-static matching but really, can we just agree that `make` is
for binaries?  It works for other things but so does `go build`.

Example:

```
$ make WHAT="cmd/kubectl/ ./staging/src/k8s.io/api/... ./test/e2e/e2e.test ./test/e2e/e2e.test ./cmd/kubectl/ "
go version go1.21.4 linux/amd64
+++ [1208 22:24:43] Building go targets for linux/amd64
    k8s.io/api/... (non-static)
    k8s.io/kubernetes/cmd/kubectl (static)
    k8s.io/kubernetes/test/e2e/e2e.test (test)
```
2024-02-29 00:22:13 -08:00
Tim Hockin
f3c8e92def
Clean up test.sh and get rid of GOPATH
Result: `make test` works:

```
$ #### BUILD ####

$ make WHAT="./cmd/kubectl/ ./staging/src/k8s.io/api"
+++ [1211 11:20:46] Building go targets for linux/amd64
    ./cmd/kubectl/ (non-static)
    ./staging/src/k8s.io/api (non-static)

$ #### TEST ####

$ make test WHAT=./pkg/proxy/iptables/
+++ [1211 11:22:31] Set GOMAXPROCS automatically to 6
+++ [1211 11:22:31] Running tests without code coverage and with -race
ok  	k8s.io/kubernetes/pkg/proxy/iptables	9.517s

$ make test WHAT=pkg/proxy/iptables/
+++ [1211 11:22:53] Set GOMAXPROCS automatically to 6
+++ [1211 11:22:53] Running tests without code coverage and with -race
ok  	k8s.io/kubernetes/pkg/proxy/iptables	(cached)

$ make test WHAT=k8s.io/kubernetes/pkg/proxy/iptables/
+++ [1211 11:23:09] Set GOMAXPROCS automatically to 6
+++ [1211 11:23:09] Running tests without code coverage and with -race
ok  	k8s.io/kubernetes/pkg/proxy/iptables	(cached)

$ make test WHAT=./staging/src/k8s.io/api
+++ [1211 11:23:24] Set GOMAXPROCS automatically to 6
+++ [1211 11:23:24] Running tests without code coverage and with -race
ok  	k8s.io/api	21.981s

$ make test WHAT=staging/src/k8s.io/api
+++ [1211 11:23:54] Set GOMAXPROCS automatically to 6
+++ [1211 11:23:54] Running tests without code coverage and with -race
ok  	k8s.io/api	(cached)

$ make test WHAT=k8s.io/api
+++ [1211 11:24:06] Set GOMAXPROCS automatically to 6
+++ [1211 11:24:06] Running tests without code coverage and with -race
ok  	k8s.io/api	(cached)
```
2024-02-29 00:22:13 -08:00
Tim Hockin
8cb8535d9c
Excise KUBE_GOPATH from coverage build 2024-02-29 00:22:12 -08:00
Tim Hockin
0af3106442
Dedup binaries when building 2024-02-29 00:22:11 -08:00
Tim Hockin
9256031a87
Workspaces: excise vendor from golang.sh
```
$ make
go version go1.20.4 linux/amd64
+++ [0506 13:21:33] Building go targets for linux/amd64
    ./cmd/kube-proxy (static)
    ./cmd/kube-apiserver (static)
    ./cmd/kube-controller-manager (static)
    ./cmd/kubelet (non-static)
    ./cmd/kubeadm (static)
    ./cmd/kube-scheduler (static)
    ./staging/src/k8s.io/component-base/logs/kube-log-runner (static)
    ./staging/src/k8s.io/kube-aggregator (static)
    ./staging/src/k8s.io/apiextensions-apiserver (static)
    ./cluster/gce/gci/mounter (non-static)
    ./cmd/kubectl (static)
    ./cmd/kubectl-convert (static)
    github.com/onsi/ginkgo/v2/ginkgo (non-static)
    ./test/e2e/e2e.test (test)
    ./test/conformance/image/go-runner (non-static)
    ./cmd/kubemark (static)
    github.com/onsi/ginkgo/v2/ginkgo (non-static)
    ./test/e2e_node/e2e_node.test (test)
```

before:
real	4m31.100s
user	21m1.466s
sys	2m23.546s

after:
real	3m46.591s
user	16m34.665s
sys	2m1.553s
2024-02-29 00:22:10 -08:00
Tim Hockin
df42d56947
Remove vendor from ldflags 2024-02-29 00:22:09 -08:00
Tim Hockin
81d932906a
Make golang::binaries_from_targets smarter
and use it from test

Result: `make` works, but `make test` still broken

```
$ make kubectl
+++ [1211 11:15:46] Building go targets for linux/amd64
    ./cmd/kubectl (static)

$ make WHAT=./cmd/kubectl/
+++ [1211 11:15:53] Building go targets for linux/amd64
    ./cmd/kubectl/ (non-static)

$ make WHAT=cmd/kubectl/
+++ [1211 11:16:02] Building go targets for linux/amd64
    ./cmd/kubectl/ (non-static)

$ make WHAT=k8s.io/kubernetes/cmd/kubectl
+++ [1211 11:16:16] Building go targets for linux/amd64
    k8s.io/kubernetes/cmd/kubectl (static)

$ make WHAT=./staging/src/k8s.io/api
+++ [1211 11:16:31] Building go targets for linux/amd64
    ./staging/src/k8s.io/api (non-static)

$ make WHAT=staging/src/k8s.io/api
+++ [1211 11:16:43] Building go targets for linux/amd64
    ./staging/src/k8s.io/api (non-static)

$ make WHAT=k8s.io/api
+++ [1211 11:16:50] Building go targets for linux/amd64
    k8s.io/api (non-static)
```

```
$ make test WHAT=./cmd/kubectl
+++ [1211 11:17:23] Set GOMAXPROCS automatically to 6
+++ [1211 11:17:23] Running tests without code coverage and with -race
cmd/kubectl/kubectl.go:25:2: cannot find package "k8s.io/client-go/plugin/pkg/client/auth" in any of:
	/home/thockin/src/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/k8s.io/client-go/plugin/pkg/client/auth (vendor tree)
	/home/thockin/sdk/gotip/src/k8s.io/client-go/plugin/pkg/client/auth (from $GOROOT)
	/home/thockin/src/kubernetes/_output/local/go/src/k8s.io/client-go/plugin/pkg/client/auth (from $GOPATH)
cmd/kubectl/kubectl.go:20:2: cannot find package "k8s.io/component-base/cli" in any of:
	/home/thockin/src/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/k8s.io/component-base/cli (vendor tree)
	/home/thockin/sdk/gotip/src/k8s.io/component-base/cli (from $GOROOT)
	/home/thockin/src/kubernetes/_output/local/go/src/k8s.io/component-base/cli (from $GOPATH)
cmd/kubectl/kubectl.go:21:2: cannot find package "k8s.io/kubectl/pkg/cmd" in any of:
	/home/thockin/src/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/k8s.io/kubectl/pkg/cmd (vendor tree)
	/home/thockin/sdk/gotip/src/k8s.io/kubectl/pkg/cmd (from $GOROOT)
	/home/thockin/src/kubernetes/_output/local/go/src/k8s.io/kubectl/pkg/cmd (from $GOPATH)
cmd/kubectl/kubectl.go:22:2: cannot find package "k8s.io/kubectl/pkg/cmd/util" in any of:
	/home/thockin/src/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/k8s.io/kubectl/pkg/cmd/util (vendor tree)
	/home/thockin/sdk/gotip/src/k8s.io/kubectl/pkg/cmd/util (from $GOROOT)
	/home/thockin/src/kubernetes/_output/local/go/src/k8s.io/kubectl/pkg/cmd/util (from $GOPATH)
make: *** [Makefile:191: test] Error 1
```
2024-02-29 00:22:08 -08:00
Tim Hockin
8b579b2347
Change the build_binaries path to use modules
This makes "new" and "old" setup_env functions. In subsequent commits,
all callers of the "old" form will be fixed, and the "new" will be
renamed back.

The old and new functions diff:

```diff
--- /tmp/a	2023-12-14 09:02:57.804092696 -0800
+++ /tmp/b	2023-12-14 09:03:09.679999585 -0800
@@ -1,4 +1,4 @@
-kube::golang::old::setup_env() {
+kube::golang:🆕:setup_env() {
   kube::golang::verify_go_version

   # Set up GOPATH.  We have tools which depend on being in a GOPATH (see
@@ -7,9 +7,9 @@
   # Even in module mode, we need to set GOPATH for `go build` and `go install`
   # to work.  We build various tools (usually via `go install`) from a lot of
   # scripts.
-  #   * We can't set GOBIN because that does not work on cross-compiles.
-  #   * We could use `go build -o <something>`, but it's subtle when it comes
-  #     to cross-compiles and whether the <something> is a file or a directory,
+  #   * We can't just set GOBIN because that does not work on cross-compiles.
+  #   * We could always use `go build -o <something>`, but it's subtle wrt
+  #     cross-compiles and whether the <something> is a file or a directory,
   #     and EVERY caller has to get it *just* right.
   #   * We could leave GOPATH alone and let `go install` write binaries
   #     wherever the user's GOPATH says (or doesn't say).
@@ -20,16 +20,6 @@
   #
   # Eventually, when we no longer rely on run-in-gopath.sh we may be able to
   # simplify this some.
-  local go_pkg_dir="${KUBE_GOPATH}/src/${KUBE_GO_PACKAGE}"
-  local go_pkg_basedir
-  go_pkg_basedir=$(dirname "${go_pkg_dir}")
-
-  mkdir -p "${go_pkg_basedir}"
-
-  # TODO: This symlink should be relative.
-  if [[ ! -e "${go_pkg_dir}" || "$(readlink "${go_pkg_dir}")" != "${KUBE_ROOT}" ]]; then
-    ln -snf "${KUBE_ROOT}" "${go_pkg_dir}"
-  fi
   export GOPATH="${KUBE_GOPATH}"

   # If these are not set, set them now.  This ensures that any subsequent
@@ -40,24 +30,10 @@
   # Make sure our own Go binaries are in PATH.
   export PATH="${KUBE_GOPATH}/bin:${PATH}"

-  # Change directories so that we are within the GOPATH.  Some tools get really
-  # upset if this is not true.  We use a whole fake GOPATH here to collect the
-  # resultant binaries.
-  local subdir
-  subdir=$(kube::realpath . | sed "s|${KUBE_ROOT}||")
-  cd "${KUBE_GOPATH}/src/${KUBE_GO_PACKAGE}/${subdir}" || return 1
-
-  # Set GOROOT so binaries that parse code can work properly.
-  GOROOT=$(go env GOROOT)
-  export GOROOT
-
   # Unset GOBIN in case it already exists in the current session.
   # Cross-compiles will not work with it set.
   unset GOBIN

-  # This seems to matter to some tools
-  export GO15VENDOREXPERIMENT=1
-
-  # Disable workspaces
-  export GOWORK=off
+  # Explicitly turn on modules.
+  export GO111MODULE=on
 }
```

Result: `make` works for k/k:

```
$ make kubectl
+++ [1211 11:07:31] Building go targets for linux/amd64
    k8s.io/kubernetes/cmd/kubectl (static)

$ make WHAT=./cmd/kubectl/
+++ [1211 11:08:19] Building go targets for linux/amd64
    k8s.io/kubernetes/./cmd/kubectl/ (non-static)

$ make WHAT=k8s.io/kubernetes/cmd/kubectl
+++ [1211 11:08:52] Building go targets for linux/amd64
    k8s.io/kubernetes/cmd/kubectl (static)
```

Result: `make` works for staging by package:

```
$ make WHAT=k8s.io/api
+++ [1211 11:11:37] Building go targets for linux/amd64
    k8s.io/api (non-static)
```

Result: `make` fails for staging by path:

```
$ make WHAT=./staging/src/k8s.io/api
+++ [1211 11:12:44] Building go targets for linux/amd64
    k8s.io/kubernetes/./staging/src/k8s.io/api (non-static)
cannot find module providing package k8s.io/kubernetes/staging/src/k8s.io/api: import lookup disabled by -mod=vendor
	(Go version in go.work is at least 1.14 and vendor directory exists.)
!!! [1211 11:12:44] Call tree:
!!! [1211 11:12:44]  1: /home/thockin/src/kubernetes/hack/lib/golang.sh:850 kube::golang::build_some_binaries(...)
!!! [1211 11:12:44]  2: /home/thockin/src/kubernetes/hack/lib/golang.sh:1012 kube::golang::build_binaries_for_platform(...)
!!! [1211 11:12:44]  3: hack/make-rules/build.sh:27 kube::golang::build_binaries(...)
!!! [1211 11:12:44] Call tree:
!!! [1211 11:12:44]  1: hack/make-rules/build.sh:27 kube::golang::build_binaries(...)
!!! [1211 11:12:44] Call tree:
!!! [1211 11:12:44]  1: hack/make-rules/build.sh:27 kube::golang::build_binaries(...)
make: *** [Makefile:96: all] Error 1
```

Result: `make test` fails:

```
$ make test WHAT=./cmd/kubectl
+++ [1211 11:13:38] Set GOMAXPROCS automatically to 6
+++ [1211 11:13:38] Running tests without code coverage and with -race
cmd/kubectl/kubectl.go:25:2: cannot find package "k8s.io/client-go/plugin/pkg/client/auth" in any of:
	/home/thockin/src/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/k8s.io/client-go/plugin/pkg/client/auth (vendor tree)
	/home/thockin/sdk/gotip/src/k8s.io/client-go/plugin/pkg/client/auth (from $GOROOT)
	/home/thockin/src/kubernetes/_output/local/go/src/k8s.io/client-go/plugin/pkg/client/auth (from $GOPATH)
cmd/kubectl/kubectl.go:20:2: cannot find package "k8s.io/component-base/cli" in any of:
	/home/thockin/src/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/k8s.io/component-base/cli (vendor tree)
	/home/thockin/sdk/gotip/src/k8s.io/component-base/cli (from $GOROOT)
	/home/thockin/src/kubernetes/_output/local/go/src/k8s.io/component-base/cli (from $GOPATH)
cmd/kubectl/kubectl.go:21:2: cannot find package "k8s.io/kubectl/pkg/cmd" in any of:
	/home/thockin/src/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/k8s.io/kubectl/pkg/cmd (vendor tree)
	/home/thockin/sdk/gotip/src/k8s.io/kubectl/pkg/cmd (from $GOROOT)
	/home/thockin/src/kubernetes/_output/local/go/src/k8s.io/kubectl/pkg/cmd (from $GOPATH)
cmd/kubectl/kubectl.go:22:2: cannot find package "k8s.io/kubectl/pkg/cmd/util" in any of:
	/home/thockin/src/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/k8s.io/kubectl/pkg/cmd/util (vendor tree)
	/home/thockin/sdk/gotip/src/k8s.io/kubectl/pkg/cmd/util (from $GOROOT)
	/home/thockin/src/kubernetes/_output/local/go/src/k8s.io/kubectl/pkg/cmd/util (from $GOPATH)
make: *** [Makefile:191: test] Error 1
```
2024-02-29 00:22:07 -08:00