Commit Graph

7385 Commits

Author SHA1 Message Date
Kir Kolyshkin
9510ffb658 Fix a few staticcheck QF1001 warnings
Like these:

> libcontainer/criu_linux.go:959:3: QF1001: could apply De Morgan's law (staticcheck)
> 		!(req.GetType() == criurpc.CriuReqType_FEATURE_CHECK ||
> 		^
> libcontainer/rootfs_linux.go:360:19: QF1001: could apply De Morgan's law (staticcheck)
> 	if err == nil || !(errors.Is(err, unix.EPERM) || errors.Is(err, unix.EBUSY)) {
> 	                 ^

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-03-25 16:06:44 -07:00
Kir Kolyshkin
6405725ca2 libct: fix staticcheck QF1006 warning
> libcontainer/rootfs_linux.go:1255:13: QF1004: could use strings.ReplaceAll instead (staticcheck)
> 	keyPath := strings.Replace(key, ".", "/", -1)

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-03-25 16:06:44 -07:00
Kir Kolyshkin
fdb691632d notify_socket.go: fix staticcheck warning
> notify_socket.go:44:24: ST1016: methods on the same type should have the same receiver name (seen 1x "n", 5x "s") (staticcheck)
> func (s *notifySocket) Close() error {
>                        ^

As reported by staticcheck from golangci-lint v2.0.0

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-03-25 16:06:44 -07:00
Kir Kolyshkin
dc7ede67fa Merge pull request #4686 from kolyshkin/golangci
Remove some nolint annotations, add nolintlint linter
2025-03-25 16:06:17 -07:00
lfbzhm
480e7a722a Merge pull request #4691 from rata/issue-template-repro
.github: Improve issue template description
2025-03-25 09:33:17 +08:00
Kir Kolyshkin
8598f6ec4a Merge pull request #4354 from ningmingxiao/dev3
skip read /proc/filesystems if process_label is null
2025-03-24 12:09:03 -07:00
Kir Kolyshkin
a638f1330b .golangci.yml: add nolintlint, fix found issues
The errrolint linter can finally ignore errors from Close,
and it also ignores direct comparisons of errors from x/sys/unix.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-03-24 11:59:54 -07:00
Kir Kolyshkin
65e0f2b719 libct/int: use destroyContainer
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-03-24 10:02:47 -07:00
Kir Kolyshkin
1aebfa3eab libct/int: don't use _ = runContainerOk
There is no need to explicitly ignore returned value.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-03-24 10:02:47 -07:00
Rodrigo Campos
25d4764432 Merge pull request #4689 from opencontainers/dependabot/go_modules/github.com/opencontainers/selinux-1.12.0
build(deps): bump github.com/opencontainers/selinux from 1.11.1 to 1.12.0
2025-03-24 08:32:10 -03:00
Rodrigo Campos
f55400dce8 .github: Improve issue template description
We received several times issues that the repro steps are human readable
text with ambiguous instructions. That usually ends up in maintainers
asking questions so people provide clear steps.

Let's just make the issue template more clear in that regard.

Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2025-03-24 12:22:07 +01:00
lfbzhm
6dd9c9bde8 Merge pull request #4687 from kolyshkin/maps-slices
Use Go 1.23 maps.Keys, slices.Sort more
2025-03-24 17:59:47 +08:00
dependabot[bot]
bac338256c build(deps): bump github.com/opencontainers/selinux
Bumps [github.com/opencontainers/selinux](https://github.com/opencontainers/selinux) from 1.11.1 to 1.12.0.
- [Release notes](https://github.com/opencontainers/selinux/releases)
- [Commits](https://github.com/opencontainers/selinux/compare/v1.11.1...v1.12.0)

---
updated-dependencies:
- dependency-name: github.com/opencontainers/selinux
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-24 04:56:16 +00:00
Kir Kolyshkin
bc96bc8558 libct/seccomp: use maps and slices pkgs
Since we have now switched to Go 1.23, we can use maps and slices pkgs

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-03-21 16:04:05 -07:00
Kir Kolyshkin
370733b7d9 libct/cap: rm mapKeys, use maps.Keys, slices.Sorted
Since we've switched to Go 1.23 we can now use the new functionality of
maps and slices packages.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-03-21 16:03:40 -07:00
Akihiro Suda
e0bf28b910 Merge pull request #4685 from kolyshkin/smaller-state
Make state.json 25% smaller
2025-03-21 09:14:18 +09:00
Kir Kolyshkin
3a33b6a3df Make state.json 25% smaller
This makes the state.json file 1303 bytes or almost 25% smaller (when
using the default spec, YMMV) by omitting default values.

Before: 5496 bytes
After: 4193 bytes

(With cgroups#9 applied, the new size is 3424, which is almost 40%
savings, compared to the original).

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-03-19 15:51:52 -07:00
Akihiro Suda
8b98e829f0 Merge pull request #4676 from kolyshkin/keyring-log
libct: log a warning on join session keyring failure
2025-03-18 02:32:04 +09:00
Kir Kolyshkin
4c22153982 Merge pull request #4679 from rata/misc
libct: Use chown(uid, -1) to not change the gid
2025-03-14 17:49:40 -07:00
Kir Kolyshkin
fde0842083 Merge pull request #4670 from kolyshkin/shell-spring-cleaning
Shell spring cleaning
2025-03-14 17:49:23 -07:00
Rodrigo Campos
9c5e687b6f libct: Use chown(uid, -1) to not change the gid
There is no behavior change, it is just more readable to use -1 to mean
don't touch this.

Please note that if the GID is not mapped in the userns, by using -1 for
that no error is returned. We just avoid dealing with it completely, as
we want here.

Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2025-03-14 16:52:20 +01:00
Rodrigo Campos
92d1ea4acc Merge pull request #4675 from kolyshkin/nits-33
Misc CI nits
2025-03-14 12:34:24 -03:00
Kir Kolyshkin
d31e6b87ca ci: bump bats to v0.11.0
This is the version available from Fedora 41.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-03-13 10:26:11 -07:00
Kir Kolyshkin
8e653e40c6 script/setup_host_fedora.sh: use bash arrays
This makes the code more robust and allows to remove the
"shellcheck disable=SC2086" annotation.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-03-13 10:21:55 -07:00
Kir Kolyshkin
a76a1361b4 script/setup_host_fedora.sh: remove -p from mkdir
1. There is no need to have -p option in mkdir here, since
   /home/rootless was already created by useradd above.

2. When there is no -p, there is no need to suppress the shellcheck
   warning (which looked like this):

> In script/setup_host_fedora.sh line 21:
> mkdir -m 0700 -p /home/rootless/.ssh
>       ^-- SC2174 (warning): When used with -p, -m only applies to the deepest directory.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-03-13 10:21:55 -07:00
Kir Kolyshkin
af386d1df1 tests/int: rm some "shellcheck disable" annotations
Those are no longer needed with shellcheck v0.10.0 (possibly with an
earlier version, too, but I am too lazy to check that).

While at it, fix a typo in the comment.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-03-13 10:21:55 -07:00
Kir Kolyshkin
b48dd65114 ci: bump shellcheck to v0.10.0
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-03-13 10:21:55 -07:00
Kir Kolyshkin
6e5ffb7cbc Makefile: bump shfmt to v3.11.0
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-03-13 10:21:55 -07:00
Kir Kolyshkin
539315534f libct: log a warning on join session keyring failure
This addresses a TODO item added by commit 40f146841
("keyring: handle ENOSYS with keyctl(KEYCTL_JOIN_SESSION_KEYRING)"),
as we do have runc init logging working fine for quite some time.

While at it, fix a typo in a comment (standart -> standard).

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-03-13 08:42:22 -07:00
Kir Kolyshkin
9aeb7905cf tests/int/selinux: fix skip message
It was a mistake to say that SELinux need to be in the enforcing mode
for these tests to run. It only needs to be enabled.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-03-13 08:40:37 -07:00
Kir Kolyshkin
5ac77ed6d9 libct/int: add/use needUserNS helper
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-03-13 08:40:27 -07:00
Rodrigo Campos
67edd6d88e Merge pull request #4671 from kolyshkin/git-core
.cirrus.yml: install less dependencies
2025-03-13 11:35:15 -03:00
Kir Kolyshkin
1d9bea5378 .cirrus.yml: install less dependencies
In a nutshell:
 - use git-core instead of git;
 - do not install weak deps;
 - do not install docs.

This results in less packages to install:
 - 25 instead of 72 for almalinux-8
 - 24 instead of 90 for almalinux-9

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-03-10 14:39:26 -07:00
lfbzhm
854fb5242f Merge pull request #4666 from kolyshkin/pidfd_send_signal
Use pidfd_send_signal under the hood
2025-03-08 10:41:40 +08:00
Kir Kolyshkin
1afa1b8662 signals: replace unix.Kill with process.Signal
This way, given a recent Go and Linux version, pidfd_send_signal will
be used under the hood.

Keep unix.Signal and unix.SignalName for logging (it is way more
readable than what os.Signal.String() provides).

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-03-07 16:47:06 -08:00
lfbzhm
346c80d714 libct: replace unix.Kill with os.Process.Signal
Because we should switch to unix.PidFDSendSignal in new kernels, it has
been supported in go runtime. We don't need to add fall back to
unix.Kill code here.

Signed-off-by: lifubang <lifubang@acmcoder.com>
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-03-07 14:07:47 -08:00
Kir Kolyshkin
aad4d97d83 Merge pull request #4664 from AkihiroSuda/lima-actions
CI: migrate Vagrant + Cirrus to Lima + GHA
2025-03-07 12:55:43 -08:00
Akihiro Suda
135552e5e4 CI: migrate Vagrant + Cirrus to Lima + GHA
- Unlike proprietary Vagrant, Lima remains to be an open source project
- GHA now natively supports nested virt on Linux runners

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-03-07 12:48:02 +09:00
Rodrigo Campos
b936081e87 Merge pull request #4660 from lifubang/fix-doc-spec-1.2.1
doc: update spec-conformance.md
2025-03-06 10:23:36 -03:00
lfbzhm
1bb3820760 Merge pull request #4663 from opencontainers/dependabot/go_modules/golang.org/x/net-0.37.0 2025-03-06 18:53:44 +08:00
dependabot[bot]
d5fe53030b build(deps): bump golang.org/x/net from 0.36.0 to 0.37.0
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.36.0 to 0.37.0.
- [Commits](https://github.com/golang/net/compare/v0.36.0...v0.37.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-06 09:52:25 +00:00
dependabot[bot]
5c10e90ec3 Merge pull request #4662 from opencontainers/dependabot/go_modules/golang.org/x/sys-0.31.0 2025-03-06 09:51:12 +00:00
dependabot[bot]
000cdef75d build(deps): bump golang.org/x/sys from 0.30.0 to 0.31.0
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.30.0 to 0.31.0.
- [Commits](https://github.com/golang/sys/compare/v0.30.0...v0.31.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sys
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-06 04:49:01 +00:00
lifubang
79e9cf53e0 doc: update spec-conformance.md
Signed-off-by: lifubang <lifubang@acmcoder.com>
2025-03-05 19:26:06 -08:00
Akihiro Suda
25dcdc71ae Merge pull request #4658 from snprajwal/deps
deps: bump go-criu to v7
2025-03-06 09:32:28 +09:00
Akihiro Suda
c8c6a8528d Merge pull request #4659 from opencontainers/dependabot/go_modules/golang.org/x/net-0.36.0
build(deps): bump golang.org/x/net from 0.35.0 to 0.36.0
2025-03-06 09:30:59 +09:00
dependabot[bot]
12c2e21f40 build(deps): bump golang.org/x/net from 0.35.0 to 0.36.0
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.35.0 to 0.36.0.
- [Commits](https://github.com/golang/net/compare/v0.35.0...v0.36.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-05 04:26:18 +00:00
Prajwal S N
05e83fc600 deps: bump go-criu to v7
Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
2025-03-05 01:02:53 +05:30
Aleksa Sarai
2f93d663a0 merge #4657 into opencontainers/runc:main
Rodrigo Campos (2):
  VERSION: back to development
  VERSION: release v1.3.0-rc.1

LGTMs: AkihiroSuda lifubang cyphar
2025-03-04 22:57:28 +11:00
Rodrigo Campos
5d6e7e1279 VERSION: back to development
Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2025-03-04 18:42:08 +11:00