Since PR 28760 linting is done for all OSes on linux, so there's no need
to run golangci-lint on Mac and FreeBSD separately. This also fixes the
issue of mixing up golangci-lint caches between different Mac OS X runs.
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Bump the following:
c/common to v0.68.0
c/image to v5.40.0
c/storage to v1.63.0
in preparation for Podman 6.0.
Buildah still needs to be bumped and vendored, but thought I'd get this
part going while waiting for that.
Signed-off-by: Tom Sweeney <tsweeney@redhat.com>
Amend golangci-lint target to also run linters on all supported OSes
in addition to a native run.
Use CGO_ENABLED=0 because Makefile sets CGO_ENABLED=1, and
cross-compilation tools are probably not available.
Use GOARCH=arm64 for darwin because since commit f87cefc Mac builds are
arm64-only.
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
When a specific version of golangci-lint is already available in $PATH,
use it instead of installing one locally.
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
The pasta_t SELinux domain is denied { create } for pasta.sock
on ifconfig_var_run_t directories. Disable all pasta forwarder
tests (BATS + e2e) until a new passt release ships the fix.
Signed-off-by: Jan Rodák <hony.com@seznam.cz>
inspect was using the default system provider (machineProvider) to resolve machine directories instead of the provider returned by shim.VMExists for the specific machine. This caused incorrect results (e.g. listing WSL dirs when inspecting a Hyper-V machine).
Signed-off-by: lstocchi <lstocchi@redhat.com>
Change isHyperVAdminMember from returning a bool to returning an error so that callers surface the specific failure reason — particularly distinguishing "not in the group" from "in the group but session not updated" (new ErrHypervUserSessionNotUpdated sentinel). This gives users actionable guidance instead of a generic permission error.
Signed-off-by: lstocchi <lstocchi@redhat.com>
The last user of get_env_key was removed by commit
69163af2a0 ("Remove gitleaks scanning").
Remove it.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Using modernize (aka go fix) from Go 1.26.3, implement the following
changes:
> pkg/rootless/rootless_linux.go:319:30: fmtappendf: Replace []byte(fmt.Sprintf...) with fmt.Appendf (modernize)
> err = os.WriteFile(uidMap, []byte(fmt.Sprintf("%d %d 1\n", 0, os.Geteuid())), 0o666)
> ^
> pkg/rootless/rootless_linux.go:339:30: fmtappendf: Replace []byte(fmt.Sprintf...) with fmt.Appendf (modernize)
> err = os.WriteFile(gidMap, []byte(fmt.Sprintf("%d %d 1\n", 0, os.Getegid())), 0o666)
> ^
> pkg/rootless/rootless_linux.go:381:6: rangeint: for loop can be modernized using range over int (modernize)
> for sig := 0; sig < numSig; sig++ {
> ^
> pkg/rootless/rootless_linux.go:432:24: stringsseq: Ranging over SplitSeq is more efficient (modernize)
> for _, entry := range bytes.Split(data, []byte{0}) {
> ^
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Since commit def70012b9 git-validation is only used to check if the
commit subject is less than 90 characters.
Drop the vendored git-validation Go tool and the .gitvalidation make
target in favor of hack/commit-subject-check.sh.
This removes a Go build dependency and a vendored tree from
test/tools/ while keeping the same CI and local behavior.
Note the now-removed GIT_CHECK_EXCLUDE was not used by gitvalidation
since commit def70012b9 because it was not checking any specific
files, just the commit subject lengths.
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
EditorConfig is a way to specify some basic code formatting rules
independently of an $EDITOR being used.
Add rules for bats/bash/sh files:
- use 4 spaces for indentation (which appears to be a de-facto standard
in this repository, see e.g. commit 86e55d0ec1);
- ignore everything in vendor directories.
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Using os.Is{Exist,NotExist,Permission} checks is not recommended in the
new code (see official documentation). While using it in the existing
code is OK, it may still result in a subtle errors later (for a specific
example of that, see [1]).
Replace those with errors.Is.
Generated by:
gofmt -r 'os.IsExist(a) -> errors.Is(a, os.ErrExist)' -w .
gofmt -r 'os.IsNotExist(a) -> errors.Is(a, os.ErrNotExist)' -w .
gofmt -r 'os.IsPermission(a) -> errors.Is(a, os.ErrPermission)' -w .
goimports -w .
git diff vendor test/tools/vendor | patch -p1 -R
[1]: https://github.com/opencontainers/runc/pull/5061
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Add rootless_port_forwarder="pasta" option that uses pesto to update
pasta's forwarding table via UNIX socket, preserving source IPs that
rootlessport's userspace proxy masks.
HostIP is stripped from port mappings in the netavark wrapper when
pasta forwarding is active because pesto handles host-side binding
while pasta's splice changes the destination IP that netavark DNAT
expects. Pesto binds both 0.0.0.0 and [::] for dual-stack support.
Fixes: https://redhat.atlassian.net/browse/RUN-2214
Fixes: https://github.com/containers/podman/issues/8193
Fixes: https://redhat.atlassian.net/browse/RUN-3587
Signed-off-by: Jan Rodák <hony.com@seznam.cz>
Used command: go get go.podman.io/storage@main && go get go.podman.io/image/v5@main && go get go.podman.io/common@main && make vendor
Signed-off-by: Jan Rodák <hony.com@seznam.cz>
- Populate the Docker-compatible container summary HostConfig from the
container inspect data
- Remove the unused ContainerCreateConfig wrapper from the compat
handler
- Add APIv2 test
Signed-off-by: Christopher Bii <christopherbii@hyub.org>