2518 Commits

Author SHA1 Message Date
Kubernetes Prow Robot
df696c3189 Merge pull request #132657 from danwinship/drop-bfr
Drop BoundedFrequencyRunner from pkg/util/async
2025-07-23 22:52:32 -07:00
Kubernetes Prow Robot
84c00d8538 Merge pull request #124318 from liangyuanpeng/drop-ptr-wrappers-pkg-util
pkg/util: drop pointer wrapper functions.
2025-07-04 15:25:24 -07:00
Dan Winship
12330a6c42 Drop BoundedFrequencyRunner from pkg/util/async
It is no longer used by anything (since kube-proxy now has its own
custom copy).
2025-07-01 12:49:16 -04:00
Kubernetes Prow Robot
b3e438aef9 Merge pull request #132220 from BenTheElder/a-little-owners-cleanup
emeritus spiffxp and backfill OWNERS
2025-06-25 19:16:28 -07:00
PatrickLaabs
72654620a2 removing WaitIntervalString from iptables 2025-06-17 13:49:58 +02:00
Benjamin Elder
ad68a4b4cd emeritus spiffxp
spiffxp moved on from the project years ago, he is still missed
2025-06-10 20:05:40 -07:00
Dan Winship
97ec8618d3 Fix kubelet iptables startup, clarify semantics of utiliptables calls. 2025-06-07 10:28:36 -04:00
Kubernetes Prow Robot
43bb11b5c1 Merge pull request #131534 from aroradaman/kube-proxy-ipt-init-error-2
kube-proxy: log iptables errors in platformCheckSupported
2025-06-06 21:08:38 -07:00
Daman Arora
858b88bcee kube-proxy: log ipt errors during platformCheckSupported
Signed-off-by: Daman Arora <aroradaman@gmail.com>
2025-06-07 01:14:33 +05:30
Lan Liang
253a08d7e3 pkg/util: drop pointer wrapper functions.
The new k8s.io/utils/ptr package provides generic wrapper functions,
which can be used instead of type-specific pointer wrapper functions.
This replaces the latter with the former, and migrates other uses of
the deprecated pointer package to ptr in affacted files.

See kubernetes/utils#283 for details.

Signed-off-by: Lan Liang <gcslyp@gmail.com>
2025-06-05 04:48:25 +00:00
Cyclinder Kuo
0a96613754 proxy: remove iptables wait interval flag
Signed-off-by: cyclinder <kuocyclinder@gmail.com>
2025-05-30 16:13:06 +08:00
Daman Arora
57218ac969 Revert "kube-proxy: log errors during proxy boot"
This reverts commit 9cb3dfb5d3.
2025-05-07 19:53:45 +05:30
Daman Arora
9cb3dfb5d3 kube-proxy: log errors during proxy boot
Signed-off-by: Daman Arora <aroradaman@gmail.com>
2025-04-26 16:06:18 +05:30
Sreeram
f035e37c4b Added e2e test and fixed existing pod test 2025-03-25 02:05:30 +05:30
Dan Winship
8c98dee1ed Add utiliptables.NewDualStack
Basically all callers want dual-stack-if-possible, so simplify that.

Also, tweak the startup-time checking in kubelet to treat "no iptables
support" as interesting but not an error.
2025-03-08 10:14:17 -05:00
Dan Winship
b031258969 Improve utiliptables error handling when there's no iptables binary
If `iptables --version` failed, utiliptables.New() would log a warning
and assume that the problem was that you had an implausibly ancient
version of iptables installed. Change it to instead assume that the
problem is that you don't have iptables installed at all (and don't
log anything; the caller will discover this later).
2025-03-08 10:11:16 -05:00
Dan Winship
f1d0eb4fe4 Add a unit test for utiliptables.New() 2025-03-08 10:11:16 -05:00
Dan Winship
9c98d29795 Remove exec arg from utiliptables.New
It was there so you could mock the results via a FakeExec, but these
days any unit tests outside of pkg/util/iptables that want to mock
iptables results use a FakeIPTables instead of a real
utiliptables.Interface with a FakeExec.
2025-03-08 10:11:15 -05:00
Kubernetes Prow Robot
0eaee48ecb Merge pull request #130569 from dims/update-to-latest-cadvisor-v0.52.0
Update to latest cadvisor @ v0.52.1 and new opencontainer/cgroups and drops opencontainers/runc
2025-03-07 17:09:51 -08:00
Kubernetes Prow Robot
1c9840c58e Merge pull request #130243 from rata/revert-userns-kernel-check
Revert userns kernel check
2025-03-07 02:35:44 -08:00
Davanum Srinivas
5ecddb6571 update to latest cadvisor @ v0.52.0
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2025-03-05 06:36:39 -05:00
Kubernetes Prow Robot
47dbade7f4 Merge pull request #130245 from marosset/windows-unit-tests-pkg-util-filesystem-fixes
Fixing k8s.io/kubernetes/pkg/util/filesystem unit tests for Windows
2025-03-03 16:59:41 -08:00
Mark Rossetti
5eb37b073c Fixing k8s.io/kubernetes/pkg/util/filesystem unit tests for Windows
Signed-off-by: Mark Rossetti <marosset@microsoft.com>
2025-02-27 13:50:24 -08:00
mansikulkarni96
dfc8b271cf [kubelet] Make use of os.ModeSocket info 2025-02-21 18:02:25 -05:00
Kubernetes Prow Robot
b84cb65f93 Merge pull request #129370 from andyzhangx/adopt-go1.23-behavior-change
fix: adopt go1.23 behavior change in mount point parsing on Windows#2
2025-02-21 12:50:26 -08:00
Rodrigo Campos
7deb49e3a6 Revert "Enforce the Minimum Kernel Version 6.3 for UserNamespacesSupport feature"
This reverts commit 8597b343fa.

I wrote in the Kubernetes documentation:

	In practice this means you need at least Linux 6.3, as tmpfs started
	supporting idmap mounts in that version. This is usually needed as
	several Kubernetes features use tmpfs (the service account token that is
	mounted by default uses a tmpfs, Secrets use a tmpfs, etc.)

The check is wrong for several reasons:
	* Pods can use userns before 6.3, they will just need to be
	  careful to not use a tmpfs (like a serviceaccount). MOST users
	  will probably need 6.3, but it is possible to use earlier kernel
	  versions. 5.19 probably works fine and with improvements in
          the runtime 5.12 can probably be supported too.
	* Several distros backport changes and the recommended way is
	  usually to try the syscall instead of testing kernel versions.
	  I expect support for simple fs like tmpfs will be backported
	  in several distros, but with this check it can generate confusion.
	* Today a clear error is shown when the pod is created, so it's
	  unlikely a user will not understand why it fails.
	* Returning an error if utilkernel fails to understand what
	  kernel version is running is also too strict (as we are
	  logging a warning even if it is not the expected version)
	* We are switching to enabled by default, which will log a
	  warning on every user that runs on an older than 6.3 kernel,
	  adding noise to the logs.

For there reasons, let's just remove the hardcoded kernel version check.

Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2025-02-18 17:24:50 +01:00
andyzhangx
bb49a05fb5 fix: adopt go1.23 behavior change in mount point parsing on Windows
fix comments
2025-02-18 07:17:51 +00:00
Tim Allclair
a7340ff36c [windows] Don't chown existing directory in MkdirAll 2024-12-16 14:10:56 -08:00
Patrick Ohly
8a908e0c0b remove import doc comments
The "// import <path>" comment has been superseded by Go modules.
We don't have to remove them, but doing so has some advantages:

- They are used inconsistently, which is confusing.
- We can then also remove the (currently broken) hack/update-vanity-imports.sh.
- Last but not least, it would be a first step towards avoiding the k8s.io domain.

This commit was generated with
   sed -i -e 's;^package \(.*\) // import.*;package \1;' $(git grep -l '^package.*// import' | grep -v 'vendor/')

Everything was included, except for
   package labels // import k8s.io/kubernetes/pkg/util/labels
because that package is marked as "read-only".
2024-12-02 16:59:34 +01:00
Kubernetes Prow Robot
469524442f Merge pull request #126621 from my-git9/node-deadcode-remove
Remove deadcode in pkg/util/node
2024-11-08 16:38:45 +00:00
nikzayn
ab87218cf1 feat: support changes for net.ipv4.tcp_rmem and net.ipv4.tcp_wmem #125234
Signed-off-by: nikzayn <nikhilvaidyar1997@gmail.com>
2024-09-20 11:22:28 +08:00
Kubernetes Prow Robot
b005b40027 Merge pull request #125136 from mauri870/feature/wsl2-kernel-test
util: add test case for WSL kernel version parsing
2024-09-19 20:23:27 +01:00
xin.li
b24804faf8 remove deadcode in pkg/util/node
Signed-off-by: xin.li <xin.li@daocloud.io>
2024-08-10 23:32:23 +08:00
Kubernetes Prow Robot
9c763a9c9f Merge pull request #126104 from cji/5321
Add funcs in pkg/filesystem/util to set file permissions on Windows and update container log dir perms
2024-07-16 10:33:05 -07:00
Mark Rossetti
b377dfba0c Add funcs in pkg/filesystem/util that can actually set file permissiosn
on Windows and update container log dir perms to 660 on Windows
2024-07-15 14:22:59 -07:00
Kubernetes Prow Robot
fe1840205c Merge pull request #125926 from MadhavJivrajani/bump-staticcheck-exclude-SA1006
[go1.23] hack: bump go-tools and exclude SA1006
2024-07-15 10:05:19 -07:00
Madhav Jivrajani
c5481b0413 .*: fix lint errors
Fix SA4032 and SA3000 which are flagged after bumping to go1.23rc1
and v0.5.0-rc1 of go-tools.

Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>
2024-07-15 15:03:15 +05:30
Dan Winship
505f6833d9 Require kernel 5.13 for nftables kube-proxy 2024-07-01 10:07:27 -04:00
Antonio Ojea
f36975b193 remove iptree from tree 2024-06-27 11:33:36 +00:00
Kubernetes Prow Robot
eb6840928d Merge pull request #124160 from Karthik-K-N/fix-buildconstraints
Add doc.go file without any buildconstraint to run tests on non linux platforms
2024-06-13 16:29:06 -07:00
Sascha Grunert
0c9949b6ec Move pkg/kubelet/kuberuntime/logs to k8s.io/cri-client staging
Particulary helpful to decouple cri-tools from k/k.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2024-05-30 15:13:22 +02:00
Mauri de Souza Meneguzzo
b8e5a3ed32 pkg/util/coverage: update fakeTestDeps methods
Go 1.23 changed the signature of the testDeps interface so we need to
add a blank implementation for InitRuntimeCoverage to fakeTestDeps.
2024-05-29 12:31:22 -03:00
Mauri de Souza Meneguzzo
7fcaaa5585 util: add test case for WSL kernel version parsing 2024-05-26 18:40:10 -03:00
Itamar Holder
2a174d09fa If the kernel version is at least 6.4, assume tmpfs noswap is supported
Signed-off-by: Itamar Holder <iholder@redhat.com>
2024-05-21 13:18:16 +03:00
Davanum Srinivas
8597b343fa Enforce the Minimum Kernel Version 6.3 for UserNamespacesSupport feature
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2024-05-07 16:01:42 -04:00
Kubernetes Prow Robot
7f67cb5960 Merge pull request #123969 from liangyuanpeng/cleanup_rand
cleanup: delete rand.Seed(time.Now().UnixNano()) and using global number generator.
2024-04-18 02:10:26 -07:00
Maksym Pavlenko
be4b7176dc Fix Abs path validation on Windows (#124084)
* Windows: Consider slash-prefixed paths as absolute

filepath.IsAbs does not consider "/" or "\" as absolute paths, even
though files can be addressed as such. [1][2]

Currently, there are some unit tests that are failing on Windows due to
this reason.

[1] https://learn.microsoft.com/en-us/dotnet/standard/io/file-path-formats#traditional-dos-paths
[2] https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#fully-qualified-vs-relative-paths

* Add test to verify IsAbs for windows

Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>

* Fix abs path validation on windows

Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>

* Skipp path clean check for podLogDir on windows

Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>

* Implement IsPathClean to validate path

Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>

* Add warn comment for IsAbs

Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>

---------

Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
Co-authored-by: Claudiu Belu <cbelu@cloudbasesolutions.com>
2024-04-10 10:13:59 -07:00
Karthik K N
134e43c279 Add doc.go file without any buildconstraint to run tests on non linux systems 2024-04-03 12:30:59 +05:30
Lan Liang
dc992adad3 cleanup: delete rand.Seed(time.Now().UnixNano()) and using global number generator.
see https://tip.golang.org/doc/go1.20

Signed-off-by: Lan Liang <gcslyp@gmail.com>
2024-03-18 08:10:12 +00:00
Tim Hockin
6dbc754ed6 Retool typecheck to be simpler
Instead of walking paths ourselves, just let Go's packages library do
it.  This is a slight CLI change - it wants "./foo" rather than "foo".

This also flagged a few things which seem to be legit failures.
2024-02-29 22:07:00 -08:00