18286 Commits

Author SHA1 Message Date
a9d70e9fe2 Use append() to add elements to a slice
The code was not using append() to add items to a slice.

Accessing non allocated elements of the slice failed with:

$ podman container restore -l
panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
github.com/containers/podman/v4/pkg/domain/infra/abi.(*ContainerEngine).ContainerRestore(0xc00051a8b8, {0x1dbced0, 0xc0000440d0}, {0x2a31b30, 0x0, 0x0}, {0x0, 0x0, 0x0, 0x0, ...})
	/share/go/src/github.com/containers/podman/pkg/domain/infra/abi/containers.go:676 +0x39c
github.com/containers/podman/v4/cmd/podman/containers.restore(0x28fb6c0?, {0xc0002c9080, 0x0, 0x1?})
	/share/go/src/github.com/containers/podman/cmd/podman/containers/restore.go:171 +0x4ef
github.com/spf13/cobra.(*Command).execute(0x28fb6c0, {0xc0000400b0, 0x1, 0x1})
	/share/go/src/github.com/containers/podman/vendor/github.com/spf13/cobra/command.go:916 +0x862
github.com/spf13/cobra.(*Command).ExecuteC(0x291ab00)
	/share/go/src/github.com/containers/podman/vendor/github.com/spf13/cobra/command.go:1044 +0x3bd
github.com/spf13/cobra.(*Command).Execute(...)
	/share/go/src/github.com/containers/podman/vendor/github.com/spf13/cobra/command.go:968
github.com/spf13/cobra.(*Command).ExecuteContext(...)
	/share/go/src/github.com/containers/podman/vendor/github.com/spf13/cobra/command.go:961
main.Execute()
	/share/go/src/github.com/containers/podman/cmd/podman/root.go:107 +0xcc
main.main()
	/share/go/src/github.com/containers/podman/cmd/podman/main.go:41 +0x7c

[NO NEW TESTS NEEDED]

Signed-off-by: Adrian Reber <areber@redhat.com>
2023-03-14 08:29:46 +00:00
1c08f2edac Revert "pasta: Use two connections instead of three in TCP range forward tests"
This reverts commit e33f4e0bc7429038ba6aa82285ae8749c9037c88, going
back to three connections (not two) for each range in TCP tests. I'm
not sure yet what caused the original issue, but it might be fixed
now. If it does, this fixes #17287.

Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
2023-03-13 20:40:15 +01:00
519cfa81f6 Merge pull request #17739 from giuseppe/reenable-test
test: reenable idmap test
2023-03-13 15:22:27 -04:00
ad8a96ab95 Support running nested SELinux container separation
Currently Podman prevents SELinux container separation,
when running within a container. This PR adds a new
--security-opt label=nested

When setting this option, Podman unmasks and mountsi
/sys/fs/selinux into the containers making /sys/fs/selinux
fully exposed. Secondly Podman sets the attribute
run.oci.mount_context_type=rootcontext

This attribute tells crun to mount volumes with rootcontext=MOUNTLABEL
as opposed to context=MOUNTLABEL.

With these two settings Podman inside the container is allowed to set
its own SELinux labels on tmpfs file systems mounted into its parents
container, while still being confined by SELinux. Thus you can have
nested SELinux labeling inside of a container.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-03-13 14:21:12 -04:00
159936a114 bud tests: rootless remote: use correct socket path
Another followup to #17608. Nightly tests were hanging,
because /run/podman/podman.sock was hardcoded (bad idea
for rootless). Poor testing on my part.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-03-13 10:59:38 -06:00
3920799553 Merge pull request #17581 from vrothberg/fix-17571
compat: /auth: parse server address correctly
2023-03-13 11:13:40 -04:00
6f9f395b3c build(deps): bump github.com/vbauerster/mpb/v8 from 8.2.1 to 8.3.0
Bumps [github.com/vbauerster/mpb/v8](https://github.com/vbauerster/mpb) from 8.2.1 to 8.3.0.
- [Release notes](https://github.com/vbauerster/mpb/releases)
- [Commits](https://github.com/vbauerster/mpb/compare/v8.2.1...v8.3.0)

---
updated-dependencies:
- dependency-name: github.com/vbauerster/mpb/v8
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-13 12:59:15 +00:00
bad41f67e7 compat: /auth: parse server address correctly
Use `auth.Login` as `podman login` does which parses and normalizes the
input addresses correctly, especially for docker.io.

[NO NEW TESTS NEEDED] as we do not have means to test logging into
docker.io in CI.

Fixes: #17571
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-03-13 13:41:49 +01:00
5cb18a9f47 Merge pull request #17747 from Heniker/main
[CI:DOCS] fix cmd `set DOCKER_HOST` suggestion
2023-03-13 05:24:15 -04:00
6363fb08f2 docs: fix cmd set DOCKER_HOST suggestion
Signed-off-by: Heniker <Heniker@mail.ru>
2023-03-13 08:11:45 +03:00
fb4f6f95c5 test: reenable idmap test
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-03-11 12:15:38 +01:00
25f976e276 Merge pull request #17724 from containers/dependabot/go_modules/google.golang.org/protobuf-1.29.0
build(deps): bump google.golang.org/protobuf from 1.28.1 to 1.29.0
2023-03-09 14:29:49 -05:00
9a45503c80 Merge pull request #17249 from rhatdan/qm
Must use mountlabel when creating builtin volumes
2023-03-09 14:27:05 -05:00
615d80ef19 Merge pull request #17386 from rhatdan/network
podman inspect list network when using --net=host or none
2023-03-09 14:07:37 -05:00
b5a99e0816 Must use mountlabel when creating builtin volumes
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-03-09 12:36:52 -05:00
80be8c3d64 Merge pull request #17725 from lsm5/modulesload-conditional-rhel10
podman.spec.rpkg: distro conditionals for modulesloaddir
2023-03-09 12:20:30 -05:00
8d952c01df podman.spec.rpkg: distro conditionals for modulesloaddir
RHEL 8 and 9 don't have /usr/lib/modules-load.d yet.

Related dist-git commit:
c82d37a5b3

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2023-03-09 19:16:16 +05:30
9294b73508 build(deps): bump google.golang.org/protobuf from 1.28.1 to 1.29.0
Bumps [google.golang.org/protobuf](https://github.com/protocolbuffers/protobuf-go) from 1.28.1 to 1.29.0.
- [Release notes](https://github.com/protocolbuffers/protobuf-go/releases)
- [Changelog](https://github.com/protocolbuffers/protobuf-go/blob/master/release.bash)
- [Commits](https://github.com/protocolbuffers/protobuf-go/compare/v1.28.1...v1.29.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-09 12:58:56 +00:00
21651706e3 podman inspect list network when using --net=host or none
This will match Docker behaviour.

Fixes: https://github.com/containers/podman/issues/17385

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-03-08 17:27:08 -05:00
747369c82d Merge pull request #17713 from sbrivio-rh/pasta
pasta: Re-enable "Local forwarder, IPv4" test now that packages in CI images are fixed
2023-03-08 20:22:45 +01:00
f928cf54aa pasta: Re-enable "Local forwarder, IPv4" test, accept NXDOMAIN as response
This case is fixed by passt commit bad252687271 ("conf, udp: Allow
any loopback address to be used as resolver") and the fix is now
available in packages included by the CI images.

Note that, depending on the resolver on the host, we might get
1.0.0.127.in-addr.arpa resolved to localhost, or simply NXDOMAIN for
it: accept a failure on the nslookup command, as long as we have a
response for 1.0.0.127.in-addr.arpa in the output. If we have any
response, that means we could talk to the resolver.

Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
2023-03-08 17:09:40 +01:00
2a6a80ef74 Merge pull request #17714 from containers/dependabot/go_modules/test/tools/golang.org/x/tools-0.7.0
build(deps): bump golang.org/x/tools from 0.6.0 to 0.7.0 in /test/tools
2023-03-08 16:11:46 +01:00
c0ef542213 Merge pull request #17706 from adrianreber/2023-03-07-unwrap
Update checkpointctl v0.1.0
2023-03-08 16:05:55 +01:00
829e910cde build(deps): bump golang.org/x/tools from 0.6.0 to 0.7.0 in /test/tools
Bumps [golang.org/x/tools](https://github.com/golang/tools) from 0.6.0 to 0.7.0.
- [Release notes](https://github.com/golang/tools/releases)
- [Commits](https://github.com/golang/tools/compare/v0.6.0...v0.7.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-08 13:02:30 +00:00
cc7a1e6148 CI: Switch to c20230307t192532z-f37f36d12 images
They include Fedora package passt-0^20230227.gc538ee8-1.fc37 and
passt-0.0~git20230227.c538ee8-1 for Debian, so that we can re-enable
the "Local Forwarder, IPv4" test for pasta(1).

Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
2023-03-08 13:42:34 +01:00
f7ac9fd5d6 Merge pull request #17700 from cevich/parallel_system
Cirrus: Run system & integration tests in parallel
2023-03-07 23:35:19 +01:00
799c201776 Cirrus: Run system & integration tests in parallel
Given that flakes inevitably occur as testing grows wider, position the
system tests in parallel with the integration tests as much as possible.
The thinking here is, flaking sooner is better than later.  This is
because it provides an earlier opportunity for developers to re-run
tasks.

Signed-off-by: Chris Evich <cevich@redhat.com>
2023-03-07 14:29:31 -05:00
c03cb57183 Update checkpointctl v0.1.0
With a minor fix during error unwrapping.

[NO NEW TESTS NEEDED]

Signed-off-by: Adrian Reber <areber@redhat.com>
2023-03-07 18:28:39 +00:00
45e27766e6 Merge pull request #17698 from containers/dependabot/go_modules/golang.org/x/net-0.8.0
build(deps): bump golang.org/x/net from 0.7.0 to 0.8.0
2023-03-07 11:26:41 +01:00
971a87f0ab Merge pull request #17691 from restitux/main
Quadlet: add support for setting --ip and --ip6
2023-03-07 11:19:02 +01:00
cb3cda55f2 Quadlet: add support for setting --ip and --ip6
Signed-off-by: restitux <restitux@ohea.xyz>
2023-03-06 18:36:41 -07:00
af7a759e9d build(deps): bump golang.org/x/net from 0.7.0 to 0.8.0
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.7.0 to 0.8.0.
- [Release notes](https://github.com/golang/net/releases)
- [Commits](https://github.com/golang/net/compare/v0.7.0...v0.8.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>
2023-03-07 01:34:11 +00:00
b6b19bdfc0 Merge pull request #17699 from containers/dependabot/go_modules/golang.org/x/sys-0.6.0
build(deps): bump golang.org/x/sys from 0.5.0 to 0.6.0
2023-03-07 02:32:35 +01:00
72fbbd5598 Merge pull request #17695 from dfr/freebsd-cleanup
libpod: avoid nil pointer dereference in (*Container).Cleanup
2023-03-06 17:11:03 +01:00
5d039ce222 build(deps): bump golang.org/x/sys from 0.5.0 to 0.6.0
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.5.0 to 0.6.0.
- [Release notes](https://github.com/golang/sys/releases)
- [Commits](https://github.com/golang/sys/compare/v0.5.0...v0.6.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>
2023-03-06 13:00:25 +00:00
34ff27b813 libpod: avoid nil pointer dereference in (*Container).Cleanup
On FreeBSD, c.config.Spec.Linux is not populated - in this case, we can
assume that the container is not using a pid namespace.

[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2023-03-06 11:51:42 +00:00
8b424dcbe2 Merge pull request #17683 from TomSweeneyRedHat/dev/tsweeney/lockdoc
[CI:DOCS] Add image not found info to troubleshooting
2023-03-03 21:01:21 +01:00
f79a12972c Merge pull request #17686 from n1hility/fix-restore
Fix package restore of shadow-utils on Windows
2023-03-03 19:45:18 +01:00
25dd4d653e [CI:DOCS] Add image not found info to troubleshooting
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2139191

We have a timing issue when doing a build or pull of an image and
a second process is removing them at the same time.  This is not
a window we're going to close now, so I'm adding a note to the
troubleshooting guide to document it.

[NO NEW TESTS NEEDED]
Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2023-03-03 11:22:57 -05:00
76642d5ad3 Merge pull request #17684 from giuseppe/version-no-userns
cmd: do not require userns for "version"
2023-03-03 16:56:05 +01:00
3f0f558609 Merge pull request #17677 from vyasgun/pr/system-default-connection
fix: update the default machine value when the previously set default machine is deleted
2023-03-03 14:50:12 +01:00
0498ce3a56 cmd: do not require userns for "version"
Closes: https://github.com/containers/podman/issues/17657

[NO NEW TESTS NEEDED]

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-03-03 14:27:54 +01:00
2860d55c97 cmd: drop special handling for "scp"
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-03-03 14:27:54 +01:00
da04469f06 cmd: clarify meaning of ParentNSRequired
there are no commands that are not supported by rootless mode, but
some commands require to run in the user namespace.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-03-03 14:27:54 +01:00
0625c85ef3 Merge pull request #17678 from vrothberg/db-backend
sqlite: add a hidden --db-backend flag
2023-03-03 13:56:37 +01:00
0ab4b26147 Fix package restore
Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2023-03-02 20:53:38 -06:00
d4b221589a Merge pull request #17620 from cevich/disable_version_check
[CI:DOCS] Fix docs/version-check always requesting updates
2023-03-03 02:16:12 +01:00
0d219486f7 [CI:DOCS] Fix docs/version-check always requesting updates
As suggested by @edsantiago, the complex script and direct-link in the
docs are adding little value while increasing the CI maintenance burden.
Simply retire the script and strip the direct (versioned) links from the
docs.

Signed-off-by: Chris Evich <cevich@redhat.com>
2023-03-02 14:18:20 -05:00
ce67bbffa9 Merge pull request #17661 from xordspar0/chrony-makestep
podman machine: Adjust Chrony makestep config
2023-03-02 14:39:53 +01:00
e77f370f86 sqlite: add a hidden --db-backend flag
Add a hidden flag to set the database backend and plumb it into
podman-info.  Further add a system test to make sure the flag and the
info output are working properly.

Note that the test may need to be changed once we settled on how
to test the sqlite backend in CI.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-03-02 13:43:11 +01:00