From f8f7defa85f408cd2960b9997d8cbd89d1161d64 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Thu, 23 May 2024 22:00:06 -0700 Subject: [PATCH 1/2] Fix codespell warnings ./features.go:30: tru ==> through, true ... ./utils_linux.go:147: infront ==> in front Signed-off-by: Kir Kolyshkin (cherry picked from commit 177c7d4f590dd6efc6fdff139aba728c694e90ad) Signed-off-by: lifubang --- features.go | 16 ++++++++-------- utils_linux.go | 5 ++--- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/features.go b/features.go index c9cd15cd09d..26fc6438623 100644 --- a/features.go +++ b/features.go @@ -27,7 +27,7 @@ var featuresCommand = cli.Command{ return err } - tru := true + t := true feat := features.Features{ OCIVersionMin: "1.0.0", @@ -43,23 +43,23 @@ var featuresCommand = cli.Command{ Namespaces: specconv.KnownNamespaces(), Capabilities: capabilities.KnownCapabilities(), Cgroup: &features.Cgroup{ - V1: &tru, - V2: &tru, - Systemd: &tru, - SystemdUser: &tru, + V1: &t, + V2: &t, + Systemd: &t, + SystemdUser: &t, }, Apparmor: &features.Apparmor{ - Enabled: &tru, + Enabled: &t, }, Selinux: &features.Selinux{ - Enabled: &tru, + Enabled: &t, }, }, } if seccomp.Enabled { feat.Linux.Seccomp = &features.Seccomp{ - Enabled: &tru, + Enabled: &t, Actions: seccomp.KnownActions(), Operators: seccomp.KnownOperators(), Archs: seccomp.KnownArchs(), diff --git a/utils_linux.go b/utils_linux.go index 60d534e86b1..587e28fb8b5 100644 --- a/utils_linux.go +++ b/utils_linux.go @@ -168,9 +168,8 @@ func setupIO(process *libcontainer.Process, rootuid, rootgid int, createTTY, det return setupProcessPipes(process, rootuid, rootgid) } -// createPidFile creates a file with the processes pid inside it atomically -// it creates a temp file with the paths filename + '.' infront of it -// then renames the file +// createPidFile creates a file containing the PID, +// doing so atomically (via create and rename). func createPidFile(path string, process *libcontainer.Process) error { pid, err := process.Pid() if err != nil { From 3b7fcf76ef7e80991e659554ec35140be8c0d054 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Sun, 2 Jun 2024 10:51:43 -0700 Subject: [PATCH 2/2] ci: pin codespell CI should not fail and require attention every time a new codespell version is released. Signed-off-by: Kir Kolyshkin (cherry picked from commit b24fc9d2c44bc6e53b9a6ea580e96348181e2f27) Signed-off-by: lifubang --- .github/workflows/validate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index d97b1afe366..f190d021279 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -61,7 +61,7 @@ jobs: - uses: actions/checkout@v3 - name: install deps # Version of codespell bundled with Ubuntu is way old, so use pip. - run: pip install codespell + run: pip install codespell==v2.3.0 - name: run codespell run: codespell