Commit graph

10891 commits

Author SHA1 Message Date
OpenShift Merge Robot 50042120e9
Merge pull request #9240 from rhatdan/reset
Do not reset storage when running inside of a container
2021-02-16 17:11:26 -05:00
OpenShift Merge Robot 7bd1c1a297
Merge pull request #9367 from containers/dependabot/go_modules/github.com/rootless-containers/rootlesskit-0.13.1
Bump github.com/rootless-containers/rootlesskit from 0.13.0 to 0.13.1
2021-02-16 17:09:27 -05:00
OpenShift Merge Robot fb6f143946
Merge pull request #9401 from rhatdan/stop
podman kill should report rawInput not container id
2021-02-16 16:08:26 -05:00
Daniel J Walsh 5d1ec2960d
Do not reset storage when running inside of a container
Currently if the host shares container storage with a container
running podman, the podman inside of the container resets the
storage on the host. This can cause issues on the host, as
well as causes the podman command running the container, to
fail to unmount /dev/shm.

podman run -ti --rm --privileged -v /var/lib/containers:/var/lib/containers quay.io/podman/stable podman run alpine echo hello
	* unlinkat /var/lib/containers/storage/overlay-containers/a7f3c9deb0656f8de1d107e7ddff2d3c3c279c11c1635f233a0bffb16051fb2c/userdata/shm: device or resource busy
	* unlinkat /var/lib/containers/storage/overlay-containers/a7f3c9deb0656f8de1d107e7ddff2d3c3c279c11c1635f233a0bffb16051fb2c/userdata/shm: device or resource busy

Since podman is volume mounting in the graphroot, it will add a flag to
/run/.containerenv to tell podman inside of container whether to reset storage or not.

Since the inner podman is running inside of the container, no reason to assume this is a fresh reboot, so if "container" environment variable is set then skip
reset of storage.

Also added tests to make sure /run/.containerenv is runnig correctly.

Fixes: https://github.com/containers/podman/issues/9191

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-02-16 14:18:53 -05:00
OpenShift Merge Robot 7fb347a3d4
Merge pull request #9399 from vrothberg/home-sweet-home
do not set empty $HOME
2021-02-16 11:39:27 -05:00
Daniel J Walsh 958f901431
podman kill should report rawInput not container id
Docker always reports back the users input, not the full
id, we should do the same.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-02-16 09:47:38 -05:00
OpenShift Merge Robot 58a4793bec
Merge pull request #9396 from rhatdan/stop
When stopping a container, print rawInput
2021-02-16 09:46:28 -05:00
OpenShift Merge Robot aadb16da38
Merge pull request #9380 from baude/podinfra
Fix panic in pod creation
2021-02-16 09:25:28 -05:00
OpenShift Merge Robot 3eb2ce34dc
Merge pull request #9397 from vrothberg/fix-9232
images/create: always pull image
2021-02-16 09:22:27 -05:00
OpenShift Merge Robot 6639b218a2
Merge pull request #9368 from vrothberg/fix-9365
podman build: pass runtime to buildah
2021-02-16 08:53:27 -05:00
OpenShift Merge Robot 0a6b76eba1
Merge pull request #9372 from matejvasek/fix_host_port
Docker [APIv2] create container: handle empty host port
2021-02-16 08:44:27 -05:00
OpenShift Merge Robot 271c5612e8
Merge pull request #9369 from vrothberg/startup-errors
correct startup error message
2021-02-16 08:41:26 -05:00
OpenShift Merge Robot 7b17c77adc
Merge pull request #9391 from rhatdan/workdir
Don't chown workdir if it already exists
2021-02-16 08:27:28 -05:00
Valentin Rothberg 2ec0e3b650 do not set empty $HOME
Make sure to not set an empty $HOME for containers and let it default to
"/".

https://github.com/containers/crun/pull/599 is required to fully
address #9378.

Partially-Fixes: #9378
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-02-16 14:21:45 +01:00
Valentin Rothberg 2a21ecafa7 images/create: always pull image
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>
2021-02-16 13:32:31 +01:00
baude f2f18768a8 Fix panic in pod creation
when creating a pod with --infra-image and using a untagged image for
the infra-image (none/none), the lookup for the image's name was
creating a panic.

Fixes: #9374

Signed-off-by: baude <bbaude@redhat.com>
2021-02-16 06:29:49 -06:00
OpenShift Merge Robot 8c444e6f0b
Merge pull request #9394 from paranlee/patch-1
[CI:DOCS] Fix typo podman run doc in flag -pid=mode "efault"
2021-02-16 07:08:26 -05:00
dependabot-preview[bot] 0fd4807080
Bump github.com/rootless-containers/rootlesskit from 0.13.0 to 0.13.1
Bumps [github.com/rootless-containers/rootlesskit](https://github.com/rootless-containers/rootlesskit) from 0.13.0 to 0.13.1.
- [Release notes](https://github.com/rootless-containers/rootlesskit/releases)
- [Commits](https://github.com/rootless-containers/rootlesskit/compare/v0.13.0...v0.13.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-02-16 07:05:03 -05:00
Valentin Rothberg 2845f7b832 podman build: pass runtime to buildah
Make sure that Podman's default OCI runtime is passed to Buildah in
`podman build`.  In theory, Podman and Buildah should use the same
defaults but the projects move at different speeds and it turns out
we caused a regression in v3.0.

Fixes: #9365
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-02-16 13:01:56 +01:00
Valentin Rothberg 39c1fdb155 correct startup error message
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>
2021-02-16 12:49:02 +01:00
paranlee a532994f8b Fix typo podman run doc in flag -pid=mode "efault"
Signed-off-by: paranlee <paran.lee@mail.uk>
2021-02-16 20:46:21 +09:00
Daniel J Walsh 4a9bd7a18f
When stopping a container, print rawInput
When we stop a container we are printing the full id,
this does not match Docker behaviour or the start behavior.
We should be printing the users rawInput when we successfully
stop the container.

Fixes: https://github.com/containers/podman/issues/9386

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-02-16 06:26:51 -05:00
Matej Vasek 714acf3267 fix create container: handle empty host port
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2021-02-16 12:24:44 +01:00
OpenShift Merge Robot ac9a048b59
Merge pull request #9375 from Luap99/fix-9373
Fix broken podman generate systemd --new with pods
2021-02-16 05:56:26 -05:00
Daniel J Walsh 3d50393f09
Don't chown workdir if it already exists
Currently podman is always chowning the WORKDIR to root:root
This PR will return if the WORKDIR already exists.

Fixes: https://github.com/containers/podman/issues/9387

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-02-16 04:52:02 -05:00
Paul Holzinger bf083c185d Fix broken podman generate systemd --new with pods
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>
2021-02-16 09:51:09 +01:00
OpenShift Merge Robot df8ba7f4a9
Merge pull request #9385 from baude/fixci
Fixci
2021-02-16 03:44:25 -05:00
baude 227c548130 fix dns resolution on ubuntu
ubuntu's dns seems a little odd and requires a fq name in its tests.

Signed-off-by: baude <bbaude@redhat.com>
2021-02-15 16:12:11 -06:00
Valentin Rothberg 0ab5bfd313 e2e: fix network alias test
The logic in the e2e test for multiple network aliases is indicating the
test should wait for the containerized nginx to be ready.  As this may
take some time, the test does an exponential backoff starting at 2050ms.

Fix the logic by removing the `Expect(...)` call during the exponential
backoff.  Otherwise, the test errors immediately.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-02-15 15:07:25 +01:00
Valentin Rothberg 704fa8b55e fix failing image e2e test
The timestamps of some images must have changed changing the number of
expected filtered images.  The test conditions seem fragile but for now
it's more important to get CI back.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-02-15 13:02:14 +01:00
OpenShift Merge Robot 30607d7278
Merge pull request #9348 from matejvasek/refactor_gen_code
Refactor generated code
2021-02-15 06:35:58 -05:00
OpenShift Merge Robot db56e19f6a
Merge pull request #9366 from xatier/patch-1
[CI:DOCS] Update troubleshooting.md for registries.conf v2
2021-02-15 06:23:00 -05:00
xatier 9a24d50989
Update troubleshooting.md
Note that `[registries.search]` (the v1 format) is still supported, but
`registries.conf` can not mix v1 with v2 syntax.

[1] c04fa24575 (diff-968a44bf11ad55a626a0d13a78ade8944ade3a36f53c7a3f985a9036cd64f5a5)

Signed-off-by: xatier <xatierlike@gmail.com>
2021-02-15 02:49:16 -08:00
Matej Vasek 6ffd05d0bd [NO TESTS NEEDED] Refactor generated code
Extracted common functionality to util function.

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2021-02-14 15:44:22 +01:00
OpenShift Merge Robot 3ba0afdd0f
Merge pull request #9342 from Luap99/lint
Enable more golangci-lint linters
2021-02-13 06:42:56 -05:00
OpenShift Merge Robot 9d57aa75a5
Merge pull request #9347 from edigaryev/fix-superfluous-writeheader
Fix superfluous response.WriteHeader call in WaitContainerLibpod()
2021-02-12 19:24:57 -05:00
Nikolay Edigaryev 2c31f38399 Fix superfluous response.WriteHeader call in WaitContainerLibpod()
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>
2021-02-12 23:55:12 +03:00
OpenShift Merge Robot 87b2722c45
Merge pull request #9343 from baude/pstonano
change ps Created to unix
2021-02-12 15:54:46 -05:00
OpenShift Merge Robot 1d15ed708f
Merge pull request #9341 from vrothberg/layer-tree-errors
make layer-tree lookup errors non-fatal
2021-02-12 13:32:00 -05:00
baude 4067f3a4d6 change ps Created to unix
change from unixnano to unix for ps created --format json

[NO TESTS NEEDED]

Signed-off-by: baude <bbaude@redhat.com>
2021-02-12 12:08:59 -06:00
OpenShift Merge Robot 73cf06a453
Merge pull request #9319 from containers/dependabot/go_modules/github.com/spf13/cobra-1.1.3
Bump github.com/spf13/cobra from 1.1.2 to 1.1.3
2021-02-12 12:54:00 -05:00
OpenShift Merge Robot 64255f5fb8
Merge pull request #9311 from deadNightTiger/fix-pull-dockerjava
apiv2: handle docker-java clients pulling
2021-02-12 12:52:58 -05:00
Paul Holzinger 78b419909b Enable more golangci-lint linters
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>
2021-02-12 18:20:28 +01:00
OpenShift Merge Robot 291f59600b
Merge pull request #9331 from Luap99/lint
Enable more golangci-lint linters
2021-02-12 11:30:00 -05:00
Valentin Rothberg adfcb74602 make layer-tree lookup errors non-fatal
Internally, Podman constructs a tree of layers in containers/storage to
quickly compute relations among layers and hence images.  To compute the
tree, we intersect all local layers with all local images.  So far,
lookup errors have been fatal which has turned out to be a mistake since
it seems fairly easy to cause storage corruptions, for instance, when
killing builds.  In that case, a (partial) image may list a layer which
does not exist (anymore).  Since the errors were fatal, there was no
easy way to clean up and many commands were erroring out.

To improve usability, turn the fatal errors into warnings that guide the
user into resolving the issue.  In this case, a `podman system reset`
may be the approriate way for now.

[NO TESTS NEEDED] because I have no reliable way to force it.

[1] https://github.com/containers/podman/issues/8148#issuecomment-778253474

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-02-12 17:23:01 +01:00
OpenShift Merge Robot 1b284a298c
Merge pull request #9302 from giuseppe/cgroup-split-v1
utils: takes the longest path on cgroup v1
2021-02-11 17:46:37 -05:00
Paul Holzinger 78c8a87362 Enable whitespace linter
Use the whitespace linter and fix the reported problems.

[NO TESTS NEEDED]

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-02-11 23:01:56 +01:00
Paul Holzinger 69ab67bf90 Enable golint linter
Use the golint linter and fix the reported problems.

[NO TESTS NEEDED]

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-02-11 23:01:49 +01:00
Paul Holzinger ef2fc90f2d Enable stylecheck linter
Use the stylecheck linter and fix the reported problems.

[NO TESTS NEEDED]

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-02-11 23:01:29 +01:00
OpenShift Merge Robot b38b1433b3
Merge pull request #9329 from mheon/update_master_300
[CI:DOCS] Update Master to reflect the 3.0 release
2021-02-11 16:11:36 -05:00