198 Commits

Author SHA1 Message Date
2f6b8b94e8 enable dnsplugin for network create
when users create a new network and the dnsname plugin can be found by
podman, we will enable container name resolution on the new network.
there is an option to opt *out* as well.

tests cannot be added until we solve the packaging portion of the
dnsname plugin.

Signed-off-by: baude <bbaude@redhat.com>
2019-10-28 12:52:30 -05:00
f60a814e4d Add parsing for UID, GID in volume "o" option
Everything else is a flag to mount, but "uid" and "gid" are not.
We need to parse them out of "o" and handle them separately.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-10-22 14:32:54 -04:00
d358840ebe Merge pull request #4287 from mheon/anonymous_volumes
Add support for anonymous volumes to `podman run -v`
2019-10-22 14:50:28 +02:00
efc54c3987 Merge pull request #4284 from mheon/fix_vol_inspect
Show volume options in 'volume inspect'
2019-10-21 22:20:40 +02:00
03da8b641d Rewrite backend for remote 'volume inspect'
We need to use the new Inspect() endpoint instead of trying to
JSON the actual volume structs. Currently, the output seems
completely nonsensical; it seems like we're JSONing the struct
for the Varlink connection itself? This should restore sanity and
match the format of remote and local inspect on volumes.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-10-21 14:37:27 -04:00
d3520de633 Merge pull request #4125 from baude/remotestdin
Add ability to redirect bash for run -i
2019-10-20 13:49:08 +02:00
0d623914d0 Add support for anonymous volumes to podman run -v
Previously, when `podman run` encountered a volume mount without
separate source and destination (e.g. `-v /run`) we would assume
that both were the same - a bind mount of `/run` on the host to
`/run` in the container. However, this does not match Docker's
behavior - in Docker, this makes an anonymous named volume that
will be mounted at `/run`.

We already have (more limited) support for these anonymous
volumes in the form of image volumes. Extend this support to
allow it to be used with user-created volumes coming in from the
`-v` flag.

This change also affects how named volumes created by the
container but given names are treated by `podman run --rm` and
`podman rm -v`. Previously, they would be removed with the
container in these cases, but this did not match Docker's
behaviour. Docker only removed anonymous volumes. With this patch
we move to that model as well; `podman run -v testvol:/test` will
not have `testvol` survive the container being removed by `podman
rm -v`.

The sum total of these changes let us turn on volume removal in
`--rm` by default.

Fixes: #4276

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-10-17 13:18:17 -04:00
f2d9a9d2ab Merge pull request #4271 from tylarb/stdin_attach
Attach to container if it was created with --interactive
2019-10-17 17:38:18 +02:00
b4124485ae start: print full container ID
Now the "podman start" command prints the full ID and has the same
behaviour as other commands.

Signed-off-by: Boris Klimenko <2@borisklimenko.ru>
2019-10-16 15:16:59 +03:00
14e905e1eb Attach stdin to container at start if it was created with --interactive
Check to see if the container's start config includes the interactive
flag when determining to attach or ignore stdin stream.

This is in line with behavior of Docker CLI and engine

Signed-off-by: Tyler Ramer <tyaramer@gmail.com>
2019-10-15 16:05:14 -04:00
867d49957b Add ability to redirect bash for run -i
Signed-off-by: baude <bbaude@redhat.com>
2019-10-15 08:00:13 -05:00
6f630bc09b Move OCI runtime implementation behind an interface
For future work, we need multiple implementations of the OCI
runtime, not just a Conmon-wrapped runtime matching the runc CLI.

As part of this, do some refactoring on the interface for exec
(move to a struct, not a massive list of arguments). Also, add
'all' support to Kill and Stop (supported by runc and used a bit
internally for removing containers).

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-10-10 10:19:32 -04:00
d3f59bedb3 Update c/image to v4.0.1 and buildah to 1.11.3
This requires updating all import paths throughout, and a matching
buildah update to interoperate.

I can't figure out the reason for go.mod tracking
	github.com/containers/image v3.0.2+incompatible // indirect
((go mod graph) lists it as a direct dependency of libpod, but
(go list -json -m all) lists it as an indirect dependency),
but at least looking at the vendor subdirectory, it doesn't seem
to be actually used in the built binaries.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2019-10-04 20:18:23 +02:00
c9e936a407 Merge pull request #3549 from marcov/evict-container
Add ability to evict a container
2019-10-04 07:30:27 -07:00
c831a64bb1 Apply changes also to the windows implementation
Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
2019-10-02 20:49:09 +02:00
db694f13ba Avoid hard-coding path to varlink and podman
Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
2019-10-01 19:46:54 +02:00
32b2856e7a Allow changing IdentityFile and to IgnoreHosts
Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
2019-10-01 19:46:48 +02:00
851e3775d5 Merge pull request #4117 from mheon/pod_no_name
Add an error for pods without a name
2019-09-26 19:58:32 +02:00
0cae686c7f Add an error for pods without a name
Signed-off-by: Matthew Heon <mheon@redhat.com>
2019-09-26 09:39:01 -04:00
dacbc5beb2 rm: add containers eviction with rm --force
Add ability to evict a container when it becomes unusable. This may
happen when the host setup changes after a container creation, making it
impossible for that container to be used or removed.
Evicting a container is done using the `rm --force` command.

Signed-off-by: Marco Vedovati <mvedovati@suse.com>
2019-09-25 19:44:38 +02:00
240095e24b Merge pull request #4102 from baude/remotestdin
conditionally send stdin on remote run
2019-09-25 09:45:55 +02:00
61a226fbd5 conditionally send stdin on remote run
when running a container remotely, we should only be sending stdin when
running with --interactive; otherwise use nil.

Fixes: #4095

Signed-off-by: baude <bbaude@redhat.com>
2019-09-24 13:43:44 -05:00
e3a84b9487 play kube: Only support pod kind in k8s yaml
Since we only really support playing pods, and no other kubernetes types

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2019-09-24 09:54:55 -04:00
0d9b952aea support non-standard ssh port for remote-client
when using the remote client, users may need to specify a non-standard
port for ssh connections.  we can do so on the command line and within
the remote-client configuration file.

Fixes: #3987

Signed-off-by: baude <bbaude@redhat.com>
2019-09-17 13:42:02 -05:00
7875e00c66 Merge pull request #3934 from rhatdan/wait
Podman-remote run should wait for exit code
2019-09-13 18:12:25 +02:00
82ac0d8925 Podman-remote run should wait for exit code
This change matches what is happening on the podman local side
and should eliminate a race condition.

Also exit commands on the server side should start to return to client.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-09-12 16:20:01 -04:00
535111b5d5 Use exit code constants
We have leaked the exit number codess all over the code, this patch
removes the numbers to constants.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-09-12 16:20:01 -04:00
b94ea07265 enhance podman network rm
when removing a podman network, we need to make sure we delete the
network interface if one was ever created (by running a container).
also, when removing networks, we check if any containers are using the
network.  if they are, we error out unless the user provides a 'force'
option which will remove the containers in question.

Signed-off-by: baude <bbaude@redhat.com>
2019-09-12 14:03:52 -05:00
9a55bce9e4 Merge pull request #3896 from mheon/volume_lookup
Add ability to look up volumes by unambiguous partial name
2019-09-09 21:48:30 +02:00
7042a3d7a5 Merge pull request #3862 from baude/networkcreate
podman network create
2019-09-09 19:44:57 +02:00
046178e55f Add function for looking up volumes by partial name
This isn't included in Docker, but seems handy enough.

Use the new API for 'volume rm' and 'volume inspect'.

Fixes #3891

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-09-09 12:06:10 -04:00
ee432cf279 podman network create
initial implementation of network create.  we only support bridging
networks with this first pass.

Signed-off-by: baude <bbaude@redhat.com>
2019-09-09 09:32:43 -05:00
06f94bef1f build: pass down the cgroup manager to buildah
Pass down the cgroup manager to use to buildah.

Closes: https://github.com/containers/libpod/issues/3938

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-09-06 22:55:46 +02:00
88980859ec Merge pull request #3958 from haircommander/play-kube-sec
play kube: fix segfault
2019-09-06 15:40:13 +02:00
9259693826 play kube: fix segfault
when securityContext wasn't specified in yaml.
add a test as well

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2019-09-06 08:41:04 -04:00
a760e325f3 Add ability for volumes with options to mount/umount
When volume options and the local volume driver are specified,
the volume is intended to be mounted using the 'mount' command.
Supported options will be used to volume the volume before the
first container using it starts, and unmount the volume after the
last container using it dies.

This should work for any local filesystem, though at present I've
only tested with tmpfs and btrfs.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-09-05 17:12:27 -04:00
b263dd9e81 Merge pull request #3800 from vrothberg/generate-pod
generate systemd pod
2019-08-22 19:08:08 +02:00
56a65cffac generate systemd: support pods and geneartig files
Support generating systemd unit files for a pod.  Podman generates one
unit file for the pod including the PID file for the infra container's
conmon process and one unit file for each container (excluding the infra
container).

Note that this change implies refactorings in the `pkg/systemdgen` API.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-08-21 17:28:30 +02:00
9ced2488c9 Add --digestfile option to push
Add the digestfile option to the push command so the digest can
be stored away in a file when requested by the user.  Also have added
a debug statement to show the completion of the push.

Emulates Buildah's https://github.com/containers/buildah/pull/1799/files

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2019-08-21 10:11:52 -04:00
a33e4a89ca generate systemd: drop support for remote clients
Drop the support for remote clients to generate systemd-service files.
The generated files are machine-dependent and hence relate only to the
a local machine.  Furthermore, a proper service management when using
a remote-client is not possible as systemd has no access to a process.

Dropping the support will also reduce the risk of making users believe
that the generated services are usable in a remote scenario.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-08-21 09:41:07 +02:00
8c7014f11d Implement healthcheck for remote client
Previously unimplemented. Works the same way the local one does, except its remote.

Signed-off-by: Ashley Cui <ashleycui16@gmail.com>
2019-08-19 12:14:54 -04:00
b1acc43481 Merge pull request #3848 from giuseppe/enable-all-tests-crun
tests: enable all tests for crun
2019-08-19 16:42:19 +02:00
bd0b05f138 Merge pull request #3709 from mheon/volume_inspect
Change backend code for 'volume inspect'
2019-08-19 13:57:15 +02:00
98dee275d0 Merge pull request #3836 from chenzhiwei/hostname
Allow customizing pod hostname
2019-08-19 13:33:15 +02:00
7421124919 libpod, pkg: lookup also for crun failures
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-08-19 11:11:37 +02:00
25f40e2ef3 containers, create: debug message on failed deletion
if the container failed to be created, don't assume it is still
known to the OCI runtime.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-08-19 11:11:35 +02:00
7aefc1ac33 Allow customizing pod hostname
* set hostname in pod yaml file
* set --hostname in pod create command

Signed-off-by: Chen Zhiwei <zhiweik@gmail.com>
2019-08-18 03:48:40 +00:00
76f327f73f Merge pull request #3617 from QiWang19/create_pull
add --pull flag for podman create&run
2019-08-17 14:55:14 +02:00
704cc582ac Merge pull request #3719 from baude/networklist
inclusion of podman network
2019-08-16 17:33:31 +02:00
2d47f1ae54 Merge pull request #3796 from giuseppe/enable-cgroupsv2-crun
cirrus: enable cgroups v2 tests with crun
2019-08-16 13:20:30 +02:00