13142 Commits

Author SHA1 Message Date
5e8309464a Add Drivers method to the Network Interface
Drivers should return the list of supported network drivers by this
plugin. This is useful for podman info.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-09-15 20:00:28 +02:00
1bcd006c5f CI: load ipv6 kernel modules for rootless tests
Rootless cni with ipv6 needs the `ip6_tables` module loaded, normally
the cni plugins will load this module but as rootless it does not have
the necessary permission to do so. Therefore we load it manually.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-09-15 20:00:28 +02:00
b906b9d858 Drop OCICNI dependency
We do not use the ocicni code anymore so let's get rid of it. Only the
port struct is used but we can copy this into libpod network types so
we can debloat the binary.

The next step is to remove the OCICNI port mapping form the container
config and use the better PortMapping struct everywhere.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-09-15 20:00:28 +02:00
85e8fbf7f3 Wire network interface into libpod
Make use of the new network interface in libpod.

This commit contains several breaking changes:
- podman network create only outputs the new network name and not file
  path.
- podman network ls shows the network driver instead of the cni version
  and plugins.
- podman network inspect outputs the new network struct and not the cni
  conflist.
- The bindings and libpod api endpoints have been changed to use the new
  network structure.

The container network status is stored in a new field in the state. The
status should be received with the new `c.getNetworkStatus`. This will
migrate the old status to the new format. Therefore old containers should
contine to work correctly in all cases even when network connect/
disconnect is used.

New features:
- podman network reload keeps the ip and mac for more than one network.
- podman container restore keeps the ip and mac for more than one
  network.
- The network create compat endpoint can now use more than one ipam
  config.

The man pages and the swagger doc are updated to reflect the latest
changes.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-09-15 20:00:20 +02:00
f9d8301c47 Merge pull request #11577 from rhatdan/tmpdir
Set default storage from containers.conf for temporary images
2021-09-15 13:15:03 -04:00
218f132fdf cni network configs set ipv6 enables correctly
When configs are loaded from disk we need to check if they contain a
ipv6 subnet and set ipv6 enables to true in this case.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-09-15 18:05:27 +02:00
24bec9a76b default network: do not validate the used subnets
The default network should not be validated against used subnets, we have to ensure
that this network can always be created even when a subnet is already used on the host.
This could happen if you run a container on this net, then the cni interface will be
created on the host and "block" this subnet from being used again.
Therefore the next podman command tries to create the default net again and it would
fail because it thinks the network is used on the host.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-09-15 18:05:26 +02:00
aa7bc4e371 network create: validate the input subnet
Check that the given subnet does not conflict with existing ones (other
configs or host interfaces).

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-09-15 18:05:26 +02:00
c0cde37829 Merge pull request #11567 from giuseppe/cgroups-split-with-pods
libpod: honor --cgroups=split also with pods
2021-09-15 10:46:33 -04:00
3e77f960f6 Set default storage from containers.conf for temporary images
Fixes: https://github.com/containers/podman/issues/11107

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-09-15 10:43:51 -04:00
0b1c45bc54 container runlabel remove image tag from name
When no name is given for podman container runlabel it will default to
the image base name. However this can contain a tag. Since podman does
not accept container names with a colon the run command will fail if it
contains something like `podman run --name NAME ...`.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2004263

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-09-15 16:35:55 +02:00
81f41ca0d2 Merge pull request #11585 from flouthoc/bump-buildah-1-23-0
vendor: Bump github.com/containers/buildah from 1.22.3 to 1.23.0
2021-09-15 10:35:31 -04:00
4b6ffda31c Merge pull request #11409 from cdoern/podVolumes
Pod Volumes Support
2021-09-15 09:10:12 -04:00
4dd7bfdfaa Merge pull request #11556 from afbjorklund/distribution-info
Show variant and codename of the distribution
2021-09-15 06:25:00 -04:00
10873c6f49 Merge pull request #11578 from jelly/handle_nil_pointer_deref
api: handle nil pointer dereference in api endpoints
2021-09-15 06:23:00 -04:00
aff64dda65 Merge pull request #11574 from nalind/buildah-platforms
build: take advantage of --platform lists
2021-09-15 06:21:58 -04:00
07e9bf340a Merge pull request #11586 from Luap99/doc
[CI:DOCS] Fix example in podman machine init man page
2021-09-15 06:21:06 -04:00
962675c148 build.bats: fix copy tests after containers/buildah#3486
Fix copy tests after https://github.com/containers/buildah/pull/3486

[NO TESTS NEEDED]

Signed-off-by: Aditya Rajan <arajan@gmail.com>
2021-09-15 15:12:38 +05:30
d0c605cd3d build: mirror --authfile to filesystem if pointing to FD instead of file
Following commit makes sure that podman mirrors --authfile to a temporary
file in filesystem if arg is pointing to an FD instead of actual file
as FD can be only consumed once.

Reference:
* https://github.com/containers/buildah/pull/3498
* https://github.com/containers/buildah/issues/3070

[NO TESTS NEEDED]

Signed-off-by: Aditya Rajan <arajan@redhat.com>
2021-09-15 14:58:48 +05:30
5cafb6d18d Fix example in podman machine init man page
Fixes #11582

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-09-15 11:06:08 +02:00
222b62e7b0 vendor: Bump github.com/containers/buildah from 1.22.3 to 1.23.0
[NO TESTS NEEDED]

Signed-off-by: Aditya Rajan <arajan@redhat.com>
2021-09-15 13:30:49 +05:30
9b04e17893 api: handle nil pointer dereference in rest endpoints
When `?all=garbage` is passed to an API endpoint schema validation fails
and err is nil. Wrapf uses err to create an error message causing a nil
pointer dereference.

Signed-off-by: Jelle van der Waa <jvanderwaa@redhat.com>
2021-09-15 09:14:34 +02:00
5dbf3ee7ae build: take advantage of --platform lists
The builder can take a list of platforms in the Platforms field of its
BuildOptions argument, and we should definitely take advantage of that.

The `bud-multiple-platform-values` test from buildah exercises support
for this, so
[NO TESTS NEEDED]

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2021-09-14 17:09:06 -04:00
323fe36313 Merge pull request #11575 from jelly/doc_all_option
[CI:DOCS] Document `all` query parameter for /libpod/images/prune
2021-09-14 16:34:10 -04:00
d996ca540a Merge pull request #11561 from giuseppe/simplify-cgroups-disabled-test
tests: simplify --cgroups=disabled test and enable for rootless
2021-09-14 16:33:14 -04:00
64de4f612e Document all query parameter for /libpod/images/prune
Signed-off-by: Jelle van der Waa <jvanderwaa@redhat.com>
2021-09-14 21:54:06 +02:00
6a34045c67 Merge pull request #11170 from flouthoc/support-rootfs-overlay
rootfs: Add support for rootfs-overlay.
2021-09-14 13:14:11 -04:00
65b1ff25a3 Merge pull request #11569 from baude/macaarch64pullfcos
Use new aarch64 fcos repos
2021-09-14 13:08:13 -04:00
bb8b2ed7de Merge pull request #11559 from jwhonce/wip/generator
Enhance bindings for IDE hints
2021-09-14 13:04:11 -04:00
38c5f6721f Show variant and codename of the distribution
Along with the name (id) and the version(_id)

But only show the information if is available

Examples: Fedora CoreOS, Ubuntu Focal

[NO TESTS NEEDED]

Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
2021-09-14 17:44:42 +02:00
952fc4a6f9 Use new aarch64 fcos repos
Now that aarch64 fcos is an official thing, we no longer need to use the side repo (for lack of a better word).  We can now use the same image lookup technique as x86_64.  I removed the special lookup, moved the x86_64 lookup to generic arch, and removed the arch specific files that we no longer needed.

[NO TESTS NEEDED]

Signed-off-by: baude <baude@redhat.com>
2021-09-14 09:52:31 -05:00
20daae1de9 Merge pull request #11512 from cevich/use_nmcli_workaround_images
Cirrus: NM/CNI workaround + Remove prior-Ubuntu
2021-09-14 10:50:14 -04:00
27ebae9e90 Merge pull request #11551 from Luap99/rootlessport-restart
fix restart always with rootlessport
2021-09-14 10:49:13 -04:00
d7256be807 Enhance bindings for IDE hints
* Follow https://pkg.go.dev/cmd/go#hdr-Generate_Go_files_by_processing_source
  for leading comment
* Add godoc strings for all exposed methods for IDE support
* Copy field godoc strings into generated code as function godoc string
* Remove unused/unnecessary fields from generator.go structures
* Cleanup code regarding template usage

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2021-09-14 07:47:24 -07:00
2b21f1f046 Merge pull request #11520 from giuseppe/enable-cgroup-parent-test
test: enable --cgroup-parent test
2021-09-14 10:41:13 -04:00
84005330aa Pod Volumes Support
added support for the --volume flag in pods using the new infra container design.
users can specify all volume options they can with regular containers

resolves #10379

Signed-off-by: cdoern <cdoern@redhat.com>
2021-09-14 08:32:07 -04:00
b1768d3b08 test: enable --cgroup-parent test
and fix it for running with runc.

Closes: https://github.com/containers/podman/issues/11165

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-09-14 13:59:09 +02:00
ad26684856 Merge pull request #11449 from simnalamburt/gvproxy-path
Make gvproxy path configurable with containers.conf
2021-09-14 07:07:55 -04:00
44abc17977 libpod: honor --cgroups=split also with pods
Honor --cgroups=split also when the container is running in a pod.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-09-14 12:35:22 +02:00
65f3b16c67 tests: enable --cgroups=disabled test for rootless
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-09-14 11:43:45 +02:00
afe4d17be8 tests: simplify --cgroups=disabled test
read the cgroup directly from the container.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-09-14 11:23:36 +02:00
d3f0f09ad9 libpod: rootful close binded ports
For rootful users ports are forwarded via iptables. To make sure no
other process tries to use them, libpod will bind the ports and pass the
fds to conmon. There seems to be race when a container is restarted
because libpod tries to bind the port before the conmon process exited.

The problem only hapens with the podman service because it keeps the
connection open. Once we have the fd and passed it to conmon the
podman service should close the connection.

To verify run `sudo ss -tulpn` and check that only the conmon process
keeps the port open. Previously you would also see the podman server
process listed.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-09-14 11:13:28 +02:00
072b061b4e Search gvproxy with config.FindHelperBinary()
Closes #11531

[NO TESTS NEEDED]

Signed-off-by: Hyeon Kim <simnalamburt@gmail.com>
2021-09-14 17:14:55 +09:00
a55e2a00fc rootfs: Add support for rootfs-overlay and bump to buildah v1.22.1-0.202108
Allows users to specify a readonly rootfs with :O, in exchange podman will create a writable overlay.

bump builah to v1.22.1-0.20210823173221-da2b428c56ce

[NO TESTS NEEDED]

Signed-off-by: flouthoc <flouthoc.git@gmail.com>
2021-09-14 13:31:39 +05:30
b603c7a4b9 Merge pull request #11529 from n1hility/fix-oldfields
Add deprecated event fields for 1.22+ clients that still expect them
2021-09-13 17:17:28 -04:00
6221f269a8 fix restart always with rootlessport
When a container is automatically restarted due its restart policy and
the container uses rootless cni networking with ports forwarded we have
to start a new rootlessport process since it exits with conmon.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-09-13 22:52:39 +02:00
d30facfda8 Cirrus: NM/CNI workaround + Remove prior-Ubuntu
Ref: https://github.com/containers/automation_images/pull/88

Signed-off-by: Chris Evich <cevich@redhat.com>
2021-09-13 15:52:31 -04:00
473f958e13 Merge pull request #11545 from rhatdan/exitcodes
If container exits with 125 podman should exit with 125
2021-09-13 15:24:30 -04:00
55a7f89fca Merge pull request #11549 from containers/dependabot/go_modules/github.com/json-iterator/go-1.1.12
Bump github.com/json-iterator/go from 1.1.11 to 1.1.12
2021-09-13 14:51:29 -04:00
f07a2bfbec Merge pull request #11440 from ashley-cui/ssh
Use default username for podman machine ssh
2021-09-13 14:34:29 -04:00