24845 Commits

Author SHA1 Message Date
040385ef9b chore: fix function name in comment
Signed-off-by: xixishidibei <xixishidibei@outlook.com>
2025-04-02 21:26:27 +08:00
53be17d126 Merge pull request #25756 from danegsta/danegsta/buildahVendor
Update vendored c/buildah to `32d78c69be17`
2025-04-02 00:26:44 +00:00
684126e426 Suppress failing bud tests in remote
Signed-off-by: David Negstad <David.Negstad@microsoft.com>
2025-04-01 14:54:34 -07:00
3d12f1e2ed Update vendored c/buildah to 32d78c69be17
Signed-off-by: David Negstad <David.Negstad@microsoft.com>
2025-04-01 13:26:06 -07:00
4b2472595c Merge pull request #25753 from flouthoc/vendor-common
vendor: bump c/common to `9b0d134f392`
2025-04-01 19:09:00 +00:00
f5120f4ee8 Merge pull request #25752 from containers/renovate/github.com-shirou-gopsutil-v4-4.x
fix(deps): update module github.com/shirou/gopsutil/v4 to v4.25.3
2025-04-01 17:41:01 +00:00
74356e1b5a config: use ErrInvalidName
SA1019: types.RegexError is deprecated: use [ErrInvalidName] instead.

Making linter happy.

Signed-off-by: flouthoc <flouthoc.git@gmail.com>
2025-04-01 10:14:51 -07:00
c27195ea65 fix(deps): update module github.com/shirou/gopsutil/v4 to v4.25.3
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-01 16:58:58 +00:00
51bb71d1b3 vendor: bump c/common to 9b0d134f392
Bump common to 9b0d134f392f41de3f3065aad162e73a3904168e

Signed-off-by: flouthoc <flouthoc.git@gmail.com>
2025-04-01 09:58:43 -07:00
d4988898ac Merge pull request #25726 from kolyshkin/golangci-v2
Golangci v2
2025-04-01 16:56:56 +00:00
69408391f6 Merge pull request #25744 from containers/renovate/github.com-opencontainers-runtime-tools-digest
fix(deps): update github.com/opencontainers/runtime-tools digest to 260e151
2025-04-01 14:41:28 +00:00
ce959bbd40 Merge pull request #25745 from containers/renovate/github.com-openshift-imagebuilder-digest
fix(deps): update github.com/openshift/imagebuilder digest to e87e4e1
2025-04-01 14:22:18 +00:00
66b2bf83d9 fix(deps): update github.com/openshift/imagebuilder digest to e87e4e1
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-01 06:03:55 +00:00
6703564339 fix(deps): update github.com/opencontainers/runtime-tools digest to 260e151
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-01 01:50:57 +00:00
4eb75f68cf test/e2e: fix unused linter warning
This is shown when golangci-lint is run with --tests=false

> test/e2e/config.go:7:2: var fedoraMinimal is unused (unused)
> 	fedoraMinimal     = "quay.io/libpod/systemd-image:20240124"
> 	^
> test/e2e/config.go:18:2: var volumeTest is unused (unused)
> 	volumeTest        = "quay.io/libpod/volume-plugin-test-img:20220623"
> 	^

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-03-31 12:30:43 -07:00
dac3fa2f97 pkg/specgen/generate: fix unused warning on freebsd
> pkg/specgen/generate/validate_freebsd.go:6:6: func verifyContainerResources is unused (unused)
> func verifyContainerResources(s *specgen.SpecGenerator) ([]string, error) {
>      ^

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-03-31 12:30:43 -07:00
18fdbaee80 pkg/machine/qemu: fix ST1016 linter warning on freebsd
> pkg/machine/qemu/stubber.go:92:23: ST1016: methods on the same type should have the same receiver name (seen 1x "v", 25x "q") (staticcheck)
> func (q *QEMUStubber) CreateVM(opts define.CreateVMOpts, mc *vmconfigs.MachineConfig, builder *ignition.IgnitionBuilder) error {
>                       ^

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-03-31 12:30:43 -07:00
c860e67884 cmd/rootlessport: add missing linux build tags
This amends commit 772ead253 ("Use simulated dual-stack binds when using WSL")
which started using linux tag but not for all files.

Alas, this breaks ginkgo run on Windows, so add an exclusion.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-03-31 12:29:21 -07:00
061e1a17a9 pkg/rctl: fix fprintf statement
While at it, rename the file to have freebsd suffix instead of using
a go:build annotation.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-03-31 12:27:55 -07:00
1739b7170e pkg/systemd/quadlet: rm splitPorts
Usage of splitPorts was removed by commit abc4cfb04 ("quadlet: allow
variables in PublishPort") but the function remained, as well as its
tests.

Drop those.

Found by running golangci-lint with --tests=false option.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-03-31 12:27:55 -07:00
c9b108d5b3 Bump golangci-lint to v2.0.2
This ended up slightly more complicated than anticipated, tin part
because golangci-lint v2 dropped support for --exclude-dirs, so
linter issues with GOOS=windows and GOOS=darwin which were previously
ignored had to be fixed now.

This is also the reason why the ./hack/golangci-lint was simplified.
In addition, it now runs linters on Linux without systemd tag set.

Tested locally with:

	for OS in linux windows darwin; do GOOS=$OS ./hack/golangci-lint.sh; done
	Linting for GOOS=linux
	+ ./bin/golangci-lint run --build-tags=apparmor,seccomp,selinux
	0 issues.
	+ ./bin/golangci-lint run --build-tags=apparmor,seccomp,selinux,systemd
	0 issues.
	+ ./bin/golangci-lint run --build-tags=apparmor,seccomp,selinux,remote
	0 issues.
	Linting for GOOS=windows
	+ ./bin/golangci-lint run --build-tags=remote,containers_image_openpgp
	0 issues.
	Linting for GOOS=darwin
	+ ./bin/golangci-lint run --build-tags=remote,containers_image_openpgp
	0 issues.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-03-31 12:27:55 -07:00
8bd73b7d2c pkg/machine/wsl: rm unused structures
Those are not used since commit 0c587f024 ("refactor(machine,wsl):
improve operations of Windows API").

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-03-31 12:27:55 -07:00
2861bc3702 pkg/machine/qemu: rm unused code
Looks like this is a forgotten part of commit 9bb191df5
("[CI:MACHINE]Podman5 QEMU refactor"). The reason is,
linters for Windows skip pkg/machine/qemu, and linters
for freebsd are not run at all.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-03-31 12:27:55 -07:00
9f0032d3fd pkg/machine/shim: fix unused warnings on windows
These:

> pkg/machine/shim/claim_unsupported.go:9:6: func dockerClaimHelperInstalled is unused (unused)
> func dockerClaimHelperInstalled() bool {
>      ^
> pkg/machine/shim/claim_unsupported.go:13:6: func claimDockerSock is unused (unused)
> func claimDockerSock() bool {
>      ^
> pkg/machine/shim/claim_unsupported.go:17:6: func dockerClaimSupported is unused (unused)
> func dockerClaimSupported() bool {
>      ^

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-03-31 12:27:55 -07:00
d9090645c3 pkg/machine: fix various linter warnings
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-03-31 12:27:55 -07:00
4638d434bc pkg/machine/wsl/wutil: fix imports formatting
Otherwise goimports linter complains.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-03-31 12:27:55 -07:00
c1f9c0b127 pkg/machine/e2e: fix unparam warnings
This one:

> pkg/machine/e2e/config_windows_test.go:42:56: runSystemCommand - timeout always receives defaultTimeout (600000000000) (unparam)
> func runSystemCommand(binary string, cmdArgs []string, timeout time.Duration, wait bool) (*machineSession, error) {
>                                                        ^

and, subsequently, this one:

> pkg/machine/e2e/config_windows_test.go:41:56: runSystemCommand - wait always receives true (unparam)
> func runSystemCommand(binary string, cmdArgs []string, wait bool) (*machineSession, error) {
>                                                        ^

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-03-31 12:27:55 -07:00
7c175064da libpod: rm nolint annotation
It does not make sense because MemInfo.MemTotal is always int64 so the
conversion is always needed.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-03-31 12:27:55 -07:00
032250a478 pkg/binding/images: rm dead code
Here err is always nil, so the check is useless.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-03-31 12:27:55 -07:00
486327e2b9 pkg/bindings/images: fix linter warning on Darwin
With GOOS=darwin, golangci-lint complains:

> pkg/bindings/images/build_unix.go:13:24: directive `//nolint:unconvert` is unused for linter "unconvert" (nolintlint)
> 		Dev: uint64(st.Dev), //nolint:unconvert
> 		                     ^

Indeed, Stat_t.Dev is always uint64 on darwin

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-03-31 12:27:55 -07:00
6b1033eaa0 libpod/events: refactor to eliminate unused code
Shuffle the code around to eliminate "unused" warnings when linting
with various GOOS and build tags.

The only change in functionality should be that now NewEventer
returns ErrNoJournaldLogging (rather than "unknown event logger type")
on freebsd when journald is requested.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-03-31 12:27:55 -07:00
91113c46ef test/utils: suppress ST1001 warnings
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-03-31 12:27:55 -07:00
0f975f8526 ci: rm allow-unused from nolintlint settings
This was added by commit 84e42877a ("make lint: re-enable revive"),
making nolintlint became almost useless.

Remove the ungodly amount of unused nolint annotations.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-03-31 12:27:55 -07:00
bed6ee6bb7 pkg/machine/e2e: move windows-specific function to windows file
This allows to remove the 'nolint' annotation.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-03-31 12:27:55 -07:00
cc4d904dd2 Fix QF1012 staticcheck warnings
> QF1012: Use fmt.Fprintf(...) instead of WriteString

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-03-31 12:27:55 -07:00
f4f2580b0d ci: remove stylecheck linter
It is to be merged into staticcheck linter in golangci-lint v2.0.0.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-03-31 12:27:55 -07:00
5aa035c69c libpod: fix a few minor staticcheck warnings
These:

> libpod/container_copy_common.go:34:16: QF1011: could omit type bool from declaration; it will be inferred from the right-hand side (staticcheck)
> 		locked       bool = true
> 		             ^
> libpod/container_internal_common.go:793:3: QF1006: could lift into loop condition (staticcheck)
> 		if maxSymLinks > 40 {
> 		^
> libpod/oci_conmon_linux.go:170:2: QF1007: could merge conditional assignment into variable declaration (staticcheck)
> 	mustCreateCgroup := true
> 	^

Should not result in any change of logic.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-03-31 12:27:55 -07:00
0105131b5c Fix QF1003: could use tagged switch" staticcheck warning
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-03-31 12:27:55 -07:00
0dddc5e3c0 Apply De Morgan's law
This fixes a bunch of "QF1001: could apply De Morgan's law" warnings
from staticcheck linter.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-03-31 12:27:55 -07:00
b1010808ed .golangci.yml: remove exclude-dirs
Neither contrib nor dependencies contain any Go code:
 - for contrib, this is the way since commit 6041f707c ("rm
   contrib/perftest");
 - for dependencies, this is the way since commit c7827957a ("ginkgo:
   restructure install work flow").

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-03-31 12:27:55 -07:00
1a9cf6b9db .golangci.yml: rm exclude-files
The only file listed was swagger.go, and it was removed by the commit
5b79cf15a ("Swagger refactor/cleanup") three years ago.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-03-31 12:27:55 -07:00
f3e7b26fdd .golangci.yml: remove some linters
Let's take a look at each enabled linter and find out if it's needed;
remove those that make no sense.

* goheader: does nothing with empty configuration;
* gomodguard: does nothing with empty configuration;
* importas: does nothing with empty configuration;
* loggercheck: this repo does not use any loggers it checks (kitlog,klog,logr,zap);
* promlinter: this repo does not use Prometheus;
* sloginit: this repo does not use slog;
* spancheck: this repo does not use opentelemetry/opencensus;
* zerologlint: this repo does not use zerolog;

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-03-31 12:27:55 -07:00
c72526cd9c .golangci.yml: switch to list of enabled linters
Instead of enabling all linters, and when disabling some of them because
we don't like them, switch to list of explicitly enabled linters. The
upside of this is we can easily upgrade golangci-lint (i.e. any new
linters won't break our CI). The downside is, we need to explicitly
enable extra linters.

To me, this is better from the maintainability perspective.

NOTE this commit does not change the configuration in any way, in other
words, the list of linters being run is the same as before. The next
commit will address this.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-03-31 12:27:55 -07:00
827dbaefcf Merge pull request #25733 from ninja-quokka/update_no_new_priv_docs
docs: Update `podman build` security options
2025-03-31 19:01:29 +00:00
4a7785d4df docs: Update podman build security options
It seems support was added into Buildah for no-new-privileges [1]
however the Podman build documentation was not updated.

Fixes #25731

[1] d4c661a774

Signed-off-by: Lewis Denny <lewis@redhat.com>
2025-04-01 04:34:22 +10:00
b19df2da77 Merge pull request #25740 from Luap99/deps-removal
remove github.com/buger/goterm and github.com/google/gofuzz dependency
2025-03-31 18:30:50 +00:00
3dbc3f2730 Merge pull request #25741 from containers/renovate/setuptools-78.x
chore(deps): update dependency setuptools to v78
2025-03-31 18:05:46 +00:00
604cb0aa17 Merge pull request #25694 from mtrmac/tarball-compression
Fix `podman import` with non-gzip inputs
2025-03-31 17:49:24 +00:00
8ef234aedd remove github.com/buger/goterm dependency
this is just a few bytes of escape codes, there is no need to depend on
a library for it. While it is not a big one it still seems better to
just write it ourselves.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-03-31 19:17:55 +02:00
0b1d3a963d chore(deps): update dependency setuptools to v78
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-31 16:35:29 +00:00