1305 Commits

Author SHA1 Message Date
8569ed0305 AppArmor: runtime check if it's enabled on the host
Check at runtime if AppArmor is enabled on the host.

Signed-off-by: Valentin Rothberg <vrothberg@suse.com>

Closes: #1128
Approved by: mheon
2018-07-23 18:11:09 +00:00
2c11e38b24 Add format descriptors infor to podman top
Trying to play with podman top, I had a hard time
finding info on format options.

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

Closes: #1134
Approved by: umohnani8
2018-07-23 17:02:12 +00:00
8f48e60840 Fix error handling in pod start/stop.
Before, errors in containers would never be printed, and a generic error would only be shown.

Signed-off-by: haircommander <pehunt@redhat.com>

Closes: #1132
Approved by: mheon
2018-07-23 14:22:07 +00:00
acd28b9fc9 docs/podman-top: fix typo and whitespace
Signed-off-by: Valentin Rothberg <vrothberg@suse.com>

Closes: #1131
Approved by: mheon
2018-07-23 13:34:19 +00:00
8ff0eb53cb Use the result of reference.Parse when checking for digests.
No need to do a separate string search when reference.Parse has already
determined this.

Changes behavior: non-SHA256 digest formats are now recognized as well.

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

Closes: #1112
Approved by: rhatdan
2018-07-23 12:44:38 +00:00
38842bd407 Make refNamesFromPossiblyUnqualifiedName independent from Image
... which finally makes it very easy to add comprehensive tests; so do that.

Should not change behavior.

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

Closes: #1112
Approved by: rhatdan
2018-07-23 12:44:38 +00:00
3b964a4d9a Make Image.HasShaInInputName to an independent local function
The functionality only depends on Image.InputName, and we will want
to make the only user of this independent of the fairly complex Image type.

Should not change behavior.

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

Closes: #1112
Approved by: rhatdan
2018-07-23 12:44:38 +00:00
347ba2cc25 Split createNamesToPull into ref{Names,Pairs}FromPossiblyUnqualifiedName
One part creates []*pullRefName; the other just trivially converts it
into []*pullRefPair.

Also use much more explicit names to explain the functionality.

Should not change behavior.

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

Closes: #1112
Approved by: rhatdan
2018-07-23 12:44:38 +00:00
b500f9275e Rename local variables in Runtime.pullRefPairsFromRefNames
... to be more conventional.

Should not change behavior.

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

Closes: #1112
Approved by: rhatdan
2018-07-23 12:44:38 +00:00
4e285b52c1 Split Runtime.pullRefPairsFromRefNames from Image.createNamesToPull
This will have another user shortly.

Should not change behavior.

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

Closes: #1112
Approved by: rhatdan
2018-07-23 12:44:38 +00:00
e20409d427 Rename nameToPull to pullRefName
We will use it not only in createNamesToPull, but also in
getPullListFromRef soon.

Should not change behavior.

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

Closes: #1112
Approved by: rhatdan
2018-07-23 12:44:38 +00:00
de4a41d821 Rename pullStruct to pullRefPair
"Struct" is meaningless, and we will need the "reference pair"
mentioned to distinguish srcRef+dstRef from srcRef+dstName.

Should not change behavior.

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

Closes: #1112
Approved by: rhatdan
2018-07-23 12:44:38 +00:00
729e72ef48 Replace optional nameToPull.shaPullName with mandatory dstName
This consolidates the shaPullName logic into a single place,
(and eliminates the unclear shaPullName member name completely).
The resulting nameToPull will shortly be more generally useful.

Should not change behavior.

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

Closes: #1112
Approved by: rhatdan
2018-07-23 12:44:38 +00:00
775eb78f6b Introduce nameToPull, move shaPullName in there
shaPullName is only used internally in createNamesToPull; so, introduce
a nameToPull as a variant of pullStruct which has shaPullName (and does not
have destRef).

Eventually, we want to split pullStruct preparation into easily-testable
store-independent name preparation, and a store-dependent and difficult-to-test
but trivial conversion using StorageTransport.ParseStoreReference.

Should not change behavior.

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

Closes: #1112
Approved by: rhatdan
2018-07-23 12:44:38 +00:00
70589c326c Split normalizeTag from Image.TagImage
... so that it can be tested without side effects, and add the tests.

Should not change behavior.

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

Closes: #1112
Approved by: rhatdan
2018-07-23 12:44:38 +00:00
501acd460e Remove Image.isShortName
It has no users, and it depends on the incorrect imageParts.hasRegistry.
So, just drop it instead of worrying whether it is OK to change its semantics.

Should not change behavior.

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

Closes: #1112
Approved by: rhatdan
2018-07-23 12:44:38 +00:00
014b3dcc35 Inline getTags into its only user
This also eliminates a duplicate call to reference.Parse() and
removes an impossible erorr path.

Should not change behavior.

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

Closes: #1112
Approved by: rhatdan
2018-07-23 12:44:38 +00:00
e8bc914134 Add unit tests for imageParts
Signed-off-by: Miloslav Trmač <mitr@redhat.com>

Closes: #1112
Approved by: rhatdan
2018-07-23 12:44:38 +00:00
eb17182ecf Add OnBuild and usernamespace test to baseline
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

Closes: #1127
Approved by: mheon
2018-07-23 12:38:17 +00:00
eee0e97deb Merge pull request #1124 from mheon/bump-0.7.3
Bump to 0.7.3
2018-07-20 14:11:29 -04:00
64f594279c Bump gitvalidation epoch
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-07-20 14:06:46 -04:00
7476efe565 Bump to v0.7.4-dev
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-07-20 14:06:45 -04:00
0791210563 Bump to v0.7.3
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
v0.7.3
2018-07-20 14:06:44 -04:00
72c82fb79e Merge pull request #1117 from haircommander/pod-start-stop1
Add pod start and stop
2018-07-20 13:50:54 -04:00
1bb6e5f0d8 Merge pull request #1121 from mheon/bump_psgo
Update psgo vendor
2018-07-20 13:46:43 -04:00
15a1e9c951 Merge pull request #1120 from haircommander/pod-ps-status-hotfix
Pod ps now uses pod.Status()
2018-07-20 13:26:09 -04:00
6cae4a0e94 Merge pull request #1103 from haircommander/load_dockerless
Podman load/tag/save prepends localhost when no registry is present
2018-07-20 12:50:18 -04:00
17b1764fb8 Update psgo vendor
Signed-off-by: Matthew Heon <mheon@redhat.com>
2018-07-20 12:34:51 -04:00
7944bca468 Merge pull request #1104 from rhatdan/mounting
Let containers/storage keep track of mounts
2018-07-20 12:31:32 -04:00
d433e56124 Merge pull request #1099 from giuseppe/per-user-conf-files
rootless: allow to override configuration files
2018-07-20 12:29:04 -04:00
0fecfeee63 Podman load/tag/save prepend localhost when no repository is present
Instead of having docker.io/library as its repository. Test included.

Signed-off-by: haircommander <pehunt@redhat.com>
2018-07-20 11:46:11 -04:00
7716628e6f Pod ps now uses pod.Status()
It used to call ctr.State() to figure out what the pod status was, which certainly locked/unlocked excessively. Status now uses the libpod/pod function that bypasses this.

Signed-off-by: haircommander <pehunt@redhat.com>
2018-07-20 11:38:54 -04:00
17f257140e Added pod start and stop
As well as added tests, man pages, and completions.
Also reformatted and refactored a couple of other small things in the other pod commands.

Signed-off-by: haircommander <pehunt@redhat.com>
2018-07-20 08:44:44 -04:00
d4f14be3a7 rootless: support a per-user mounts.conf
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-07-20 11:00:53 +02:00
45a92f8357 secrets: parse only one mounts configuration file
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-07-20 11:00:53 +02:00
c737d01937 rootless: allow a per-user registries.conf file
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-07-20 11:00:52 +02:00
06a5cc41bf pull: get registries using the registries pkg
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-07-20 11:00:51 +02:00
067ae31095 rootless: allow a per-user storage.conf file
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-07-20 11:00:50 +02:00
c17f8f664c rootless, docs: document the libpod.conf file used in rootless mode
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-07-20 11:00:49 +02:00
85db3f09bf Let containers/storage keep track of mounts
Currently we unmount storage that is still in use.
We should not be unmounting storeage that we mounted
via a different command or by podman mount. This
change relies on containers/storage to umount keep track of
how many times the storage was mounted before really unmounting
it from the system.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2018-07-19 17:01:07 -04:00
ba1871dac0 podman-top: use containers/psgo
Use github.com/containers/psgo instead of execing `ps (1)`.  The psgo
library enables a much more flexible interface with respect to which
data to be printed (e.g., capabilities, seccomp mode, PID, PCPU, etc.)
while the output can be parsed reliably.  The library does not use
ps (1) but parses /proc and /dev instead.  To list the processes of a
given container, psgo will join the mount namespace of the given
container and extract all data from there.

Notice that this commit breaks compatibility with docker-top.

Signed-off-by: Valentin Rothberg <vrothberg@suse.com>

Closes: #1113
Approved by: rhatdan
2018-07-19 20:47:52 +00:00
98703eb204 Vendor in latest code for storage,image, buildah
vendor in containers/storage
vendor in containers/image
vendor in projectatomic/buildah

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

Closes: #1114
Approved by: mheon
2018-07-19 18:43:32 +00:00
c020db8cd2 Abort a test on nil containers, so that future tests don't panic
Signed-off-by: Miloslav Trmač <mitr@redhat.com>

Closes: #1111
Approved by: baude
2018-07-19 16:12:49 +00:00
cedb4576a4 Fix TestPostDeleteHooks on macOS
os.TempDir() is /var/folders/.../T/ on macOS, not /tmp.

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

Closes: #1111
Approved by: baude
2018-07-19 16:12:49 +00:00
930660c36b Use ... for a regexp constant to improve readability
Should not change behavior.

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

Closes: #1111
Approved by: baude
2018-07-19 16:12:48 +00:00
6997db694a Merge pull request #1107 from lberk/patch-1
[trivial] - fix typo in transfer.md
2018-07-19 10:15:33 -04:00
9ae7b1a5b1 oci: keep exposed ports busy and leak the fd into conmon
Bind all the specified TCP and UDP ports so that another process
cannot reuse them.  The fd of the listener is then leaked into conmon
so that the socket is kept busy until the container exits.

Closes: https://github.com/projectatomic/libpod/issues/210

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

Closes: #1100
Approved by: mheon
2018-07-19 13:21:50 +00:00
4a6f79b62b Dockerfile: install nmap-ncat
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #1100
Approved by: mheon
2018-07-19 13:21:50 +00:00
4692f3ab32 Update podman_tutorial.md
Fix the familiarizing-yourself-with-podman link.

Signed-off-by: William Zhang <warmchang@outlook.com>

Closes: #1108
Approved by: rhatdan
2018-07-18 15:23:22 +00:00
5f3d6a0222 Update transfer.md
Fix errant ']' in formatting

Signed-off-by: Lukas Berk <lberk@redhat.com>
2018-07-18 10:33:03 -04:00