summaryrefslogtreecommitdiff
path: root/pkg
Commit message (Collapse)AuthorAge
* Merge pull request #7867 from vrothberg/fix-7837OpenShift Merge Robot2020-10-02
|\ | | | | remote: fix name and ID collisions of containers and pods
| * remote: fix name and ID collisions of containers and podsValentin Rothberg2020-10-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix the look up of containers and pods in the remote client. User input can refer to both, names or IDs of containers and pods, so there is a fair chance of collisions (e.g., "c1" name with a "c1...." ID). Those collisions are well handled (and battle tested) in the local client which is directly using the libpod backend. Hence, the remote client should not attempt to introduce its own logic to prevent bugs and divergence between the local and the remote clients. To prevent collisions such as in #7837, do a container/pod inspect on the user-provided input to find the corresponding ID and eventually do full ID comparisons to avoid potential collisions with names. Note that this has a cost that I am not entirely happy with. Looking at issue #7837, the collisions are happening when removing the two containers. Remote container removal is now very chatty with the server as it first queries for all containers, then iterates over the provided names or IDs and does a remote inspect to figure out the IDs and find a matching container object. However, remote removal could just pass the names and IDs directly to the batch removal endpoint. Querying for all containers could be prevented if the batch removal endpoint would remove all if the slice is empty. In other words, the bug is fixed but there's room for performance improvements. Fixes: #7837 Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
* | Merge pull request #7815 from jwhonce/wip/creds_remoteOpenShift Merge Robot2020-10-02
|\ \ | | | | | | Add X-Registry-Config support
| * | Add X-Registry-Config supportJhon Honce2020-09-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Refactor auth pkg to support X-Registry-Config * Refactor build endpoint to support X-Registry-Config. Supports: * --creds * --authfile * Added X-Reference-Id Header to http.Request to support log event correlation * Log headers from http.Request Signed-off-by: Jhon Honce <jhonce@redhat.com>
* | | fix compat api privileged and entrypoint codebaude2020-10-01
| | | | | | | | | | | | | | | | | | | | | | | | when adding /dev to a privileged container using the compatibility API, we need to make sure we dont pass on devices that are simply symlinks. this was already being done by specgen but not on the compat. side. the entrypoint code that was recently rewritten for the compatibility layer was also failing due to the odd inputs that docker is willing to accept in its json, specifically [] vs "". in the case of the latter, this was being made into a []string with a len of one but no content. this would then be used to prefix the command to run in the container and would fail. For example " ls" vs "ls". Signed-off-by: baude <bbaude@redhat.com>
* | | Merge pull request #7735 from QiWang19/manifest-inspectOpenShift Merge Robot2020-10-01
|\ \ \ | | | | | | | | fix allowing inspect manifest of non-local image
| * | | fix allowing inspect manifest of non-local imageQi Wang2020-09-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support of `podman manifest inspect` returning manifest list of non-local manifest. Close #https://github.com/containers/podman/issues/7726 Signed-off-by: Qi Wang <qiwan@redhat.com>
* | | | Merge pull request #7864 from rhatdan/volumeOpenShift Merge Robot2020-10-01
|\ \ \ \ | | | | | | | | | | Volume prune should not pass down the force flag
| * | | | Volume prune should not pass down the force flagDaniel J Walsh2020-10-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | podman volume prune -f Should just tell the prune command to not prompt for confirmation. It should not be passing the prune flag into the API. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* | | | | Merge pull request #7851 from zhangguanzhang/fix-apiv2-ctr-workdir-and-envOpenShift Merge Robot2020-10-01
|\ \ \ \ \ | |/ / / / |/| | | | [apiv2] don't ignore the ENV and WorkDir from the image
| * | | | fix: The container created by APIV2 has an incorrect Env and WorkDirzhangguanzhang2020-10-01
| | |/ / | |/| | | | | | | | | | Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
* | | | Merge pull request #7858 from jwhonce/wip/http_proxyOpenShift Merge Robot2020-10-01
|\ \ \ \ | |_|_|/ |/| | | Support --http-proxy for remote builds
| * | | Support --http-proxy for remote buildsJhon Honce2020-09-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix misspelled parameter * add http-proxy support for builds http_proxy must be set in the podman.service unit file, for example Environment=http_proxy=<value> Signed-off-by: Jhon Honce <jhonce@redhat.com>
* | | | Merge pull request #7823 from vrothberg/fix-6381OpenShift Merge Robot2020-10-01
|\ \ \ \ | |/ / / |/| | | image look up: consult registries.conf
| * | | pkg/registries: add a retiring noteValentin Rothberg2020-09-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The registries package should be retired. It was introduced as an easier to use wrapper around c/image `sysregistries` which has been replaced by `sysregistriesv2` a long while ago. Users should either use the `sysregistriesv2` package directly or, even better, we cache the config in libpod's image runtime to prevent redundant (and ~expensive) parsing of the registries.conf files. For now, just add a note in hope we'll not forgert about it when we find time in the future. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
* | | | Merge pull request #7798 from QiWang19/run-manifestOpenShift Merge Robot2020-09-30
|\ \ \ \ | |_|_|/ |/| | | Use local image if input image is a manifest list
| * | | Use local image if input image is a manifest listQi Wang2020-09-30
| | |/ | |/| | | | | | | | | | | | | If run&create image returns error: image contains manifest list, not a runnable image, find the local image that has digest matching the digest from the list and use the image from local storage for the command. Signed-off-by: Qi Wang <qiwan@redhat.com>
* | | Merge pull request #7820 from giuseppe/fix-capabilities-not-rootOpenShift Merge Robot2020-09-30
|\ \ \ | | | | | | | | capabilities: always set ambient and inheritable
| * | | capabilities: always set ambient and inheritableGiuseppe Scrivano2020-09-30
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | change capabilities handling to reflect what docker does. Bounding: set to caplist Inheritable: set to caplist Effective: if uid != 0 then clear; else set to caplist Permitted: if uid != 0 then clear; else set to caplist Ambient: clear Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
* | | Merge pull request #7833 from jwhonce/issues/7826OpenShift Merge Robot2020-09-30
|\ \ \ | |_|/ |/| | Refactor IdleTracker to handle StateIdle transitions
| * | Refactor IdleTracker to handle StateIdle transitionsJhon Honce2020-09-29
| |/ | | | | | | | | | | | | | | | | | | | | * Remove stutter naming for package and types * Stop treating StateIdle the same as StateClosed, rather transitions to StateIdle will keep API timeout window open * Remove redundate code Fixes #7826 Signed-off-by: Jhon Honce <jhonce@redhat.com>
* | Merge pull request #7840 from vrothberg/remote-untagOpenShift Merge Robot2020-09-30
|\ \ | | | | | | fix remote untag
| * | fix remote untagValentin Rothberg2020-09-30
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | Fix the remote client to untag all tags of the specified image. Instead of querying the image on the client side, support the case where both, repo and tag, are empty and remove all tags. Reuse the ABI implementation where possible. In retrospective, the libpod untag endpoint should support a slice of strings to batch remove tags rather than reaching out for each tag individually. Enable the skipped test. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
* | Merge pull request #7831 from rhatdan/envOpenShift Merge Robot2020-09-30
|\ \ | | | | | | We already set container=podman environment variable
| * | We already set container=podman environment variableDaniel J Walsh2020-09-29
| |/ | | | | | | | | | | Only need to set container, no need for containers Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* / 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 #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>
* | Merge pull request #7811 from rhatdan/sysctlsOpenShift Merge Robot2020-09-29
|\ \ | | | | | | Ignore containers.conf sysctl when namespaces set to host
| * | Ignore containers.conf sysctl when namespaces set to hostDaniel J Walsh2020-09-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If user sets namespace to host, then default sysctls need to be ignored that are specific to that namespace. --net=host ignore sysctls that begin with net. --ipc=host ignore fs.mqueue --uts=host ignore kernel.domainname and kernel.hostname Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* | | fix for compatibility volume creationbaude2020-09-28
|/ / | | | | | | | | | | | | | | in the compatibility layer, creating a volume with a name that already does not result in an error. instead a 201 response with the existing volume's information is returned. while it seems like a bug on the part of docker and they agree, no attempt has been made to fix it in five years. See https://github.com/moby/moby/issues/16068 Fixes: #7740 Signed-off-by: baude <bbaude@redhat.com>
* | Merge pull request #7770 from rhatdan/pullpolicyOpenShift Merge Robot2020-09-28
|\ \ | | | | | | Properly handle podman run --pull command
| * | 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>
* | | Fix network remove for the podman remote clientPaul Holzinger2020-09-28
| | | | | | | | | | | | | | | | | | | | | | | | The podman remote client ignored the force option due a typo. If an error occured the remote client would panic with an index out of range error. Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
* | | Fix podman network rm --force when network is used by a podPaul Holzinger2020-09-28
|/ / | | | | | | | | | | I added a test to prevent a future regression. Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
* | Merge pull request #7784 from giuseppe/no-newidmap-fix-hangOpenShift Merge Robot2020-09-25
|\ \ | | | | | | rootless: fix hang when newidmap is not installed
| * | rootless: fix hang when newidmap is not installedGiuseppe Scrivano2020-09-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | when newidmap is not installed the code would hit the reexec_in_user_namespace_wait code and wait for the child process to be terminated. The child process is blocked waiting on the w pipe. So make sure to unblock the child process first and then clean it up. Closes: https://github.com/containers/podman/issues/7776 Signed-off-by: Giuseppe Scrivano <giuseppe@scrivano.org>
* | | Merge pull request #7662 from jwhonce/issues/7535OpenShift Merge Robot2020-09-24
|\ \ \ | | | | | | | | Evict containers before removing via V2 API
| * | | Evict containers before removing via V2 APIJhon Honce2020-09-18
| | | | | | | | | | | | | | | | | | | | | | | | Fixes #7535 Signed-off-by: Jhon Honce <jhonce@redhat.com>
* | | | Merge pull request #7741 from vrothberg/remote-load-dir-checkOpenShift Merge Robot2020-09-24
|\ \ \ \ | | | | | | | | | | remote load: check if input is directory
| * | | | remote load: check if input is directoryValentin Rothberg2020-09-24
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | The remote client does not support loading directories yet. To prevent confusing error messages and to make the behaviour more explicit, check if the input points to a directory and throw an error if needed. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
* | | | Merge pull request #7753 from vrothberg/fix-7689OpenShift Merge Robot2020-09-24
|\ \ \ \ | |/ / / |/| | | remote stats
| * | | stats: break out CLI optionsValentin Rothberg2020-09-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Have a clear separation of concerns for the CLI-only options (and their logic) from the backend. The backend logic is now easier to understand (e.g., `stream` instead of `noStream`). Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
| * | | new endpoint: /libpod/containers/statsValentin Rothberg2020-09-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a new endpoint for container stats allowing for batch operations on more than one container. The new endpoint deprecates the single-container endpoint which will eventually be removed with the next major release. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
| * | | stats refactorValentin Rothberg2020-09-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactor the entities' stats API to simplify using it and reduce the risk of running into concurrency issues at the call sites. Further simplify the stats code by de-spaghetti-ing the logic and reducing duplicate code. `ContainerStats` now returns a data channel and an error. If the error is nil, callers can read from the channel. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
* | | | Merge pull request #7761 from baude/interactiveOpenShift Merge Robot2020-09-24
|\ \ \ \ | | | | | | | | | | set interactive mode with compat create endpoint
| * | | | set interactive mode with compat create endpointbaude2020-09-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | when creating a container using the compat endpoint, the interactive bool was being hard set to false and ignoring the user's input. Signed-off-by: baude <bbaude@redhat.com>
* | | | | Merge pull request #7739 from zhangguanzhang/apiv2-containers-limitOpenShift Merge Robot2020-09-24
|\ \ \ \ \ | | | | | | | | | | | | apiv2 /containers/json limit differ from docker-api
| * | | | | apiv2 container limit differ from docker-apizhangguanzhang2020-09-24
| | |/ / / | |/| | | | | | | | | | | | | Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
* / | | | Remove final v2remotefail failuresDaniel J Walsh2020-09-23
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most have been fixed, others I replaced with SkipIfRemote Fix ContainerStart on tunnel, it needs to wait for the exit status before returning. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>