Commit graph

1569 commits

Author SHA1 Message Date
Giuseppe Scrivano 9e06478d83 rootless: fix user lookup if USER= is not set
Lookup the current username by UID if the USER env variable is not
set.

Reported in: https://github.com/projectatomic/libpod/issues/1092

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #1217
Approved by: rhatdan
2018-08-08 09:27:27 +00:00
baude 14b6106c7b enabled copr epel builds again
centos/epel does not understand the Recommends tag

Signed-off-by: baude <bbaude@redhat.com>

Closes: #1231
Approved by: rhatdan
2018-08-08 09:03:08 +00:00
baude e94ae35be9 Handle yum and dnf
Signed-off-by: baude <bbaude@redhat.com>

Closes: #1227
Approved by: rhatdan
2018-08-07 20:46:09 +00:00
baude 69a741817b Test regressions against the RPM spec file
We need to make sure we dont break the RPM spec files week-to-week.  If we do, the
packagers need to have a place to look at what changes are needed to the SPEC so
they can pull the changes into the distributions.

Signed-off-by: baude <bbaude@redhat.com>

Closes: #1230
Approved by: rhatdan
2018-08-07 20:23:53 +00:00
Daniel J Walsh 7d43e7c451 Pass DESTDIR down to python Makefile
In order to get a cleaner build out of the rpms we should
pass down the DESTDIR to the python Makefiles.  Then we
can use them instead of hard coding other inteligence into
the spec files.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #1214
Approved by: baude
2018-08-07 14:52:30 +00:00
Daniel J Walsh 0f1086cf7c Add dpkg support for returning oci/conmon versions
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #1224
Approved by: baude
2018-08-07 14:16:26 +00:00
Daniel J Walsh 33d6221ae3 Have info print conmon/oci runtime information
We need into to identify the OCI runtime and conmon used by podman.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #1224
Approved by: baude
2018-08-07 14:16:26 +00:00
baude b1de943eea Better pull error for fully-qualified images
When pulling a fully-qualified image that fails, we should not be talking about
registries/search registries in the the error message as it is not applicable.  If
a image that is fq'd and fails to pull, the error should be simplified.

```
$ sudo podman pull this-does-not-exist.example.com/foo
Trying to pull this-does-not-exist.example.com/foo...Failed
error pulling image "this-does-not-exist.example.com/foo": unable to pull this-does-not-exist.example.com/foo: unable to pull image, or you do not have pull access
$
```

Resolves: #1212
Signed-off-by: baude <bbaude@redhat.com>

Closes: #1216
Approved by: mheon
2018-08-06 20:34:29 +00:00
haircommander e90909735c Stub varlink pod methods.
Signed-off-by: haircommander <pehunt@redhat.com>

Closes: #1196
Approved by: baude
2018-08-06 17:32:29 +00:00
Jhon Honce 606b5f9a61 Remove inotify work around
PR#1215 fixed issue with podman blowing up inotify

Signed-off-by: Jhon Honce <jhonce@redhat.com>

Closes: #1222
Approved by: baude
2018-08-06 16:58:26 +00:00
baude bd9d3a8fa5 Rename varlink socket and interface
io.projectatomic.podman -> io.podman

Signed-off-by: baude <bbaude@redhat.com>

Closes: #1204
Approved by: mheon
2018-08-06 14:49:11 +00:00
Brent Baude ee89bc46eb
Merge pull request #1220 from baude/coprgitrev
Change tarball filename in copr prepare and match short-commit length
2018-08-06 08:55:05 -05:00
baude 3c20bb0e70 Change tarball filename in copr prepare and match short-commit length
Signed-off-by: baude <bbaude@redhat.com>
2018-08-06 08:45:34 -05:00
baude 99a37afc3a Add Runc and Conmon versions to Podman Version
It will be handy to know the runc and conmon versions as our
code gets into the wild.

Signed-off-by: baude <bbaude@redhat.com>

Closes: #1207
Approved by: rhatdan
2018-08-05 23:19:47 +00:00
Brent Baude 5acbbf03e3
Merge pull request #1218 from baude/coprupdatespec
update copr spec, lets get it building again
2018-08-05 12:29:49 -05:00
baude 9987dd961b update copr spec, lets get it building again
Signed-off-by: baude <bbaude@redhat.com>
2018-08-05 11:38:21 -05:00
Jhon Honce 54eec54b2a Add missing dependencies to build system
Signed-off-by: Jhon Honce <jhonce@redhat.com>

Closes: #1199
Approved by: rhatdan
2018-08-05 11:06:18 +00:00
Jhon Honce 47620961fe Port to MacOS
* Refactor Tunnel to support selecting port for remote sshd
* Refactor ssh tunnel to support MacOS version of ssh
* Refactor Tunnel.close() to find and kill off zombie siblings
* Add psutil dependency
* Add logging setup, letting library produce debugging records
* Clean up Tunnel API
* Fix test_runner.sh to propagate returncode to caller

Signed-off-by: Jhon Honce <jhonce@redhat.com>

Closes: #1199
Approved by: rhatdan
2018-08-05 11:06:18 +00:00
baude a1e3e542ff Make one runtime for the varlink service
Rather than making a runtime each time a client hits a varlink endpoint, we now
make a single runtime when the varlink service starts up.  This fixes a problem
where we hit a max inotify limit from CNI.

Resolves: #1211

Signed-off-by: baude <bbaude@redhat.com>

Closes: #1215
Approved by: rhatdan
2018-08-05 10:43:32 +00:00
Matthew Heon debf23c72a
Merge pull request #1213 from mheon/bump-0.8.1
Bump to 0.8.1
2018-08-03 14:47:08 -04:00
Matthew Heon 650a199b1f Bump gitvalidation epoch
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-08-03 14:46:15 -04:00
Matthew Heon 11264dabda Bump to v0.8.2-dev
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-08-03 14:46:15 -04:00
Matthew Heon 6b4ab2a2b4 Bump to v0.8.1
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-08-03 14:46:11 -04:00
Daniel J Walsh 7462ebe830 Vendor in latest github.com/projectatomic/buildah
This adds support for Dockerfile.in and fixes some limits
issues on docker build

Also adds support for podman build to read Dockerfile from stdin.

cat Dockerfile | podman build -f - .

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #1209
Approved by: mheon
2018-08-03 14:39:07 +00:00
Matthew Heon a83f54e9c7 Update gitvalidation epoch
Signed-off-by: Matthew Heon <mheon@redhat.com>

Closes: #1210
Approved by: rhatdan
2018-08-03 14:31:55 +00:00
Anders F Björklund 71af51e723 Check for missing arguments in /proc/self/cmdline
Closes: #1206
Approved by: giuseppe
2018-08-03 07:39:25 +00:00
haircommander 26b9b17d27 Added ps --pod option
Signed-off-by: haircommander <pehunt@redhat.com>

Closes: #1205
Approved by: rhatdan
2018-08-02 20:39:06 +00:00
baude 20155657ec clarify pull error message
when pulling, we can fail to find an image (i.e. it doesn't exist) or we
can not have authority/access to pull it.  the registries don't tell us
one way or another so the error message needs to cover both.

Resolves #1194

Signed-off-by: baude <bbaude@redhat.com>

Closes: #1195
Approved by: rhatdan
2018-08-02 19:53:50 +00:00
Giuseppe Scrivano 13b1845214 rootless: do not set setgroups to deny when using newuidmap
It is required only when directly configuring the user namespace.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #1200
Approved by: rhatdan
2018-08-02 18:49:55 +00:00
Daniel J Walsh 9f2da6f59f
Merge pull request #1201 from giuseppe/fix-segfault-rootless
rootless: do not segfault if the parent already died
2018-08-02 14:42:39 -04:00
Daniel J Walsh d55445d77f
Merge pull request #1202 from rhatdan/man
Man page fixes found by https://pagure.io/ManualPageScan
2018-08-02 14:41:59 -04:00
Daniel J Walsh 995ab8391d
Man page fixes found by https://pagure.io/ManualPageScan
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2018-08-02 09:21:43 -04:00
Miloslav Trmač 126a97af82 Inline pullGoalNamesFromPossiblyUnqualifiedName into Runtime.pullGoalFromPossibly...
Again, we only needed them split for tests; so, integrate them back.
Then drop all remaining references to pullRefName and pullGoalNames,
which are not used for anything.

Should not change behavior

Signed-off-by: Miloslav Trmač <mitr@redhat.com>

Closes: #1198
Approved by: mheon
2018-08-02 13:17:17 +00:00
Miloslav Trmač 5334d9ab5e Replace getPullRefName by Runtime.getPullRefPair
This more or less reverts 9c9401a96c
"Replace getPullRefPair with getPullRefName"; now that tests don't require
us to use pullRefName, move creation of storage references deeper into the
calls stack to reduce string use.

ir.getSinglePullRefNameGoal is accordingly updated to ir.getSinglePullRefPairGoal,
and we need to add a ~duplicate singlePullRefPairGoal; that duplication
of singlePullRefNameGoal will soon be resolved by dropping singlePullRefNameGoal.

Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>

Closes: #1198
Approved by: mheon
2018-08-02 13:17:17 +00:00
Miloslav Trmač 682076e58f Inline pullGoalNamesFromImageReference back into Runtime.pullGoalFromImageReference
Now that we don't need a separate pullGoalNamesFromImageReference for
running tests, inline it back.

This forces us to add some glue code to getSinglePullRefNameGoal
and to convert between pullGoal and *pullGoal; that is temporary
and will be cleaned up soon.

Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>

Closes: #1198
Approved by: mheon
2018-08-02 13:17:17 +00:00
Miloslav Trmač 4cf9308bf2 Introduce getSinglePullRefNameGoal
This merely wraps the
> return singlePullRefNameGoal(getPullRefName(... reference)), nil
pattern which is used for almost all getPullRefName uses.  For now
it seems not really worth it, but it will result in shorter code
(and smaller migration) after we replace getPullRefName with
getPullRefPair, which can fail, again - the pullGoalNamesFromImageReference
will not have to add any error handling.

Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>

Closes: #1198
Approved by: mheon
2018-08-02 13:17:17 +00:00
Miloslav Trmač 48763b14ae Test Runtime.pullGoalFromPossiblyUnqualifiedName instead of pullGoalNameFrom...
Similarly to pullGoalNamesFromImageReference, use a storage.Store and
test the actually created references; that is more representative,
and clearly shows the impact of further normalization in
storageReference (like defaulting to :latest on NameOnly references).

Only modifies tests, so does not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>

Closes: #1198
Approved by: mheon
2018-08-02 13:17:17 +00:00
Miloslav Trmač be101dee8a Test Runtime.pullGoalFromImageReference instead of pullGoalNamesFromImageReference
pullGoalNamesFromImageReference has been added only to allow testing without
a storage.Store, because I thought that a storage.Store can only be created
by root.

It turns out that non-root stores, at least good enough for reference
parsing and formatting, are possible (and have existed in c/image/storage
tests), so this creates such a store, and modifies the existing
test to test the created c/image/storage.storageReference values
instead of strings; that is more representative, and clearly shows
the impact of further normalization in storageReference (like
defaulting to :latest on NameOnly references).

Eventually we will want to get rid of pullGoalNames / pullRefName.

Only modifies tests, so does not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>

Closes: #1198
Approved by: mheon
2018-08-02 13:17:17 +00:00
baude a6de23278a Use REGISTRIES_CONFIG_PATH for all tests
We should not be using the test systems registries.conf file for integration
tests. We should always use a constructed file created specifically for the
integration tests or we stand to have unpredictable results.  The beforeTest
function now sets an environment variable pointing to a registries.conf file
in the test's tempdir.  That file will container docker.io as a default.

The afterTest function then clears the environment variable.

Signed-off-by: baude <bbaude@redhat.com>

Closes: #1197
Approved by: rhatdan
2018-08-02 12:40:14 +00:00
Giuseppe Scrivano c7b6403ae5
rootless: do not segfault if the parent already died
Closes: https://github.com/projectatomic/libpod/issues/1189

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-08-02 14:29:50 +02:00
Miloslav Trmač 3d1449b2cc RFC: Rename runtime.pullImage to runtime.pullImageFromHeuristicSource
This is similar to the PushImageToHeuristicDestination RFC.

The goal is to be very explicit about which functions try to heuristically
guess what is the expected format of the string.  Not quite "shaming"
the users, but making sure they stand out.

RFC:
- Is this at all acceptable? Desirable?

Should not change behavior (but does not add unit tests).

Signed-off-by: Miloslav Trmač <mitr@redhat.com>

Closes: #1176
Approved by: rhatdan
2018-08-01 18:22:59 +00:00
Miloslav Trmač 1c2d245c47 Introduce Runtime.pullImageFromReference, call it in Runtime.FromImageReference
FINALLY, (podman load) can pass through an ImageReference directly from
loadCmd all the way to pullGoalNamesFromImageReference, making sure not
to trigger the docker-like reference parsing heuristics.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>

Closes: #1176
Approved by: rhatdan
2018-08-01 18:22:59 +00:00
Miloslav Trmač 0d4a5549d6 RFC: Remove unused transport name constants from libpod
They are not used anywhere in the packagee.

Two of the values still have users in the CLI, but used only once.
So, use the .Transport.Name() calls in there directly, that is
likely to be cheaper (and makes the files depend directly
on the transports instead of referring to them indirectly through
libpod).

RFC: Should not change behavior in _this_ repo, but it is an
externally-observable API change. Is there any user that could
notice?

Signed-off-by: Miloslav Trmač <mitr@redhat.com>

Closes: #1176
Approved by: rhatdan
2018-08-01 18:22:59 +00:00
Miloslav Trmač 5507f15ba5 Replace Runtime.LoadFromArchive with Runtime.LoadFromArchiveReference
All callers of LoadFromArchive expect the input to be in the
transport:name format, or create it that way.  So, pass a
types.ImageReference instead of a string.

That requires us to add an explicit parse step in (podman pull);
in (podman load) we can, instead of pasting strings, create
native objects directly.

Changes the error behavior of (podman pull), we no longer
try heuristically parsing docker-archive:... inputs as
Docker references.

Also changes the string reported by (podman load) if all parsing
attempts fail, to be only the path instead of dir:path.  The error
message itself is likely to be the same (from directory.Transport).

(While at it, update a mismatched comment.)

Signed-off-by: Miloslav Trmač <mitr@redhat.com>

Closes: #1176
Approved by: rhatdan
2018-08-01 18:22:59 +00:00
Miloslav Trmač 04f3a9079c Rename the "image" variable to "imageName"
... so that it does not shadow the libpod/image module.

Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>

Closes: #1176
Approved by: rhatdan
2018-08-01 18:22:59 +00:00
Miloslav Trmač 85cb582f86 Fix the heuristic for docker-archive: sources in (podman pull)
Instead of searching for "docker-archive" anywhere in the input,
only accept it at the start, and require the colon separator as well.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>

Closes: #1176
Approved by: rhatdan
2018-08-01 18:22:59 +00:00
Miloslav Trmač 558a1bd776 Split doPullImage from pullImage
Now that we have a pullGoal, separate determination of the goal from
performing it; we will then introduce another entry point with
a supplied types.ImageReference.

Also remove or correct some misleading comments.

Should not change behavior (but does not add unit tests).

Signed-off-by: Miloslav Trmač <mitr@redhat.com>

Closes: #1176
Approved by: rhatdan
2018-08-01 18:22:59 +00:00
Miloslav Trmač 7f5efd8d04 Remove the forceCompress parameter from getCopyOptions and DRO.GetSystemContext
Use the parent types.SystemContext data instead.

Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>

Closes: #1176
Approved by: rhatdan
2018-08-01 18:22:59 +00:00
Miloslav Trmač b63b84ea5e Remove the authFile parameter from getCopyOptions and DRO.GetSystemContext
Use the parent types.SystemContext data instead.

Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>

Closes: #1176
Approved by: rhatdan
2018-08-01 18:22:59 +00:00
Miloslav Trmač 444142c7c1 Remove the signaturePolicyPath parameter from getCopyOptions and DRO.GetSystemContext
Use the parent types.SystemContext data instead.

Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>

Closes: #1176
Approved by: rhatdan
2018-08-01 18:22:59 +00:00