12658 Commits

Author SHA1 Message Date
a55f595fe1 podman stop always cleanup
When a container is configured for auto removal podman stop should still
do cleanup, there is no guarantee the the cleanup process spawned by
conmon will be successful. Also a user expects after podman stop that
the network/mounts are cleaned up. Therefore podman stop should not return
early and instead do the cleanup and ignore errors if the container was
already removed.

[NO TESTS NEEDED] I don't know how to test this.

Fixes #11384

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-09-01 12:56:38 +02:00
bebaef26fd Merge pull request #11375 from vrothberg/fix-11346
[CI:DOCS] podman cp: highlight globbing and multi-file copy
2021-08-31 17:29:57 -04:00
dc2a3e38d9 Merge pull request #11372 from cevich/apiv2_update
Cirrus: Reduce APIv2 task timeout
2021-08-31 16:01:23 -04:00
f947ea2d5f Merge pull request #11316 from vrothberg/fix-10443
pass LISTEN_* environment into container
2021-08-31 14:46:10 -04:00
1ed0a7209d Cirrus: Reduce APIv2 task timeout
At the time of this commit, a significant problem has been identified
(introduced in f5ce02b227f4).  The effect is, `podman pull` has a chance
of hanging, especially when re-pulling an existing image.  While a fix
is in the works, there's no reason to make developers wait the full
(default) 1-hour timeout for the APIv2 task.  Reduce it to 2x nominal
test runtime, so if the hang/flake is hit, the task can be re-run more
quickly.

Signed-off-by: Chris Evich <cevich@redhat.com>
2021-08-31 14:01:17 -04:00
d674eb41e4 [CI:DOCS] podman cp: highlight globbing and multi-file copy
`podman cp` does not allow for globbing or filtering copied data in any
form.  `docker cp` does not either, so Podman remains compatible.  Due
to a number of requests, highlight how users can effectively achieve
that by means of chaining with tools such as xargs(1) or find(1), or by
making use of `podman mount`.

Closes: #11346
Closes: #11194
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-08-31 17:30:58 +02:00
10144b707e pass LISTEN_* environment into container
Make sure that Podman passes the LISTEN_* environment into containers.
Similar to runc, LISTEN_PID is set to 1.

Also remove conditionally passing the LISTEN_FDS as extra files.
The condition was wrong (inverted) and introduced to fix #3572 which
related to running under varlink which has been dropped entirely
with Podman 3.0.  Note that the NOTIFY_SOCKET and LISTEN_* variables
are cleared when running `system service`.

Fixes: #10443
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-08-31 17:23:05 +02:00
8ab84b4373 Merge pull request #11373 from mtrmac/mpb-replace
Use UNMERGED vbauerster/mpb PR to fix a pull deadlock
2021-08-31 11:15:58 -04:00
7b75ddb70c Merge pull request #11374 from cevich/no_api2_cidocs
Cirrus: Skip APIv2 tests for [CI:DOCS]
2021-08-31 10:59:25 -04:00
9f7bad7dac Use UNMERGED vbauerster/mpb PR to fix a pull deadlock
> go mod edit -replace github.com/vbauerster/mpb/v7=github.com/mtrmac/mpb/v7@abort-deadlock
> make vendor

See https://github.com/vbauerster/mpb/issues/100 and
https://github.com/vbauerster/mpb/pull/101 .

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2021-08-31 15:51:36 +02:00
b3aee22bdc Cirrus: Skip APIv2 tests for [CI:DOCS]
Signed-off-by: Chris Evich <cevich@redhat.com>
2021-08-31 09:36:48 -04:00
bfbbeb4223 Merge pull request #11009 from edsantiago/upgrade_test_3
Upgrade test: add new baseline
2021-08-31 09:35:02 -04:00
83de22e892 Merge pull request #11357 from vrothberg/fix-11171
auto-update: fix authfile label
2021-08-31 04:16:58 -04:00
95ac8f180f Merge pull request #11353 from flouthoc/resolve-workdir-after-mounts
container: resolve workdir during initialization after all the mounts are completed.
2021-08-30 18:12:29 -04:00
1122c66ce8 upgrade test: add new baseline
Add a new reference point against which to test upgrades.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-08-30 14:27:48 -06:00
c976667231 Merge pull request #11342 from baude/machinecleanups
clean up socket and pid files from podman machine
2021-08-30 15:14:19 -04:00
a2a166345e clean up socket and pid files from podman machine
to avoid segvs, we should clean up as much of the socket and regular
files from podman machine as possible on stop.  also, on start, we
should add logic to remove these files before starting in case the start
process is stopped prematurely (due to an error for example).

[NO TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
2021-08-30 12:29:06 -05:00
4834b73119 Merge pull request #11360 from Luap99/rootless-resolv
rootless cni: resolve absolute symlinks correctly
2021-08-30 13:14:31 -04:00
06f94dd09e rootless cni: resolve absolute symlinks correctly
When /etc/resolv.conf is a symlink to an absolute path use it and not
join it the the previous path.

[NO TESTS NEEDED] This depends on the host layout.

Fixes #11358

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-08-30 16:55:26 +02:00
ec1f350ee5 container: resolve workdir after all the mounts happen.
There are use-cases where users would want to use overlay-mounts as
workdir. For such cases workdir should be resolved after all the mounts
are completed during the container init process.

Signed-off-by: Aditya Rajan <arajan@redhat.com>
2021-08-30 19:49:26 +05:30
de3920c0e9 auto-update: fix authfile label
Make sure that the container's authfile label is used when pulling down
a new image.

[NO TESTS NEEDED] since it would require some larger rewrite of the
auto-update system tests that I currently have no time for.  I added a
reminder to have some breadcrumbs when there is more time.

Fixes: #11171
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-08-30 13:49:35 +02:00
a2acd04447 Merge pull request #11334 from jwhonce/issues/10831
Add support for mount options to API
2021-08-27 16:22:55 -04:00
a5adc3d80f Add support for mount options to API
When creating containers the specialized mount options where not
populated via the API.

Fixes: #10831
Signed-off-by: Jhon Honce <jhonce@redhat.com>
2021-08-27 11:11:01 -07:00
b21f8ea206 Merge pull request #11333 from rhatdan/http-proxy
Globally replace http:// with https://
2021-08-27 13:26:56 -04:00
8cd2f2fb80 Merge pull request #11339 from rhatdan/subid
Add support for libsubid
2021-08-27 13:24:56 -04:00
266a3892f2 Merge pull request #11102 from cdoern/infraEnhance
InfraContainer Rework
2021-08-27 09:24:26 -04:00
69cdf5d803 Merge pull request #11330 from containers/dependabot/go_modules/github.com/containers/image/v5-5.16.0
Bump github.com/containers/image/v5 from 5.15.2 to 5.16.0
2021-08-27 09:10:27 -04:00
db60a1e654 Add support for libsubid
This will enable remote access to /etc/subuid and /etc/subgid
information from ldap services, if shadow-utils ships with a libsubid.

[NO TESTS NEEDED] Since we have no way to test this.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-08-27 08:13:01 -04:00
6f61ef87af Merge pull request #11337 from Luap99/anon-template
Shell completion for --format with anonymous fields
2021-08-27 07:23:26 -04:00
8469417040 Globally replace http:// with https://
[NO TESTS NEEDED] Hopefully existing tests will find issues.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-08-27 06:14:46 -04:00
ab6c43f3e0 Shell completion for --format with anonymous fields
In commit d81021ed265e I introduced shell completion for the `--format`
flag. This is a very nice way to complete go template field names.
However it did not work correct for anonymous fields. In this case the
child fields can be accessed directly from the parent.

For example:
```
type Anonymous struct {
   Field1 string
   Field2 string
   ...
}

type MyType struct {
    Anonymous
}

var s = MyType{}
```

Now if you want to access a field from the Anonymous struct you can just
do `s.Field1`. The same is allowed for go templates, using `{{.Field1}}`
should work. This commit adds this functionality, if the field is anonymous
read the child field names recursively and add them to the suggestions.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-08-27 10:28:15 +02:00
d28e85741f InfraContainer Rework
InfraContainer should go through the same creation process as regular containers. This change was from the cmd level
down, involving new container CLI opts and specgen creating functions. What now happens is that both container and pod
cli options are populated in cmd and used to create a podSpecgen and a containerSpecgen. The process then goes as follows

FillOutSpecGen (infra) -> MapSpec (podOpts -> infraOpts) -> PodCreate -> MakePod -> createPodOptions -> NewPod -> CompleteSpec (infra) -> MakeContainer -> NewContainer -> newContainer -> AddInfra (to pod state)

Signed-off-by: cdoern <cdoern@redhat.com>
2021-08-26 16:05:16 -04:00
94c37d7d47 Merge pull request #11298 from baude/kubeupdown
teardown play kube
2021-08-26 13:58:44 -04:00
70caa63e7c Merge pull request #11318 from jmguzik/volume-ls-prune-docs
[CI:DOCS] Add filter params description to volume list/prune docs
2021-08-26 13:01:44 -04:00
1e6d1e5c6b Add filter params description to volume list/prune docs
Description adjusted to the standard seen in other man pages.
[CI:DOCS]

Signed-off-by: Jakub Guzik <jakubmguzik@gmail.com>
2021-08-26 17:09:06 +02:00
18da5b0bf6 Merge pull request #11208 from ashley-cui/streams
[NO TESTS NEEDED] Allow setting of machine stream and image path from containers.conf
2021-08-26 10:13:08 -04:00
54e0afffe7 Merge pull request #11218 from cdoern/untilBug
logFile until flag issue, negative duration replaced with positive
2021-08-26 10:12:09 -04:00
cb23559270 Merge pull request #11307 from flouthoc/volume-import-external
volumes: Add support for `volume import` which allows importing contents of external tarballs into podman volumes.
2021-08-26 09:33:08 -04:00
f5ce02b227 Bump github.com/containers/image/v5 from 5.15.2 to 5.16.0
Bumps [github.com/containers/image/v5](https://github.com/containers/image) from 5.15.2 to 5.16.0.
- [Release notes](https://github.com/containers/image/releases)
- [Commits](https://github.com/containers/image/compare/v5.15.2...v5.16.0)

---
updated-dependencies:
- dependency-name: github.com/containers/image/v5
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-26 13:21:26 +00:00
6f1faf36da Merge pull request #11321 from containers/dependabot/go_modules/github.com/fsnotify/fsnotify-1.5.1
Bump github.com/fsnotify/fsnotify from 1.4.9 to 1.5.1
2021-08-26 09:03:06 -04:00
d5507704e9 volumes: Add volume import to allow importing contents on tar into volume
Following feature makes sure that users can load contents of external
tarball into the podman volumes.

Signed-off-by: flouthoc <flouthoc.git@gmail.com>
2021-08-26 14:14:14 +05:30
e88b62b34b Fix swagger issue
Add special case for op PlayKubeDownLibpod Heuristic for guessing swagger operation id too limited for PlayKubeDownLibpod

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2021-08-25 15:50:55 -05:00
49cfed756f Merge pull request #11103 from jwhonce/wip/bindings
Fix file descriptor leaks in bindings and add test
2021-08-25 14:42:12 -04:00
fefa0b32c7 Merge pull request #11314 from Luap99/expose-ports
podman inspect show exposed ports
2021-08-25 09:29:03 -04:00
c6e12a2e44 Bump github.com/fsnotify/fsnotify from 1.4.9 to 1.5.1
Bumps [github.com/fsnotify/fsnotify](https://github.com/fsnotify/fsnotify) from 1.4.9 to 1.5.1.
- [Release notes](https://github.com/fsnotify/fsnotify/releases)
- [Changelog](https://github.com/fsnotify/fsnotify/blob/master/CHANGELOG.md)
- [Commits](https://github.com/fsnotify/fsnotify/compare/v1.4.9...v1.5.1)

---
updated-dependencies:
- dependency-name: github.com/fsnotify/fsnotify
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-25 12:28:54 +00:00
1dc6d14735 Fix file descriptor leaks and add test
* Add response.Body.Close() where needed to release HTTP
  connections to API server.
* Add tests to ensure no general leaks occur. 100% coverage would be
  required to ensure no leaks on any call.
* Update code comments to be godoc correct

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2021-08-24 16:36:10 -07:00
1e176923b1 teardown play kube
add the ability for play kube to tear down based on the yaml used to
play it.  it is indicated by --down in the play kube command.  volumes
are NOT deleted during the teardown.  pods and their containers are
stopped and removed.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2021-08-24 14:26:14 -05:00
3f22e52964 Allow setting of machine stream and image path from containers.conf
Default is "testing"

Signed-off-by: Ashley Cui <acui@redhat.com>
2021-08-24 14:18:55 -04:00
23f9565547 Merge pull request #11263 from nalind/journal-read
libpod/Container.readFromJournal(): don't skip the first entry
2021-08-24 14:16:22 -04:00
24ee67bb09 Merge pull request #11315 from vrothberg/fix-11304
generate systemd: use --cidfile again
2021-08-24 13:10:45 -04:00