Commit graph

3052 commits

Author SHA1 Message Date
baude 328250e7be Improve command line validation
Use the checkallandlatest function to validate flag usage as part
of the cobra command args validation.

Signed-off-by: baude <bbaude@redhat.com>
2019-02-22 14:13:08 -06:00
Daniel J Walsh 8039ccf4d5
Merge pull request #2411 from cevich/ubuntu_go111
Cirrus: Install Go 1.11 on Ubuntu VMs
2019-02-22 14:27:43 -05:00
Chris Evich 69c91e044a
Cirrus: Install Go 1.11 on Ubuntu VMs
There is no native package for this, so the packaged version must also
be installed, otherwise all the support/dependencies would be removed
also (like go-md2man).  Fix this by installing from the google released
tarball, into /usr/local/go and set $GOROOT to point there.

Also, include a small fix for hack/get_ci_vm.sh not installing
testing dependencies because of an old assumption.

***CIRRUS: REBUILD IMAGES***

Signed-off-by: Chris Evich <cevich@redhat.com>
2019-02-22 12:07:36 -05:00
Chris Evich 7184efe939
Cirrus: Add 20m extra timeout for Ubuntu
Tests running slower than normally-slow, bump timeout to allow them to
pass until better solution (for slow Ubuntu tests) can be found.

Signed-off-by: Chris Evich <cevich@redhat.com>
2019-02-22 12:07:34 -05:00
OpenShift Merge Robot 1788addd04
Merge pull request #2389 from baude/issue2388
add newline to images output
2019-02-22 00:03:40 +01:00
OpenShift Merge Robot eb6243226a
Merge pull request #2350 from mheon/lock_renumber
Add lock renumbering
2019-02-21 23:11:24 +01:00
Brent Baude 3447edd2ec
Merge pull request #4 from edsantiago/pr2389_update
update: remove duplicate newline
2019-02-21 15:21:27 -06:00
Ed Santiago bd354ad3cc update: remove duplicate newline
Signed-off-by: Ed Santiago <santiago@redhat.com>
2019-02-21 13:49:42 -07:00
Matthew Heon 19eb72f420 Fix typo in comment
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-02-21 14:19:50 -05:00
OpenShift Merge Robot b4c10790d5
Merge pull request #2385 from baude/remoteload
podman-remote load image
2019-02-21 18:29:47 +01:00
baude 71db80ddb1 podman-remote load image
enable the ability to load an image into remote storage
using the remote client.

Signed-off-by: baude <bbaude@redhat.com>
2019-02-21 10:11:19 -06:00
OpenShift Merge Robot af922fb2c6
Merge pull request #2394 from vrothberg/vendor-image-v1.4
vendor containers/image v1.4
2019-02-21 17:07:48 +01:00
Matthew Heon d2b77f8b33 Do not make renumber shut down the runtime
The original intent behind the requirement was to ensure that, if
two SHM lock structs were open at the same time, we should not
make such a runtime available to the user, and should clean it up
instead.

It turns out that we don't even need to open a second SHM lock
struct - if we get an error mapping the first one due to a lock
count mismatch, we can just delete it, and it cleans itself up
when it errors. So there's no reason not to return a valid
runtime.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-02-21 10:51:42 -05:00
Matthew Heon e0a6873d78 Add podman system renumber command
This command allows for renumbering Podman locks after an upgrade
to Podman with SHM locks from a 1.0 or earlier branch, or after
the number of locks was changed.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-02-21 10:51:42 -05:00
Matthew Heon 43db7734e8 Add ability to get a runtime that renumbers
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-02-21 10:51:42 -05:00
Matthew Heon f9c548219b Recreate SHM locks when renumbering on count mismatch
When we're renumbering locks, we're destroying all existing
allocations anyways, so destroying the old lock struct is not a
particularly big deal. Existing long-lived libpod instances will
continue to use the old locks, but that will be solved in a
followon.

Also, solve an issue with returning error values in the C code.
There were a few places where we return ERRNO where it was not
set, so make them return actual error codes).

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-02-21 10:51:42 -05:00
Matthew Heon a72025d6fd Move RenumberLocks into runtime init
We can't do renumbering after init - we need to open a
potentially invalid locks file (too many/too few locks), and then
potentially delete the old locks and make new ones.

We need to be in init to bypass the checks that would otherwise
make this impossible.

This leaves us with two choices: make RenumberLocks a separate
entrypoint from NewRuntime, duplicating a lot of configuration
load code (we need to know where the locks live, how many there
are, etc) - or modify NewRuntime to allow renumbering during it.
Previous experience says the first is not really a viable option
and produces massive code bloat, so the second it is.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-02-21 10:51:42 -05:00
Matthew Heon ca8ae877c1 Remove locks from volumes
I was looking into why we have locks in volumes, and I'm fairly
convinced they're unnecessary.

We don't have a state whose accesses we need to guard with locks
and syncs. The only real purpose for the lock was to prevent
concurrent removal of the same volume.

Looking at the code, concurrent removal ought to be fine with a
bit of reordering - one or the other might fail, but we will
successfully evict the volume from the state.

Also, remove the 'prune' bool from RemoveVolume. None of our
other API functions accept it, and it only served to toggle off
more verbose error messages.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-02-21 10:51:42 -05:00
Matthew Heon 9353a3e8ec Expand renumber to also renumber pod locks
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-02-21 10:51:42 -05:00
Matthew Heon a3dbb7a837 Add ability to rewrite pod configs in the database
Necessary for rewriting lock IDs as part of renumber.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-02-21 10:51:42 -05:00
Matthew Heon 7fdd20ae5a Add initial version of renumber backend
Renumber is a way of renumbering container locks after the number
of locks available has changed.

For now, renumber only works with containers.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-02-21 10:51:42 -05:00
Matthew Heon 84feff2e06 Add a function for overwriting container config
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-02-21 10:51:42 -05:00
OpenShift Merge Robot 28d6eeb57a
Merge pull request #2387 from baude/remotepodrm
enable podman-remote pod rm
2019-02-21 16:51:23 +01:00
OpenShift Merge Robot fc1b1ff691
Merge pull request #2392 from haraldh/master
Adjust LISTEN_PID for reexec in varlink mode
2019-02-21 16:17:20 +01:00
baude e91ec38a70 enable podman-remote pod rm
add the ability to delete a pod from the remote client.

Signed-off-by: baude <bbaude@redhat.com>
2019-02-21 08:40:42 -06:00
Valentin Rothberg c069d11759 vendor containers/image v1.4
This requires some additional changes to the dependencies since the
progress-bar library has been changed to github.com/vbauerster/mpb.

Please refer to the following link for the release notes:
https://github.com/containers/image/releases/tag/v1.4

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-02-21 11:54:04 +01:00
Harald Hoyer 3f60dc02e3
Adjust LISTEN_PID for reexec in varlink mode
Because the varlink server honors the socket activation protocol,
LISTEN_PID has to be adjusted with the new PID.

https://varlink.org/FAQ.html#how-does-socket-activation-work
Signed-off-by: Harald Hoyer <harald@redhat.com>
2019-02-21 10:25:57 +01:00
OpenShift Merge Robot 4934bf2327
Merge pull request #2390 from mheon/update_cstorage
Update c/storage vendor to v1.10 release
2019-02-21 00:36:32 +01:00
Matthew Heon 86dd25ae48 Update c/storage vendor to v1.10 release
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-02-20 17:53:09 -05:00
OpenShift Merge Robot 2cf2b7f8a6
Merge pull request #2367 from baude/remotesave
podman-remote save [image]
2019-02-20 23:52:35 +01:00
baude ad3ccd69f9 add newline to images output
ensure a final newline is always added to images output.

fixes #2388

Signed-off-by: baude <bbaude@redhat.com>
2019-02-20 16:44:23 -06:00
baude 711ac93051 podman-remote save [image]
Add the ability to save an image from the remote-host to the
remote-client.

Signed-off-by: baude <bbaude@redhat.com>
2019-02-20 12:58:05 -06:00
OpenShift Merge Robot 4de0bf9c74
Merge pull request #2378 from vrothberg/tree-status
hack/tree_status.sh: preserve new lines
2019-02-20 19:46:57 +01:00
OpenShift Merge Robot a68c964bf3
Merge pull request #2377 from vrothberg/kill-squared
remove duplicate kill from `podman --help`
2019-02-20 19:24:45 +01:00
OpenShift Merge Robot 148d46766f
Merge pull request #2360 from vrothberg/parallel-search
podman-search: run in parallel
2019-02-20 18:44:40 +01:00
OpenShift Merge Robot 11a1c23ab3
Merge pull request #2374 from mheon/rootless_recursive_start
Ensure that userns is created for stopped rootless pods
2019-02-20 14:58:13 +01:00
Valentin Rothberg 28ecb0f3da hack/tree_status.sh: preserve new lines
Quote the status output in echo to preserve the new lines.
Having the output in one line complicated debugging issues
and is not friendly to use.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-02-20 13:35:52 +01:00
Valentin Rothberg db0a2bcb5a remove duplicate kill from podman --help
Remove the duplicate kill command and only keep it in the
`mainCommands` containing commands that are implemented by
the native client and the remote one.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-02-20 12:49:31 +01:00
Valentin Rothberg 6ae4401bd1 iopodman.SearchImages: add ImageSearchFilter to Varlink API
Also add some argument checks to the Varlink function to avoid
referencing nil pointers, and complement the API.md descriptions.

The varlink endpoint can be tested via varlink CLI:

$ varlink call -m unix:/run/podman/io.podman/io.podman.SearchImages \
      '{"query": "ruby", "limit": 0, "tlsVerify": false, "filter": {}}'

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-02-20 10:25:25 +01:00
Valentin Rothberg 8a49b59ed4 image.SearchImages: use SearchFilter type
Use an `image.SearchFilter` instead of a `[]string` in the SearchImages
API.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-02-20 10:25:25 +01:00
Valentin Rothberg 0d3eaca28a SearchImages: extend API with filter parameter
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-02-20 10:25:25 +01:00
Valentin Rothberg 87c9f4cc22 podman-search: refactor code to libpod/image/search.go
Refactor the image-search logic from cmd/podman/search.go to
libpod/image/search.go and update podman-search and the Varlink API to
use it.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-02-20 10:25:25 +01:00
Valentin Rothberg b5c0d15683 podman-search: run in parallel
Spin up a goroutine for each registry to make podman-search run in
parallel.  This has considerable speed improvements.  For instance, a
`podman search ruby` drops from 11 to 2 seconds when using the following
search registries:

```toml
[registries.search]
registries = ['docker.io', 'registry.fedoraproject.org', 'quay.io',
              'registry.access.redhat.com', 'registry.centos.org']
```

The number of parallel goroutines is limited to 6 to play nice with
local resources and the registries.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-02-20 10:25:25 +01:00
Matthew Heon 5642472c49 Ensure that userns is created for stopped rootless pods
Signed-off-by: Matthew Heon <mheon@redhat.com>
2019-02-19 17:16:43 -05:00
OpenShift Merge Robot 3b88c73507
Merge pull request #2373 from mheon/pod_has_no_arguments
Podman pod create now errors on receiving CLI args
2019-02-19 23:06:59 +01:00
Matthew Heon 91ae38092b Podman pod create now errors on receiving CLI args
It has never accepted arguments, so we should error when passed
args we will never use.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-02-19 15:03:56 -05:00
OpenShift Merge Robot 82ae36c157
Merge pull request #2363 from TomSweeneyRedHat/dev/tsweeney/cobraex5
Fifth chunk of Cobra Examples
2019-02-19 19:48:05 +01:00
OpenShift Merge Robot 10ffa3ff82
Merge pull request #2348 from baude/remotepullverbose
podman-remote pull
2019-02-19 17:54:36 +01:00
baude 8f40c4e6b4 podman-remote pull
Add status for remote users and podman remote-client pull.

Signed-off-by: baude <bbaude@redhat.com>
2019-02-19 10:13:07 -06:00
OpenShift Merge Robot e92f7ca7dd
Merge pull request #2366 from haircommander/dont-start-started-deps
Don't start running dependencies
2019-02-19 16:43:27 +01:00