219 Commits

Author SHA1 Message Date
d919961f62 Merge pull request #4451 from giuseppe/set-mac
podman: add support for specifying MAC
2019-11-07 20:26:14 +01:00
b4a83bf9ae Merge pull request #4447 from rhatdan/runasuser
Add support for RunAsUser and RunAsGroup
2019-11-07 16:05:03 +01:00
a889fd397a Merge pull request #4441 from rhatdan/detach
Allow users to disable detach keys
2019-11-07 15:16:36 +01:00
a6108f1c19 Add support for RunAsUser and RunAsGroup
Currently podman generate kube does not generate the correct RunAsUser and RunAsGroup
options in the yaml file.  This patch fixes this.

This patch also make `podman play kube` use the RunAdUser and RunAsGroup options if
they are specified in the yaml file.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-11-06 10:35:37 -05:00
2497b6c77b podman: add support for specifying MAC
I basically copied and adapted the statements for setting IP.

Closes #1136

Signed-off-by: Jakub Filak <jakub.filak@sap.com>
2019-11-06 16:22:19 +01:00
7c623bd41f Allow users to disable detach keys
If user specifies --detach-keys="", this will disable the feature.

Adding define.DefaultDetachKeys to help screen to help identify detach keys.

Updated man pages with additonal information.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-11-05 14:10:43 -05:00
65ed819932 Set SELinux labels based on the security context in the kube.yaml
If the kube.yaml specifieds the SELinux type or Level, we need the container
to be launched with the correct label.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-11-05 04:09:01 -05:00
95bc917b49 runtime: Fix typo
Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
2019-11-02 01:44:22 +00:00
69165fa04d Merge pull request #4400 from haircommander/exec-hang
Switch to bufio Reader for exec streams
2019-11-01 14:34:40 +01:00
11750df510 logs: support --tail 0
change the default to -1, so that we can change the semantic of
"--tail 0" to not print any existing log line.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-10-31 19:55:36 +01:00
1df4dba0a0 Switch to bufio Reader for exec streams
There were many situations that made exec act funky with input. pipes didn't work as expected, as well as sending input before the shell opened.
Thinking about it, it seemed as though the issues were because of how os.Stdin buffers (it doesn't). Dropping this input had some weird consequences.
Instead, read from os.Stdin as bufio.Reader, allowing the input to buffer before passing it to the container.

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2019-10-31 11:20:12 -04:00
dc3e3af256 container start: fix regression when using name
When starting a container by using its name as a reference, we should
print the name instead of the ID.  We regressed on this behaviour
with commit b4124485ae7e which made it into Podman v1.6.2.

Kudos to openSUSE testing for catching it.  To prevent future
regressions, extend the e2e tests to check the printed container
name/ID.

Reported-by: @sysrich
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-10-31 14:24:41 +01:00
7318b0e8c7 Merge pull request #4369 from baude/golandautocodecorrections
goland autocorrections
2019-10-30 14:29:46 +01:00
66c126d6de Set default seccomp.json file for podman play kube
Currently podman play kube is not using the system default seccomp.json file.
This PR will use the default or override location for podman play.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-10-29 13:43:45 -04:00
07195ff09f API: report multiple digests for images
Be prepared to report multiple image digests for images which contain
multiple manifests but, because they continue to have the same set of
layers and the same configuration, are considered to be the same image.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2019-10-29 13:35:19 -04:00
a4a70b4506 bump containers/image to v5.0.0, buildah to v1.11.4
Move to containers/image v5 and containers/buildah to v1.11.4.

Replace an equality check with a type assertion when checking for a
docker.ErrUnauthorizedForCredentials in `podman login`.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2019-10-29 13:35:18 -04:00
91baaee9a8 goland autocorrections
just ran the autocorrect code corrections from goland and it found a few
nits.

Signed-off-by: baude <bbaude@redhat.com>
2019-10-29 12:18:50 -05:00
f17e152818 Merge pull request #4360 from rhatdan/spell
Fix spelling mistakes
2019-10-29 14:59:51 +01:00
815bd568b2 Merge pull request #4187 from baude/dnspluginenable
enable dnsplugin for network create
2019-10-29 14:46:38 +01:00
797288222b Fix spelling mistakes
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-10-29 03:47:32 -04:00
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
1d00acee19 Log warn instead of error for removing nonexistant container
In event of a container removal that is no longer in database, log a
warning instead of an error, as there is not any problem continuing
execution.

Resolves #4314

Signed-off-by: Tyler Ramer <tyaramer@gmail.com>
2019-10-25 16:25:42 -04: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