summaryrefslogtreecommitdiff
path: root/pkg
Commit message (Collapse)AuthorAge
* [3.0] bump go module to v3Valentin Rothberg2021-02-22
| | | | | | | | | We missed bumping the go module, so let's do it now :) Automated go code with github.com/sirkon/go-imports-rename Manually via vgrep podman/v2 the rest Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
* cp: treat "." and "/." correctlyValentin Rothberg2021-02-19
| | | | | | | | | | | | Make sure to treat "." and "/." correctly. Both cases imply to copy the contents of a directory in contrast to the directory. This implies to unset the KeepDirectoryNames options of the copiah package. Previously, the code was performing a simple string suffix check which is not enough since it would match files and directories ending with ".". Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
* Bump containers/buildah to v1.19.4Daniel J Walsh2021-02-18
| | | | | | Fix handling of --iidfile to happen on the client side. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* Implement missing arguments for podman buildDaniel J Walsh2021-02-18
| | | | | | | | | | | | Buildah bud passes a bunch more flags then podman build. We need to implement hook up all of these flags to get full functionality. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> <MH: Fix cherry pick conflicts> Signed-off-by: Matthew Heon <mheon@redhat.com>
* Fix swagger generationMatthew Heon2021-02-18
| | | | | | The InspectVolumeData struct was moved into Define from Libpod. Signed-off-by: Matthew Heon <mheon@redhat.com>
* Don't switch on a single caseNikolay Edigaryev2021-02-18
| | | | Signed-off-by: Nikolay Edigaryev <edigaryev@gmail.com>
* bindings: support simple types that implement fmt.Stringer interfaceNikolay Edigaryev2021-02-18
| | | | Signed-off-by: Nikolay Edigaryev <edigaryev@gmail.com>
* API: fix libpod's container wait endpoint condition conversionNikolay Edigaryev2021-02-18
| | | | Signed-off-by: Nikolay Edigaryev <edigaryev@gmail.com>
* Add missing early returns in compat APIRiyad Preukschas2021-02-18
| | | | | | | | | | [NO TESTS NEEDED] Signed-off-by: Riyad Preukschas <riyad@informatik.uni-bremen.de> <MH: Fixed cherry-pick conflicts> Signed-off-by: Matthew Heon <mheon@redhat.com>
* [NO TESTS NEEDED] Refactor generated codeMatej Vasek2021-02-18
| | | | | | | | Extracted common functionality to util function. Signed-off-by: Matej Vasek <mvasek@redhat.com> <MH: Fixed cherry-pick conflicts>
* Enable more golangci-lint lintersPaul Holzinger2021-02-18
| | | | | | | | | | | | | | | | | Cleanup the golangci.yml file and enable more linters. `pkg/spec` and `iopodman.io` is history. The vendor directory is excluded by default. The dependencies dir was listed twice. Fix the reported problems in `pkg/specgen` because that was also excluded by `pkg/spec`. Enable the structcheck, typecheck, varcheck, deadcode and depguard linters. [NO TESTS NEEDED] Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
* Enable whitespace linterPaul Holzinger2021-02-18
| | | | | | | | | | | | Use the whitespace linter and fix the reported problems. [NO TESTS NEEDED] Signed-off-by: Paul Holzinger <paul.holzinger@web.de> <MH: Fixed up cherry-pick conflicts> Signed-off-by: Matthew Heon <mheon@redhat.com>
* Enable golint linterPaul Holzinger2021-02-18
| | | | | | | | Use the golint linter and fix the reported problems. [NO TESTS NEEDED] Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
* Enable stylecheck linterPaul Holzinger2021-02-18
| | | | | | | | | | | | Use the stylecheck linter and fix the reported problems. [NO TESTS NEEDED] Signed-off-by: Paul Holzinger <paul.holzinger@web.de> <MH: Fix cherry-pick conflict> Signed-off-by: Matthew Heon <mheon@redhat.com>
* [NO TESTS NEEDED] Update linterMatej Vasek2021-02-18
| | | | Signed-off-by: Matej Vasek <mvasek@redhat.com>
* apiv2: handle docker-java clients pullingIgor Korolev2021-02-18
| | | | | | | | | When docker-java calls images/create?fromImage=x, it expects two things for a successful response: that both "error" and "errorDetail" are not set, and that the "progress" message contains one of five hard-coded strings ("Download complete" being one of them). Signed-off-by: Igor Korolev <missterr@gmail.com>
* Fix superfluous response.WriteHeader call in WaitContainerLibpod()Nikolay Edigaryev2021-02-18
| | | | | | | | | | | | | | | When the query decoding fails at the beginning of WaitContainerLibpod(), the Error() sets the header but doesn't returns after that. This causes the execution flow to reach the WriteResponse() at the end of WaitContainerLibpod(), which attempts to set another header, thus causing the following error: http: superfluous response.WriteHeader call from github.com/containers/podman/pkg/api/handlers/utils.WriteResponse (handler.go:124) [NO TESTS NEEDED] Signed-off-by: Nikolay Edigaryev <edigaryev@gmail.com>
* Fix broken podman generate systemd --new with podsPaul Holzinger2021-02-18
| | | | | | | | | | | The unit generation accidentally escaped the %t in the pod id file path. This is a regression caused by #9178. This was not caught by the tests because the test itself was wrong. It used a full path instead of the systemd variable %t like the actual code does. Fixes #9373 Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
* correct startup error messageValentin Rothberg2021-02-18
| | | | | | | | | | | | | The error message when failing to create an image engine unconditionally pointed to the Podman socket which is quite confusing when running locally. Move the error message to the point where the first ping to the service fails. [NO TESTS NEEDED] Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
* images/create: always pull imageValentin Rothberg2021-02-18
| | | | | | | | | The `images/create` endpoint should always attempt to pull a newer image. Previously, the local images was used which is not compatible with Docker and caused issues in the Gitlab CI. Fixes: #9232 Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
* infra: downgrade warning to debugGiuseppe Scrivano2021-02-18
| | | | | | | | | | if the current process could not be moved to a different systemd cgroup do not raise a warning but debug message. [NO TESTS NEEDED] Closes: https://github.com/containers/podman/issues/9353 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
* Ignore entrypoint=[\"\"]Daniel J Walsh2021-02-18
| | | | | | | | | | | | | We recieved an issue with an image that was built with entrypoint=[""] This blows up on Podman, but works on Docker. When we setup the OCI Runtime, we should drop entrypoint if it is == [""] https://github.com/containers/podman/issues/9377 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* make `podman rmi` more robustValentin Rothberg2021-02-11
| | | | | | | | | | | | | | | | The c/storage library is subject to TOCTOUs as the central container and image storage may be shared by many instances of many tools. As shown in #6510, it's fairly easy to have multiple instances of Podman running in parallel and yield image-lookup errors when removing them. The underlying issue is the TOCTOU of removal being split into multiple stages of first reading the local images and then removing them. Some images may already have been removed in between the two stages. To make image removal more robust, handle errors at stage two when a given image is not present (anymore) in the storage. Fixes: #6510 Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
* Implement Docker wait conditionsMatej Vasek2021-02-08
| | | | Signed-off-by: Matej Vasek <mvasek@redhat.com>
* Improve ContainerEngine.ContainerWait()Matej Vasek2021-02-08
| | | | Signed-off-by: Matej Vasek <mvasek@redhat.com>
* Improve container libpod.Wait*() functionsMatej Vasek2021-02-08
| | | | Signed-off-by: Matej Vasek <mvasek@redhat.com>
* [NO TESTS NEEDED] style: indendationMatej Vasek2021-02-08
| | | | Signed-off-by: Matej Vasek <mvasek@redhat.com>
* [NO TESTS NEEDED] fixup: remove debug codeMatej Vasek2021-02-08
| | | | | | | | Signed-off-by: Matej Vasek <mvasek@redhat.com> <MH: Regenerate bindings> Signed-off-by: Matthew Heon <matthew.heon@pm.me>
* [NO TESTS NEEDED] Generated filesMatej Vasek2021-02-08
| | | | | | | | Signed-off-by: Matej Vasek <mvasek@redhat.com> <MH: Regenerated bindings> Signed-off-by: Matthew Heon <matthew.heon@pm.me>
* Cleanup bindings for image pullDaniel J Walsh2021-02-08
| | | | | | | | | | Remove bindings that are not handled over the API. Leaving this one to not use image pull, since this would break progress handling. We should revisit this in the future. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* [NO TESTS NEEDED] Improve generatorMatej Vasek2021-02-08
| | | | Signed-off-by: Matej Vasek <mvasek@redhat.com>
* Fix invalid wait condition on killDaniel J Walsh2021-02-08
| | | | | | | | | | | When using the compatability tests on kill, the kill function goes into an infinite wait loop taking all of the CPU. This change will use the correct wait function and exit properly. Fixes: https://github.com/containers/podman/issues/9206 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* Switch podman image push handlers to use abiDaniel J Walsh2021-02-08
| | | | | | | | | | | | Change API Handlers to use the same functions that the local podman uses. At the same time: Cleanup and pass proper bindings. Remove cli options from podman-remote push. Cleanup manifest push. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* podman-remote ps --external --pod --sort do not work.Daniel J Walsh2021-02-08
| | | | | | | | | | Fixup the bindings and the handling of the --external --por and --sort flags. The --storage option was renamed --external, make sure we use external up and down the stack. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* Fix --arch and --os flags to work correctlyDaniel J Walsh2021-02-08
| | | | | | | | | | | | | | | Currently podman implements --override-arch and --overide-os But Podman has made these aliases for --arch and --os. No reason to have to specify --override, since it is clear what the user intends. Currently if the user specifies an --override-arch field but the image was previously pulled for a different Arch, podman run uses the different arch. This PR also fixes this issue. Fixes: https://github.com/containers/podman/issues/8001 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* Switch podman stop/kill/wait handlers to use abiDaniel J Walsh2021-02-08
| | | | | | | | | | | | Change API Handlers to use the same functions that the local podman uses. At the same time: implement remote API for --all and --ignore flags for podman stop implement remote API for --all flags for podman stop Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* Fix handling of container removeDaniel J Walsh2021-02-08
| | | | | | | | | | | | | | | | | | | | I found several problems with container remove podman-remote rm --all Was not handled podman-remote rm --ignore Was not handled Return better errors when attempting to remove an --external container. Currently we return the container does not exists, as opposed to container is an external container that is being used. This patch also consolidates the tunnel code to use the same code for removing the container, as the local API, removing duplication of code and potential problems. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* Bump remote API version to 3.0.0Matthew Heon2021-02-05
| | | | | | Fixes #9175 Signed-off-by: Matthew Heon <matthew.heon@pm.me>
* play kube selinux label issueSteven Taylor2021-02-05
| | | | | | | | | play kube function not respecting selinux options in kube yaml, all options were being mapped to role. fixes issue 8710 Signed-off-by: Steven Taylor <steven@taylormuff.co.uk>
* Allow pods to use --net=noneMatthew Heon2021-02-04
| | | | | | | | | | | We need an extra field in the pod infra container config. We may want to reevaluate that struct at some point, as storing network modes as bools will rapidly become unsustainable, but that's a discussion for another time. Otherwise, straightforward plumbing. Fixes #9165 Signed-off-by: Matthew Heon <matthew.heon@pm.me>
* Report StatusConflict on Pod opt partial failuresJhon Honce2021-02-04
| | | | | | | | | | | | | | | | | | | - When one or more containers in the Pod reports an error on an operation report StatusConflict and report the error(s) - jsoniter type encoding used to marshal error as string using error.Error() - Update test framework to allow setting any flag when creating pods - Fix test_resize() result check Fixes #8865 Signed-off-by: Jhon Honce <jhonce@redhat.com> <MH: Fix cherry-pick conflicts> Signed-off-by: Matthew Heon <matthew.heon@pm.me>
* bindings: attach: warn correct errorValentin Rothberg2021-02-04
| | | | | | | | | The resize warning logged the wrong error. While this does not fix #9172, it may very well be helpful finding its root cause. [NO TESTS NEEDED] Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
* Fix podman generate systemd --new special char handlingPaul Holzinger2021-02-04
| | | | | | | | | | In a systemd unit dollar and percent signs are used for variables. A backslash is used for escape sequences. If any of these characters are used in the create command we have to properly escape them so systemd does not try to interpret them. Fixes #9176 Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
* Endpoint that lists containers does not return correct Status valueMilivoje Legenovic2021-02-04
| | | | | | | | | | | | | Eclipse and Intellij Docker plugin determines the state of the container via the Status field, returned from /containers/json call. Podman always returns empty string, and because of that, both IDEs show the wrong state of the container. Signed-off-by: Milivoje Legenovic <m.legenovic@gmail.com> <MH: Fixed cherry-pick conflicts> Signed-off-by: Matthew Heon <matthew.heon@pm.me>
* Docker ignores mount flags that begin with constencyDaniel J Walsh2021-02-04
| | | | | | | | | | | | | | Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1915332 ``` According to the Docker docs, the consistency option should be ignored on Linux. the possible values are 'cached', 'delegated', and 'consistent', but they should be ignored equally. This is a widely used option in scripts run by developer machines, as this makes file I/O less horribly slow on MacOS. ``` Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* Honor custom DNS in play|generate kubebaude2021-02-04
| | | | | | | | | | | | | | | | | | when creating kubernetes yaml from containers and pods, we should honor any custom dns settings the user provided. in the case of generate kube, these would be provided by --dns, --dns-search, and --dns-opt. if multiple containers are involved in the generate, the options will be cumulative and unique with the exception of dns-opt. when replaying a kube file that has kubernetes dns information, we now also add that information to the pod creation. the options for dnspolicy is not enabled as there seemed to be no direct correlation between kubernetes and podman. Fixes: #9132 Signed-off-by: baude <bbaude@redhat.com>
* Don't fail if one of the cgroups is not setupDaniel J Walsh2021-02-04
| | | | | | | | | | | It is fairly common for certain cgroups controllers to not be enabled on a system. We should Warn when this happens versus failing, when doing podman stats command. This way users can get information from the other controllers. Fixes: https://github.com/containers/podman/issues/8588 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* Fix #9100 Change console mode message to debugGerard Braad2021-02-04
| | | | | | [NO TESTS NEEDED] Signed-off-by: Gerard Braad <me@gbraad.nl>
* rootlessport: set source IP to slirp4netns deviceGiuseppe Scrivano2021-02-03
| | | | | | | | | set the source IP to the slirp4netns address instead of 127.0.0.1 when using rootlesskit. Closes: https://github.com/containers/podman/issues/5138 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
* Make generate systemd --new robust against double curly bracesPaul Holzinger2021-01-29
| | | | | | | | | | | If the container create command contains an argument with double curly braces the golang template parsing can fail since it tries to interpret the value as variable. To fix this change the default delimiter for the internal template to `{{{{`. Fixes #9034 Signed-off-by: Paul Holzinger <paul.holzinger@web.de>