summaryrefslogtreecommitdiff
path: root/libpod
Commit message (Collapse)AuthorAge
* Merge pull request #7943 from baude/issue7807OpenShift Merge Robot2020-10-07
|\ | | | | prevent unpredictable results with network create|remove
| * prevent unpredictable results with network create|removebaude2020-10-07
| | | | | | | | | | | | | | | | | | | | due to a lack of "locking" on cni operations, we could get ourselves in trouble when doing rapid creation or removal of networks. added a simple file lock to deal with the collision and because it is not considered a performent path, use of the file lock should be ok. if proven otherwise in the future, some generic shared memory lock should be implemented for libpod and also used here. moved pkog/network to libpod/network because libpod is now being pulled into the package and it has therefore lost its generic nature. this will make it easier to absorb into libpod as we try to make the network closer to core operations. Fixes: #7807 Signed-off-by: baude <bbaude@redhat.com>
* | Populate /etc/hosts file when run in a user namespaceDaniel J Walsh2020-10-07
|/ | | | | | | | | We do not populate the hostname field with the IP Address when running within a user namespace. Fixes https://github.com/containers/podman/issues/7490 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* Merge pull request #7929 from kolyshkin/nits-errOpenShift Merge Robot2020-10-06
|\ | | | | Nits
| * Lowercase some errorsKir Kolyshkin2020-10-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit is courtesy of ``` for f in $(git ls-files *.go | grep -v ^vendor/); do \ sed -i 's/\(errors\..*\)"Error /\1"error /' $f; done for f in $(git ls-files *.go | grep -v ^vendor/); do \ sed -i 's/\(errors\..*\)"Failed to /\1"failed to /' $f; done ``` etc. Self-reviewed using `git diff --word-diff`, found no issues. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
| * Remove excessive error wrappingKir Kolyshkin2020-10-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In case os.Open[File], os.Mkdir[All], ioutil.ReadFile and the like fails, the error message already contains the file name and the operation that fails, so there is no need to wrap the error with something like "open %s failed". While at it - replace a few places with os.Open, ioutil.ReadAll with ioutil.ReadFile. - replace errors.Wrapf with errors.Wrap for cases where there are no %-style arguments. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
* | Support max_size logoptionsDaniel J Walsh2020-10-05
|/ | | | | | | | Docker supports log-opt max_size and so does conmon (ALthough poorly). Adding support for this allows users to at least make sure their containers logs do not become a DOS vector. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* Merge pull request #7913 from ↵OpenShift Merge Robot2020-10-05
|\ | | | | | | | | andylibrian/kube-generate-support-resource-limits-7855 Add support for resource memory limit to generate kube
| * Add TODO for adding CPU limit supportAndy Librian2020-10-05
| | | | | | | | Signed-off-by: Andy Librian <andylibrian@gmail.com>
| * Add support for resource memory limit to generate kubeAndy Librian2020-10-04
| | | | | | | | | | | | addresses #7855 Signed-off-by: Andy Librian <andylibrian@gmail.com>
* | Add SELinux support for podsDaniel J Walsh2020-10-02
| | | | | | | | | | | | | | | | | | | | All containers within a Pod need to run with the same SELinux label, unless overwritten by the user. Also added a bunch of SELinux tests to make sure selinux labels are correct on namespaces. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* | Merge pull request #7882 from giuseppe/check-for-gids-before-adding-themOpenShift Merge Robot2020-10-02
|\ \ | | | | | | libpod: check there are enough gids before adding them
| * | libpod: check the gid is present before adding itGiuseppe Scrivano2020-10-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | check there are enough gids in the user namespace before adding supplementary gids from /etc/group. Follow-up for baede7cd2776b1f722dcbb65cff6228eeab5db44 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
* | | Merge pull request #7893 from ashley-cui/journaldOpenShift Merge Robot2020-10-02
|\ \ \ | | | | | | | | Fix Podman logs reading journald
| * | | Fix Podman logs reading journaldAshley Cui2020-10-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | A podman could not read logs written to journald properly, due to a tail config bug. Added a system test to check this - since e2e tests don't like journald Signed-off-by: Ashley Cui <acui@redhat.com>
* | | | Merge pull request #7887 from vrothberg/fix-7872OpenShift Merge Robot2020-10-02
|\ \ \ \ | | | | | | | | | | image prune: remove all candidates
| * | | | image prune: remove all candidatesValentin Rothberg2020-10-02
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | Make sure to remove images until there's nothing left to prune. A single iteration may not be sufficient. Fixes: #7872 Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
* | | | Merge pull request #7622 from hxtk/masterOpenShift Merge Robot2020-10-02
|\ \ \ \ | |/ / / |/| | | Fix for incorrect evaluation of error condition within libpod.LabelVolumePath.
| * | | Fix mismatch between log messages and behavior of libpod.LabelVolumePath.Peter2020-09-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A reading of LabelVolumePath suggests that the intended behavior upon encountering ENOTSUP is to log the issue and continue without error, while all other errors in the Relabeling operation should be considered errors of LabelVolumePath and passed up accordingly. This is not the behavior that is encountered, as this test shows: it is instead considered an error if and only if the Relabeling operation returns ENOTSUP, spitting out a somewhat incongruous error message, while all other error types that may be returned are logged without being propogated, with an even more incongruous error message saying that the operation was not supported. The comparison was changed to match the behavior documented by the log messages, and a test was added that will simulate executing this function on a path where the mounted filesystem does not support SELinux labels, with the assertion that the function should not return an error in order to highlight the condition these changes seek to alleviate. Signed-off-by: Peter <peter@psanders.me>
* | | | Add additionalGIDs from users in rootless modeDaniel J Walsh2020-10-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a risk here, that if the GID does not exists within the User Namespace the container will fail to start. This is only likely to happen in HPC Envioronments, and I think we should add a field to disable it for this environment, Added a FIXME for this issue. We currently have this problem with running a rootfull container within a user namespace, it will fail if the GID is not available. I looked at potentially checking the usernamespace that you are assigned to, but I believe this will be very difficult to code up and to figure out. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* | | | image look up: consult registries.confValentin Rothberg2020-09-30
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | When looking up local images, take the unqualified-serach registries of the registries.conf into account (on top of "localhost/"). Also extend the integration tests to prevent future regressions. Fixes: #6381 Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
* | | Merge pull request #7841 from AkihiroSuda/fix-7789OpenShift Merge Robot2020-09-30
|\ \ \ | | | | | | | | rootless-cni-infra v3: fix cleaning up DNS entries
| * | | libpod: bump up rootless-cni-infra to v3Akihiro Suda2020-09-30
| | | | | | | | | | | | | | | | Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
* | | | Merge pull request #7825 from rhatdan/exitcodeOpenShift Merge Robot2020-09-30
|\ \ \ \ | | | | | | | | | | Fix handling of remove of bogus volumes, networks and Pods
| * | | | Fix handling of remove of bogus volumes, networks and PodsDaniel J Walsh2020-09-29
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In podman containers rm and podman images rm, the commands exit with error code 1 if the object does not exists. This PR implements similar functionality to volumes, networks, and Pods. Similarly if volumes or Networks are in use by other containers, and return exit code 2. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* | | | Merge pull request #7827 from vrothberg/systemd-run-errorOpenShift Merge Robot2020-09-30
|\ \ \ \ | |/ / / |/| | | healthchecks: return systemd-run error
| * | | healthchecks: return systemd-run errorValentin Rothberg2020-09-29
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | In case `systemd-run` errors when creating transient unit files (and timers), create an error based on the combined output from stdout and stderr. Using the error from `exec.Command` contains the exit code only which is not useful to debug (see #7484). Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
* | | Merge pull request #7783 from ashley-cui/slirpOpenShift Merge Robot2020-09-29
|\ \ \ | |/ / |/| | Add support for slirp network for pods
| * | Add support for slirp network for podsAshley Cui2020-09-25
| | | | | | | | | | | | | | | | | | flag --network=slirp4netns[options] for root and rootless pods Signed-off-by: Ashley Cui <acui@redhat.com>
* | | Properly handle podman run --pull commandDaniel J Walsh2020-09-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the --pull missing|always|never is ignored This PR implements this for local API. For remote we need to default to pullpolicy specified in the containers.conf file. Also fixed an issue when images were matching other images names based on prefix, causing images to always be pulled. I had named an image myfedora and when ever I pulled fedora, the system thought that it there were two images named fedora since it was checking for the name fedora as well as the prefix fedora. I changed it to check for fedora and the prefix /fedora, to prefent failures like I had. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* | | HTTP Attach: Wait until both STDIN and STDOUT finishMatthew Heon2020-09-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the old code, there was a chance that we could return when only one of STDIN or STDOUT had finished - this could lead to us dropping either input to the container, or output from it, in the case that one stream terminated early. To resolve this, use separate channels to return STDOUT and STDIN errors, and track which ones have returned cleanly to ensure that we need bith in order to return from the HTTP attach function and pass control back to the HTTP handler (which would assume we exited cleanly and close the client's attach connection). Signed-off-by: Matthew Heon <mheon@redhat.com>
* | | Merge pull request #7754 from mheon/fix_logdriver_orderOpenShift Merge Robot2020-09-23
|\ \ \ | | | | | | | | Fix a bug where log-driver json-file was made no logs
| * | | Fix a bug where log-driver json-file was made no logsMatthew Heon2020-09-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we added the None log driver, it was accidentally added in the middle of a set of Fallthrough stanzas which all should have led to k8s-file, so that JSON file logging accidentally caused no logging to be selected instead of k8s-file. Signed-off-by: Matthew Heon <mheon@redhat.com>
* | | | Include cgroup manager in `podman info` outputMatthew Heon2020-09-22
|/ / / | | | | | | | | | | | | | | | | | | | | | This is very useful for debugging cgroups v2, especially on rootless - we need to ensure people are correctly using systemd cgroups in these cases. Signed-off-by: Matthew Heon <matthew.heon@pm.me>
* | | Merge pull request #7698 from AkihiroSuda/rootless-cni-deflake-lo-upOpenShift Merge Robot2020-09-21
|\ \ \ | | | | | | | | rootless-cni-infra: fix flakiness during bringing up lo interface
| * | | libpod: bumps up rootless-cni-infra to 2Akihiro Suda2020-09-21
| | | | | | | | | | | | | | | | Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
* | | | Merge pull request #7696 from jwhonce/wip/versionOpenShift Merge Robot2020-09-21
|\ \ \ \ | |/ / / |/| | | Refactor version handling in cmd tree
| * | | Refactor version handling in cmd treeJhon Honce2020-09-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Move from simple string to semver objects * Change client API Version from '1' to 2.0.0 Signed-off-by: Jhon Honce <jhonce@redhat.com>
* | | | Merge pull request #7694 from mheon/fix_exec_supplemental_groupsOpenShift Merge Robot2020-09-19
|\ \ \ \ | |/ / / |/| | | Preserve groups in exec sessions in ctrs with --user
| * | | Preserve groups in exec sessions in ctrs with --userMatthew Heon2020-09-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Podman wants to guarantee that exec sessions retain the groups of the container they are started in, unless explicitly overridden by the user. This guarantee was broken for containers where the `--user` flag was specified; this patch resolves that. Somewhere in the Exec rewrite for APIv2, I changed the location where the container's User is passed into the exec session (similar to groups, we also want to preserve user unless overridden). The lower-level Exec APIs already handled setting user and group appropriately if not specified when the exec session was created, but I added duplicate code to handle this higher in the stack - and that code only handled setting user, not supplemental groups, breaking support in that specific case. Two things conspired to make this one hard to track down: first, things were only broken if the container explicitly set a user; otherwise, the container user would still appear to be unset to the lower-level code, which would properly set supplemental groups (this tricked our existing test into passing). Also, the `crun` OCI runtime will add the groups without prompting, which further masked the problem there. I debated making `runc` do the same, but in the end it's better to fix this in Podman - it's better to be explicit about what we want done so we will work with all OCI runtimes. Signed-off-by: Matthew Heon <matthew.heon@pm.me>
* | | | Merge pull request #7671 from zhangguanzhang/play-kube-handle-restartPolicyOpenShift Merge Robot2020-09-18
|\ \ \ \ | | | | | | | | | | handle the restartPolicy for play kube and generate kube
| * | | | handle the play kube and generate kube for with restartPolicyzhangguanzhang2020-09-18
| | | | | | | | | | | | | | | | | | | | Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
* | | | | fix the .Path and .Args when use the infra-commandzhangguanzhang2020-09-18
|/ / / / | | | | | | | | | | | | Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
* | | | update github.com/docker/docker and relevant depsAkihiro Suda2020-09-18
| | | | | | | | | | | | | | | | Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
* | | | image list: return all associated namesValentin Rothberg2020-09-17
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Always return all associated names / repo tags of an image and fix a bug with malformed repo tags. Previously, Podman returned all names only with `--all` but this flag only instructs to list intermediate images and should not alter associated names. With `--all` Podman queried the repo tags of an image which splits all *tagged* names into repository and tag which is then reassembled to eventually be parsed again in the frontend. Lot's of redundant CPU heat and buggy as the reassembly didn't consider digests which ultimately broke parsing in the frontend. Fixes: #7651 Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
* | | Merge pull request #7621 from rhatdan/podsOpenShift Merge Robot2020-09-16
|\ \ \ | | | | | | | | Fix podman pod create --infra-command and --infra-image
| * | | Fix podman pod create --infra-command and --infra-imageDaniel J Walsh2020-09-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently infr-command and --infra-image commands are ignored from the user. This PR instruments them and adds tests for each combination. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* | | | Merge pull request #7653 from AkihiroSuda/fix-7652OpenShift Merge Robot2020-09-16
|\ \ \ \ | |/ / / |/| | | Fix "rootless-cni-infra + runc fails with ENODEV"
| * | | Fix "rootless-cni-infra + runc fails with ENODEV"Akihiro Suda2020-09-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | runc always expect "bind" to be present in opts even when the type is "bind". Fix #7652 Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
* | | | Merge pull request #7624 from QiWang19/policy-optionOpenShift Merge Robot2020-09-16
|\ \ \ \ | |/ / / |/| | | Supports import&run--signature-policy