11299 Commits

Author SHA1 Message Date
2e9a46c729 Merge pull request #9870 from edsantiago/manpage_doubledash_helper
[CI:DOCS] manpage xref: helpful diagnostic for unescaped dash-dash
2021-03-29 19:53:36 +00:00
cc0bcea4ea manpage xref: helpful diagnostic for unescaped dash-dash
PR #9856 works around a buggy markdown processor that cleverly
converts double dashes to em-dash. The unfortunate result is
that the man page source files are unmaintainable, because
every '--foo' has to be specified as '\-\-foo'. This is
impossible for humans to remember, so let's add a helpful
diagnostic message when we detect new options added without
the escapes.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-03-29 13:00:11 -06:00
aa96cb6739 Merge pull request #9855 from giuseppe/fix-service-race-condition
service: use LISTEN_FDS
2021-03-29 17:40:21 +00:00
26b0ebd22f Merge pull request #9516 from rhatdan/shrink
[NO TESTS NEEDED] Shrink the size of podman bindings
2021-03-29 17:14:26 +00:00
b7bb8a1fb9 Merge pull request #9842 from AlbanBedel/play-kube-env-from-secrets
Add support for env from secrets in play kube
2021-03-29 17:10:25 +00:00
bb3e8a4d13 Merge pull request #9858 from rhatdan/warn
[NO TESTS NEEDED] Drop Warning to Info, if cgroups not mounted
2021-03-29 17:04:24 +00:00
58bf62f2d1 Merge pull request #9861 from TristanCacqueray/version-swagger
[CI:DOCS] swagger: update system version response body
2021-03-29 17:01:22 +00:00
3d6dcdc7a4 Merge pull request #9862 from edsantiago/bud_reenable_pull_never
buildah-bud tests: reenable pull-never test
2021-03-29 15:27:42 +00:00
08eab3f8f7 Merge pull request #9307 from Luap99/powershell-completion
Add powershell completions
2021-03-29 15:17:44 +00:00
00792f8c95 Merge pull request #9856 from Luap99/fix-longflag
[CI:DOCS] Fix long option format on docs.podman.io
2021-03-29 14:40:44 +00:00
5e156c892c Merge pull request #9857 from edsantiago/bats
system tests: friendier messages for 2-arg is()
2021-03-29 14:37:42 +00:00
236943d3c1 Merge pull request #9848 from Luap99/fix-9776
podman generate systemd --new do not duplicate params
2021-03-29 14:32:41 +00:00
48549ccc17 swagger: update system version response body
This change updates the swagger documentation of the
system version response body to match the actual
response.

Fixes: #9522
Signed-off-by: Tristan Cacqueray <tdecacqu@redhat.com>
2021-03-29 14:25:25 +00:00
8e01f48d84 Merge pull request #9844 from afbjorklund/qemu-kvm
Add machine support for more Linux distros
2021-03-29 14:10:42 +00:00
0ca8d8601f buildah-bud tests: reenable pull-never test
Issue #9573 (podman build --pull-never is a NOP) is fixed.
Remove the 'skip' in the buildah-bud pull-never test.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-03-29 07:55:56 -06:00
127400880a [NO TESTS NEEDED] Shrink the size of podman-remote
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-03-29 09:49:45 -04:00
ac3499cc96 Merge pull request #9631 from rhatdan/pull
Fix podman build --pull-never
2021-03-29 13:41:42 +00:00
6a78fcaa0a Add powershell completions
Add support for generating powershell completion files. This is especially
useful for people using the podman remote client on windows.

[NO TESTS NEEDED]

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-03-29 15:00:09 +02:00
195f340ad4 [NO TESTS NEEDED] Drop Warning to Info, if cgroups not mounted
If I run podman within a container without /sys/fs/cgroups mounted,
we get this warning, which the user can not do much about.  I don't
see a reason for requiring this warning to show by default, so we
should drop it to Info.

User can not do anything about it either, and code works well with
the somewhat expected error.

Helps fix: https://github.com/containers/podman/issues/9753

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-03-29 08:45:11 -04:00
bc48211924 Fix long option format on docs.podman.io
Escape the two dashes, otherwise they are combined into one long dash.
I tested that this change is safe and still renders correctly on github
and with the man pages.

This commit also contains a small change to make it build locally.
Assuming you have the dependencies installed you can do:
```
cd docs
make html
```
Preview the html files in docs/build/html with
`python -m http.server 8000 --directory build/html`.

Fixes containers/podman.io#373

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-03-29 14:38:25 +02:00
06ae12bd4e system tests: friendier messages for 2-arg is()
The 'is' check was intended to be called with three arguments,
the last one being a nice helpful test name. There's a fallback
for two-argument calls, but it was a horrible FIXME.

New fallback: the most recently run podman command. We keep
track of it in each run_podman() invocation.

This is not ideal, because it's theoretically possible to
invoke 'is' on something other than the output of run_podman,
but this at least fixes the by-far-most-common case.

[NO TESTS NEEDED]

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-03-29 06:10:42 -06:00
c064acd78e service: use LISTEN_FDS
if LISTEN_FDS is specified by systemd, we need to use the first fd
after the std files (so fd=3) to read from the activation socket
instead of manually opening the UNIX socket.

[NO TESTS NEEDED]

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-03-29 13:51:06 +02:00
259004f0a9 Merge pull request #9854 from vrothberg/fix-9853
[CI:DOCS] man pages: correct seccomp-policy label
2021-03-29 11:35:40 +00:00
fe270c7524 man pages: correct seccomp-policy label
The implementation uses `io.containers.seccomp.profile` while the docs
mentioned `io.podman`.  Correct the two references in the docs to
reflect the implementation.

Fixes: #9853
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-03-29 11:45:59 +02:00
2446bdc7bb rootless: use is_fd_inherited
since we already have an exported function that does the check,
refactor the code to use it instead of duplicating the logic.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-03-29 11:44:43 +02:00
aabafc5b1b podman generate systemd --new do not duplicate params
podman generate systemd --new inserts extra idfile arguments. The
generated unit can break when the user did provide their own idfile
arguments as they overwrite the arguments added by generate systemd.
This also happens when a user tries to generate the systemd unit on
a container already create with a --new unit. This should now
create a identical unit. The solution is to remove all user provided
idfile arguments.

This commit also ensures that we do not remove arguments that are part
off the containers entrypoint.

Fixes #9776

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-03-28 20:01:17 +02:00
ccbe7e9456 Merge pull request #9829 from rhatdan/rmi
[NO TESTS NEEDED] Use same function podman-remote rmi as podman
2021-03-28 17:07:45 +00:00
c59eb6f12b play kube: add support for env vars defined from secrets
Add support for secretRef and secretKeyRef to allow env vars to be set
from a secret. As K8S secrets are dictionaries the secret value must
be a JSON dictionary compatible with the data field of a K8S secret
object. The keys must consist of alphanumeric characters, '-', '_'
or '.', and the values must be base64 encoded strings.

Signed-off-by: Alban Bedel <albeu@free.fr>
2021-03-28 15:03:29 +02:00
e5ff694855 play kube: support optional/mandatory env var from config map
In K8S the pod creation fails if an env var reference a non existing
config map key. It can be marked as optional, but per default it is
mandatory. Podman on the other hand always treat such references as
optional.

Rework envVarsFrom() and envVarValue() to additionaly return an error
and add support for the optional attribute in configMapRef and
configMapKeyRef.

Signed-off-by: Alban Bedel <albeu@free.fr>
2021-03-28 15:02:31 +02:00
9f92b8b0d8 play kube: prepare supporting other env source than config maps
Rework envVarsFromConfigMap() and envVarValue() to simplify supporting
other env sources than config maps. For this we pass the whole spec
generator options struct as parameter instead of just the config maps
list. Then we rename envVarsFromConfigMap() to envVarsFrom() and in
envVarValue() we reposition the loop over the config maps to only run
it when a configMapRef element exists.

Signed-off-by: Alban Bedel <albeu@free.fr>
2021-03-28 15:01:24 +02:00
f606e9e3c4 Add machine support for more Linux distros
There are no regression tests for machine

[NO TESTS NEEDED]

Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
2021-03-28 13:35:56 +02:00
7e4b13b946 Merge pull request #9467 from rhatdan/buildah
[NO TESTS NEEDED] Turn on podman-remote build --isolation
2021-03-28 11:00:45 +00:00
eb82c48cc5 [NO TESTS NEEDED] Use same function podman-remote rmi as podman
Make sure fixes that go into local podman commands also work in
podman-remote, by using the same function.

Since this is just a rewrite of existing code, existing tests should
handle it.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-03-28 06:56:44 -04:00
b2e7a3e45c Merge pull request #9836 from baude/vmcreateresize
Podman machine enhancements
2021-03-28 10:55:45 +00:00
4831d41346 Merge pull request #9838 from xordspar0/kubeVolumeErrors
Add problematic volume name to kube play error messages
2021-03-28 10:54:44 +00:00
7a79f708a4 Podman machine enhancements
Podman machine remove is now called `rm`.

Podman machine create now supports resizing the image to the value of
--disk-size as provided.  The default is to 10G.

Added systemd unit file on guest via ignition that sends a Ready message
to the host over a virtio-socket so that we know when the VM is booted
and ready for use.

Podman machine commands no longer require a VM name as an argument.  A
default VM name is defined and if no VM name is provided as a arg, the
default will be used.

[NO TESTS NEEDED]

Signed-off-by: baude <bbaude@redhat.com>
2021-03-27 10:08:11 -05:00
dce877c5ca Add problematic volume name to kube play error messages
When kube play fails to create a volume, it should say which volume had
the problem so the user doesn't have to guess. For the following pod
spec:

	apiVersion: v1
	kind: Pod
	metadata:
	  name: mypod
	spec:
	  containers:
	    - name: myfrontend
	      image: nginx
	      volumeMounts:
	      - mountPath: "/var/www/html"
		name: mypd
	  volumes:
	    - name: mypd
	      hostPath:
		path: /var/blah

podman will now report:

	Error: failed to create volume "mypd": error in parsing HostPath
	in YAML: error checking path "/var/blah": stat /var/blah: no such
	file or directory

Signed-off-by: Jordan Christiansen <xordspar0@gmail.com>
2021-03-27 09:46:30 -05:00
ec47312eeb Merge pull request #9822 from jmguzik/fix-pods-list-filters-http-api
Fix list pods filter handling in libpod api
2021-03-27 12:36:47 +00:00
4d51995377 Fix podman build --pull-never
Currently pull policy is set incorrectly when users set --pull-never.

Also pull-policy is not being translated correctly when using
podman-remote.

Fixes: #9573

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-03-27 05:33:30 -04:00
5afcaeeaef Merge pull request #9835 from ntkme/check-userns-support
[NO TESTS NEEDED] Fix for kernel without CONFIG_USER_NS
2021-03-27 09:27:47 +00:00
a2e834d0d9 [NO TESTS NEEDED] Fix for kernel without CONFIG_USER_NS
Signed-off-by: Natsuki <i@ntk.me>
2021-03-26 21:03:24 -07:00
6e250c317c [NO TESTS NEEDED] Turn on podman-remote build --isolation
Currently podman only works with --isolation chroot.  This PR
fixes this by allowing the isolation mode to default to OCI and to
also allow users to pass the isolation mode into the containers.

The current tests for --isolation should cause this code to be tested.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-03-26 22:04:14 -04:00
4d0b583340 Merge pull request #9833 from rhatdan/resize
Remove resize race condition
2021-03-27 00:05:47 +00:00
f3024b906c Merge pull request #9821 from rhatdan/VENDOR
[NO TESTS NEEDED] Vendor in containers/buildah v1.20.0
2021-03-26 19:38:49 +00:00
85015a5e23 Fix list pods filter handling in libpod api
Signed-off-by: Jakub Guzik <jakubmguzik@gmail.com>
2021-03-26 20:19:12 +01:00
dcabf6dd71 Remove resize race condition
Since podman-remote resize requests can come in at random times, this
generates a real potential for race conditions. We should only be
attempting to resize TTY on running containers, but the containers can
go from running to stopped at any time, and returning an error to the
caller is just causing noice.

This change will basically ignore requests to resize terminals if the
container is not running and return the caller to success.  All other
callers will still return failure.

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

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-03-26 15:15:17 -04:00
c81e273835 Merge pull request #9832 from rhatdan/commit
Use TMPDIR when commiting images
2021-03-26 18:31:52 +00:00
fc197fb4f5 [NO TESTS NEEDED] Vendor in containers/buildah v1.20.0
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-03-26 13:57:27 -04:00
47006d32ed Merge pull request #9726 from tunacado/add_runroot_mount_require_to_systemd_gen
Add RequiresMountsFor= to systemd generate
2021-03-26 15:59:12 +00:00
fa6ba9b00f Merge pull request #9826 from containers/dependabot/go_modules/github.com/vbauerster/mpb/v6-6.0.3
Bump github.com/vbauerster/mpb/v6 from 6.0.2 to 6.0.3
2021-03-26 14:06:09 +00:00