9671 Commits

Author SHA1 Message Date
6f6cf87f8f Add support for host keys for non-22 ports
When not using the standard SSH port (22), the port is appended
to the hostname (in brackets) like so: "host" -> "[host]:1234"

Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
(cherry picked from commit 8794e8db1ce3088d633911454d6d36c4e939e126)
2020-10-25 16:30:42 +01:00
bce8331528 Merge pull request #8096 from ypu/log-driver-test
Tests: Check different log driver can work with podman logs
2020-10-25 10:46:44 -04:00
6fa6470d24 Merge pull request #8116 from containers/dependabot/go_modules/github.com/containers/buildah-1.16.5
Bump github.com/containers/buildah from 1.16.4 to 1.16.5
2020-10-24 05:43:44 -04:00
050dcadf69 Merge pull request #8103 from baude/eventlabels
filter events by labels
2020-10-23 16:21:53 -04:00
c593e49701 filter events by labels
adding the ability to filter evens by the container labels.  this requires that container labels be added to the events data being recorded and subsequently read.

Signed-off-by: baude <bbaude@redhat.com>
2020-10-23 12:07:34 -05:00
51fa8ded9f Merge pull request #8109 from matejvasek/inspect-apiv2-rootfs
fix: /image/{name or id}/json returns RootFS layers
2020-10-23 07:01:03 -04:00
22b1d10d31 Bump github.com/containers/buildah from 1.16.4 to 1.16.5
Bumps [github.com/containers/buildah](https://github.com/containers/buildah) from 1.16.4 to 1.16.5.
- [Release notes](https://github.com/containers/buildah/releases)
- [Changelog](https://github.com/containers/buildah/blob/master/CHANGELOG.md)
- [Commits](https://github.com/containers/buildah/compare/v1.16.4...v1.16.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-10-23 06:52:53 -04:00
2adc1b284d Merge pull request #8111 from Luap99/fix-missing-resolv.conf
Don't error if resolv.conf does not exists
2020-10-22 17:47:03 -04:00
8e06f8efbc Merge pull request #8053 from rhatdan/detachkeys
podman create doesn't support creating detached containers
2020-10-22 16:29:28 -04:00
2ca4af6c40 Merge pull request #8110 from lsm5/cap-net-raw
replace net_raw with setuid
2020-10-22 16:22:38 -04:00
a53a660313 Merge pull request #8078 from baude/networkdisconnect
APIv2 compatibility network connect|disconnect
2020-10-22 16:19:11 -04:00
a997b59e44 src: nil check
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2020-10-22 20:05:01 +02:00
f391849c22 Don't error if resolv.conf does not exists
If the resolv.conf file is empty we provide default dns servers.
If the file does not exists we error and don't create the
container. We should also provide the default entries in this
case. This is also what docker does.

Fixes #8089

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2020-10-22 19:21:07 +02:00
5098048f82 src: add nil checks
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2020-10-22 18:33:15 +02:00
914bbf5e49 replace net_raw with setuid
podman does not allow setting CAP_NET_RAW

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2020-10-22 12:18:04 -04:00
d340f8523c Merge pull request #8101 from mheon/net_none_hostname
Add hostname to /etc/hosts for --net=none
2020-10-22 11:25:27 -04:00
89e7b8f22b fix: /image/{name}/json returns RootFS layers
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2020-10-22 17:09:44 +02:00
2cb12bbc5a Merge pull request #8098 from vrothberg/fix-8082
container create: record correct image name
2020-10-22 11:03:46 -04:00
513c2610f3 Merge pull request #7956 from QiWang19/save-rm-sig
Allow save image remove-signatures
2020-10-22 11:00:09 -04:00
5d70f46bd3 Merge pull request #8104 from baude/setnetworkdriverdefault
set compat network driver default
2020-10-22 09:21:45 -04:00
6841936525 APIv2 compatibility network connect|disconnect
Add endpoints for the compat layer for network connect and disconnect. As of now, these two endpoints do nothing to change the network state of a container.  They do some basic data verification and return the proper 200 response.  This at least allows for scripts to work on the compatibility layer instead of getting 404s.

Signed-off-by: baude <bbaude@redhat.com>
2020-10-22 08:20:28 -05:00
8e66795530 Tests: Check different log driver can work with podman logs
Add a check step in podman run --log-driver test. Prefer to add
it here as it already has a loop to cover all different drivers
in this test.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
2020-10-22 14:38:28 +08:00
15345ce4c3 podman create doesn't support creating detached containers
Detached containers and detach keys are only created with the podman run, i
exec, and start commands.  We do not store the detach key sequence or the
detach flags in the database, nor does Docker. The current code was ignoreing
these fields but documenting that they can be used.

Fix podman create man page and --help output to no longer indicate that
--detach and --detach-keys works.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-10-21 21:00:50 -04:00
2cd2359a6d Merge pull request #7772 from TomSweeneyRedHat/dev/tsweeney/splitn
Convert Split() calls with an equal sign to SplitN()
2020-10-21 21:00:16 -04:00
2bd920b005 Merge pull request #8077 from jwhonce/wip/report
Refactor podman to use c/common/pkg/report
2020-10-21 17:59:56 -04:00
cf227cc7f2 set compat network driver default
when using the compatibility endpoint for creating a network, if the driver is not provided, we need to set it to the default network driver ... which is bridge.

Signed-off-by: baude <bbaude@redhat.com>
2020-10-21 14:48:29 -05:00
61b276a05c Merge pull request #8083 from crunchtime-ali/add-eol-to-compat-log
Add EOL to compat container logs
2020-10-21 15:31:08 -04:00
0864d82cb5 Add hostname to /etc/hosts for --net=none
This does not match Docker, which does not add hostname in this
case, but it seems harmless enough.

Fixes #8095

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-10-21 13:45:41 -04:00
a1b942ff40 Merge pull request #8034 from rhatdan/options
Switch help messages from using [flags] to [options]
2020-10-21 12:59:42 -04:00
9060af9719 Merge pull request #8093 from rhatdan/wait
Fix handling and documentation of podman wait --interval
2020-10-21 11:30:44 -04:00
bab3cda0e8 Refactor podman to use c/common/pkg/report
All formatting for containers stack moved into one package
The does not correct issue with headers when using custom tables

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-10-21 08:16:52 -07:00
410fa53f89 container create: record correct image name
Record the correct image name when creating a container by using the
resolved image name if present.  Otherwise, default to using the first
available name or an empty string in which case the image must have been
referenced by ID.

Fixes: #8082
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-10-21 16:51:09 +02:00
f96dbd0896 Merge pull request #8092 from rhatdan/stdin
Podman build should default to not usins stdin
2020-10-21 10:50:45 -04:00
287edd4e21 Merge pull request #8090 from containers/dependabot/go_modules/k8s.io/apimachinery-0.19.3
Bump k8s.io/apimachinery from 0.19.2 to 0.19.3
2020-10-21 10:23:32 -04:00
b26c6519ac Add EOL to compat container logs
Signed-off-by: Alexander Zigelski <ali@crunchtime.dev>
2020-10-21 16:21:28 +02:00
b898f914a3 save image remove signatures
remove signatures to podman save since the image formats do not support signatures
Close: #7659

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-10-21 10:00:08 -04:00
b4a10538e1 Merge pull request #7948 from saschagrunert/ps-fix
Fix ps port output
2020-10-21 08:42:41 -04:00
980b1e87d4 Switch use of Flags to Options
Want to have man pages match commands, since we have lots of printed
man pages with using Options, we will change the command line to use
Options in --help.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-10-21 08:37:57 -04:00
9d9c58ba64 Merge pull request #8065 from edsantiago/flake_tweaks
Tests: Fix common flakes, and improve apiv2 test log
2020-10-21 07:21:49 -04:00
d5073af6b2 Merge pull request #8022 from baude/compatapitospecgen
refactor api compatibility container creation to specgen
2020-10-21 06:35:51 -04:00
c758b8f9d9 Bump k8s.io/apimachinery from 0.19.2 to 0.19.3
Bumps [k8s.io/apimachinery](https://github.com/kubernetes/apimachinery) from 0.19.2 to 0.19.3.
- [Release notes](https://github.com/kubernetes/apimachinery/releases)
- [Commits](https://github.com/kubernetes/apimachinery/compare/v0.19.2...v0.19.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-10-21 06:32:37 -04:00
3f265e91f4 Fix handling and documentation of podman wait --interval
In older versions of podman, we supported decimal numbers defaulting
to microseconds.  This PR fixes to allow users to continue to specify
only digits.

Also cleaned up documentation to fully describe what input for --interval flag.

Finally improved testing on podman wait to actually make sure the command succeeded.
Fixed tests to work on podman-remote.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-10-21 06:25:36 -04:00
d72918fe6f Podman build should default to not usins stdin
Currently we leak stdin into podman builds, which can lead
to issues like run commands inside of the container waiting for
user input.

We should not take input from users other then if the user specifies
podman build -f - or podman build -, which are taken care of in other code.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-10-21 05:33:00 -04:00
94873a237a Merge pull request #8075 from mheon/fix_8073
Retrieve network inspect info from dependency container
2020-10-20 17:07:11 -04:00
4822cc8cab Merge pull request #8042 from rhatdan/tlsverify
--tls-verify and --authfile should work for all remote commands
2020-10-20 15:34:56 -04:00
6961b9475d Merge pull request #8067 from mheon/net_host_hosts
Ensure that hostname is added to hosts with net=host
2020-10-20 15:18:53 -04:00
f5b3dc976c Tests: Fix common flakes, and improve apiv2 test log
- apiv2 - the 'ten /info requests' test is flaking often,
  taking ~8 seconds (our limit is 7, up from 5 a few weeks
  ago). Brent suggested that the first /info call might be
  expensive, because it needs to access storage. So, let's
  prime it by running one /info outside the timing loop.
  And, because even that continues to fail, bump it up
  to 10 seconds and file #8076 to track the slowdown.

- toolbox test - WaitForReady() has timed out, even on one
  occasion causing a run failure because it failed 3 times.
  Solution: bump up timeout from 2s to 5s. Not really great,
  but CI systems are underpowered, and it's not unreasonable
  that 2s might be too low.

- sdnotify test - add a 'podman wait' between stop & rm.
  This may prevent a "cannot rm container as it is running"
  race condition.

While working on this, Brent and I noticed a few ways that
test-apiv2 logging can be improved:

- test name: when request is POST, display the jsonified
  parameters, not the original input ones. This should
  make it much easier to reproduce failures.

- use curl's "--write-out" option to capture http code,
  content type, and request time. We were getting the
  first two via grep from logged headers; this is cleaner.
  And there was no other way to get timing. We now include
  the timing as X-Response-Time in the log file.

- abort on *any* curl error, not just 7 (cannot connect).
  Any error at all from curl is bad news.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-10-20 11:32:49 -06:00
c1b844ecc8 Retrieve network inspect info from dependency container
When a container either joins a pod that shares the network
namespace or uses `--net=container:` to share the network
namespace of another container, it does not have its own copy of
the CNI results used to generate `podman inspect` output. As
such, to inspect these containers, we should be going to the
container we share the namespace with for network info.

Fixes #8073

Signed-off-by: Matthew Heon <mheon@redhat.com>
2020-10-20 13:27:33 -04:00
eb91d66c4a refactor api compatibility container creation to specgen
when using the compatibility layer to create containers, it used code paths to the pkg/spec which is the old implementation of containers.  it is error prone and no longer being maintained.  rather that fixing things in spec, migrating to specgen usage seems to make the most sense.  furthermore, any fixes to the compat create will not need to be ported later.

Signed-off-by: baude <bbaude@redhat.com>
2020-10-20 12:06:59 -05:00
36682115b0 Merge pull request #7126 from mheon/fix_missing_ociruntime
Fix missing OCI Runtime
2020-10-20 11:22:43 -04:00