9209 Commits

Author SHA1 Message Date
36318e5cab Make Go builds more consistent
* Use the BUILDFLAGS variable for all Go builds
* Use `go install` instead of manually specifying the GOBIN path

Signed-off-by: Jordan Christiansen <xordspar0@gmail.com>
2020-09-17 11:22:12 -05:00
031ddf9c84 Merge pull request #7655 from vrothberg/fix-7628
--mount: support arbitrary mount-argument order
2020-09-17 10:15:32 -04:00
9f745d591d Merge pull request #7647 from jwhonce/issues/7543
Refactor remote pull to provide progress
2020-09-17 09:43:38 -04:00
c8d90d00c3 Merge pull request #7646 from edsantiago/version_options
podman version and --version: fix format, exit
2020-09-17 09:40:10 -04:00
d8414add00 Merge pull request #7654 from vrothberg/fix-7651
image list: return all associated names
2020-09-17 09:36:49 -04:00
98aa458c7a Merge pull request #7666 from containers/dependabot/go_modules/k8s.io/apimachinery-0.19.2
Bump k8s.io/apimachinery from 0.19.1 to 0.19.2
2020-09-17 09:23:28 -04:00
257874ae0a Bump k8s.io/apimachinery from 0.19.1 to 0.19.2
Bumps [k8s.io/apimachinery](https://github.com/kubernetes/apimachinery) from 0.19.1 to 0.19.2.
- [Release notes](https://github.com/kubernetes/apimachinery/releases)
- [Commits](https://github.com/kubernetes/apimachinery/compare/v0.19.1...v0.19.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-09-17 06:26:20 -04:00
1a929c7236 Merge pull request #7648 from xordspar0/kube-play-labels
Add labels to a pod created via play kube
2020-09-17 06:24:14 -04:00
ecae5f7ade image list: return all associated names
Always return all associated names / repo tags of an image and fix a bug
with malformed repo tags.

Previously, Podman returned all names only with `--all` but this flag
only instructs to list intermediate images and should not alter
associated names.  With `--all` Podman queried the repo tags of an image
which splits all *tagged* names into repository and tag which is then
reassembled to eventually be parsed again in the frontend.  Lot's of
redundant CPU heat and buggy as the reassembly didn't consider digests
which ultimately broke parsing in the frontend.

Fixes: #7651
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-09-17 12:23:58 +02:00
55dfa7fad2 Add labels to a pod created via play kube
When using `podman play kube` with a YAML file that has pod labels,
apply those labels to the pods that podman makes.

For example, this Deployment spec has labels on a pod:

	apiVersion: apps/v1
	kind: Deployment
	metadata:
	  name: myapp
	  labels:
	    app: myapp
	spec:
	  selector:
	    matchLabels:
	      app: myapp
	  template:
	    metadata:
	      labels:
		app: myapp
	    spec:
	      containers:
	      - name: web
		image: nginx
		ports:
		- containerPort: 80

The pods that podman creates will have the label "app" set to "myapp" so
that these pods can be found with `podman pods ps --filter label=app`.

Signed-off-by: Jordan Christiansen <xordspar0@gmail.com>
2020-09-16 15:46:08 -05:00
8d7e795454 Merge pull request #7621 from rhatdan/pods
Fix podman pod create --infra-command and --infra-image
2020-09-16 16:40:44 -04:00
222cf74412 Refactor remote pull to provide progress
podman and podman-remote do not exactly match as the lower layer code
checks if the output is destined for a  TTY before creating the progress
bars.  A future PR for containers/images could change this behavior.

Fixes #7543

Tested with:

$ (echo '# start'; podman-remote pull nginx ) 2>&1 | ts '[%Y-%m-%d %H:%M:%.S]'
$ (echo '# start'; podman pull nginx ) 2>&1 | ts '[%Y-%m-%d %H:%M:%.S]'

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-09-16 10:44:26 -07:00
acf86ef5ab Merge pull request #7653 from AkihiroSuda/fix-7652
Fix "rootless-cni-infra + runc fails with ENODEV"
2020-09-16 15:47:43 +02:00
067c13b384 --mount: support arbitrary mount-argument order
Support an arbitrary order in which arguments are specified to the
`--mount` flag.  Previously, Podman expected `type=...` to come
first which was breaking compatibility with Docker.

Note that this is the ground work to default to "volume" (again Docker
compat).  However, this will require some further massaging as we have
to assign a name.

Fixes: #7628
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-09-16 14:18:40 +02:00
b3d6383f25 Fix podman pod create --infra-command and --infra-image
Currently infr-command and --infra-image commands are ignored
from the user.  This PR instruments them and adds tests for
each combination.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-09-16 07:42:19 -04:00
e46a06ecf6 Fix "rootless-cni-infra + runc fails with ENODEV"
runc always expect "bind" to be present in opts even when the type is "bind".

Fix #7652

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-09-16 18:38:36 +09:00
0d14d7b715 Merge pull request #7624 from QiWang19/policy-option
Supports import&run--signature-policy
2020-09-16 11:05:33 +02:00
b9c47fa40b Merge pull request #7636 from vrothberg/fix-7407
run/create: record raw image
2020-09-16 09:00:47 +02:00
26049193e0 Merge pull request #7642 from jwhonce/issues/7327-2
Refactor API version values
2020-09-16 04:06:30 +02:00
32b49463d9 Merge pull request #7640 from rhatdan/systemd
Fix --systemd=always regression
2020-09-16 04:03:11 +02:00
5ececd8a0b Merge pull request #7643 from baude/updateowners
[CI:DOCS]update owners file
2020-09-16 03:59:49 +02:00
db86ea9bca podman version and --version: fix format, exit
Three unrelated fixes to version output:

  * podman version --format json: was missing a newline
  * podman version --format TEMPLATE: had too many newlines

  * podman --version: would neither display version nor exit
    if followed by a subcommand ('podman --version ps')

The first two were easy: I used my best tweezers to delicately
pluck and transfer the misplaced \n and place it where needed.

The third was a doozy of a rabbit hole. As best I can tell,
a workaround was added in root.go to override cobra's built-in
Version handling, apparently to avoid having cobra add "-v"
as an alias for "--version". As best I can tell, cobra only
does this if the "-v" shortcut is not already taken (at
least as of Nov 2019: https://github.com/spf13/cobra/pull/996 ).
Also as best I can tell that workaround is purely vestigial,
and removing it is safe. I've manually tested "-v" in podman run,
system df, and rm. I've run system tests.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-09-15 15:08:18 -06:00
2eb3339343 Merge pull request #7644 from edsantiago/bats
Fix CI breakage due to PR collision
2020-09-15 23:07:28 +02:00
2fcd1d7b4d Supports import&run--signature-policy
Enables podman create, pull, run, import to use --signature-policy option. Set it as hidden flag to be consistent with other commands.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-09-15 16:09:33 -04:00
0f1d9b3bbc Fix CI breakage due to PR collision
PR #7633 disallowed "-l" (--latest) with container args.

PR #7630 made changes to the "podman wait" command. The error
message it issues is inconsistent (and incompatible) with
the one required by the new BATS --help test. Fix that.

This is entirely my fault. I was aware of #7630, and I was
careful to check the output message format, but I was not
careful enough (I trusted my eyes, not my code).

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-09-15 13:15:17 -06:00
38eb7497f8 [CI:DOCS]update owners file
update owners file to reflect more active contributors.

Signed-off-by: baude <bbaude@redhat.com>
2020-09-15 14:05:46 -05:00
8a8bae8299 Refactor API version values
* API-Version header now Major.Minor to support tools parsing this
   header
 * Libpod Version updated to 2.0.0 to reflect changes in API field
   values
 * API-Version and Libpod-API-Version headers are now included in all
   results

Fixes #7327

 * Header support tested against goland 2020.2 and
    https://www.jetbrains.com/help/idea/docker.html plugin

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-09-15 11:29:45 -07:00
bec96ab034 Merge pull request #7638 from jwhonce/wip/archive
Correct HTTP methods for /containers/{id}/archive
2020-09-15 20:01:36 +02:00
e7af517914 Merge pull request #7633 from edsantiago/minus_l_with_other_args
Usability: prevent "-l" with arguments
2020-09-15 19:58:19 +02:00
46280d6aba Merge pull request #7620 from rhatdan/DOCKER_HOST
Document the connection path for podman --remote
2020-09-15 19:54:47 +02:00
912f952c1f Fix --systemd=always regression
The kernel will not allow you to modify existing mount flags on a volume
when bind mounting it to another place.  Since /sys/fs/cgroup/systemd is
mounted noexec on the host, it needs to be mounted with the same flags
in the rootless container.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-09-15 13:29:44 -04:00
0be5836e49 Merge pull request #7637 from vrothberg/fix-7263
events endpoint: header: do not wait for events
2020-09-15 17:19:45 +02:00
e73db4b43a Correct HTTP methods for /containers/{id}/archive
Make methods align with Docker API

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-09-15 08:11:49 -07:00
0b7cb2c6b2 events endpoint: header: do not wait for events
Do not wait for events to occur before writing the OK header.
Events can take an unknown amount of time to occur and clients
do not need to wait until then to know if the connection is
good.

Fixes: #7263
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-09-15 14:28:38 +02:00
ce6efadd5c run/create: record raw image
Record the user-specified "raw" image name in the SpecGenerator, so we
can pass it along to the config when creating a container.  We need a
separate field as the image name in the generator may be set to the
ID of the previously pulled image - ultimately the cause of #7404.

Reverting the image name from the ID to the user input would not work
since "alpine" for pulling iterates over the search registries in the
registries.conf but looking up "alpine" normalizes to
"localhost/alpine".

Recording the raw-image name directly in the generator was the best of
the options I considered as no hidden magic from search registries or
normalizations (that may or may not change in the future) can interfere.
The auto-update backend enforces that the raw-image name is a
fully-qualified reference, so we need to worry about that in the front
end.

Fixes: #7407
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-09-15 13:33:22 +02:00
3f6045ce20 Merge pull request #7625 from vrothberg/fix-7617
move `rootless-cni-infra` image to quay.io
2020-09-15 12:21:10 +02:00
3b4ad9a81d Merge pull request #7452 from jwhonce/issues/7136
Refactor API build endpoint to be more compliant
2020-09-15 12:17:12 +02:00
d5db2af340 Merge pull request #7634 from vrothberg/vendor-image
vendor github.com/containers/image/v5@v5.6.0
2020-09-15 12:13:58 +02:00
155d43631e rootless CNI: extract env and cmd from image
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-09-15 10:18:30 +02:00
02f8acce2a libpod: rootless CNI image: use quay
Use the newly built image from quay.io.  Also reference the image by
digest.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-09-15 10:18:26 +02:00
d4bea54dfe move rootless-cni-infra image to quay.io
Move the `rootless-cni-infra` image to `quay.io/libpod/rootless-cni-image:$tag`
where $tag has the format `$version-$architecture`.  Whenever we upload
a new image (e.g., after changing the Containerfile), we need to make
sure to increase the version number (an ordinary integer for simplicity) so we
have a notion of support.

Thanks to @AkihiroSuda for working on rootless CNI!

Fixes: #7617
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-09-15 10:14:34 +02:00
ba31680272 vendor github.com/containers/image/v5@v5.6.0
No code changes as we vendored a pre-release commit.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-09-15 09:48:04 +02:00
5c47a331ba Merge pull request #7630 from Luap99/wait-n-args
podman wait accept args > 1
2020-09-14 23:09:14 -04:00
685ef847dd podman wait accept args > 1
Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2020-09-15 00:02:45 +02:00
2583948f72 Usability: prevent "-l" with arguments
Add new system check confirming that "podman foo -l arg"
throws an error; and fix lots of instances where code
was not doing this check.

I'll probably need to add something similar for --all but
that can wait.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-09-14 15:49:28 -06:00
48927f186d Document the connection path for podman --remote
Issue: GH-7010
Signed-off-by: Jhon Honce <jhonce@redhat.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-09-14 17:06:24 -04:00
146c68f3ac Refactor API build endpoint to be more compliant
* Refactor/Rename channel.WriteCloser() to encapsulate the channel
* Refactor build endpoint to "live" stream buildah output channels
  over API rather then buffering output
* Refactor bindings/tunnel build because endpoint changes
  * building tar file now in bindings rather then depending on
    caller
* Cleanup initiating extra image engine
* Remove setting fields to zero values (less noise in code)
* Update tests to support remote builds

Fixes #7136
Fixes #7137

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-09-14 13:46:59 -07:00
fd7cdb2502 Merge pull request #7611 from rhatdan/completions
Fix completions for namespaces
2020-09-14 04:37:09 -04:00
b7a7cf6576 Merge pull request #7614 from mheon/bump-2.1.0-rc1
[CI:DOCS] Bump to v2.1.0-RC1
2020-09-14 03:48:42 -04:00
b7936b552f Merge pull request #7616 from EduardoVega/5845-support-for-systemd-resolved
Determine if resolv.conf points to systemd-resolved
2020-09-14 03:45:20 -04:00