1013 Commits

Author SHA1 Message Date
44d1c1c631 Merge pull request #834 from mheon/bump_0_5_4
Bump 0 5 4
2018-05-25 13:54:33 -04:00
a9f200065c Bump gitvalidation epoch
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-05-25 13:49:19 -04:00
70672652b6 Bump to v0.6.1-dev
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-05-25 13:48:56 -04:00
1f2e2a25bf Bump to v0.5.4
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
v0.5.4
2018-05-25 13:46:50 -04:00
1930f5d709 Vendor in latest projectatomic/buildah
buildah fixed its probelm where it was not pulling in
the ENV of the base image. This pulls that change into
libpod as well.

Signed-off-by: umohnani8 <umohnani@redhat.com>

Closes: #832
Approved by: mheon
2018-05-25 17:03:09 +00:00
8fcf1aaa29 Rename addFIPSsModeSecret to addFIPSModeSecret
Signed-off-by: Jhon Honce <jhonce@redhat.com>

Closes: #833
Approved by: mheon
2018-05-25 16:37:34 +00:00
de13777e71 Make references to the Process part of Spec conditional
The OCI runtime spec does not require Process to be passed (IE,
it can be nil). Make most of our references to it conditional on
it existing.

Signed-off-by: Matthew Heon <mheon@redhat.com>

Closes: #828
Approved by: mheon
2018-05-25 15:32:47 +00:00
c8b72e57a7 save and load should support multi-tag for docker-archive
The docker-archive tar files can have multiple tags for the same
image stored in it. Load pulls all the tags found in the archive
when loading a tar file. Save can oush multiple tags of the same
image to a tar archive.

Signed-off-by: umohnani8 <umohnani@redhat.com>

Closes: #819
Approved by: rhatdan
2018-05-25 15:15:47 +00:00
0a4ade1c17 Implement python podman create and start
- Added alias 'container()' to image model for CreateContainer()
- Fixed return in containers_create.go to wrap error in varlink
  exception
- Added a wait time to container.kill(), number of seconds to wait
  for the container to change state
- Refactored cached_property() to use system libraries
- Refactored tests to speed up performance

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

Closes: #821
Approved by: rhatdan
2018-05-25 09:31:21 +00:00
684b544e9c Spell check strings and comments
Signed-off-by: Jhon Honce <jhonce@redhat.com>

Closes: #831
Approved by: rhatdan
2018-05-25 08:45:15 +00:00
a7180cd545 hooks/1.0.0: Error on empty process.args instead of panicking
The process property is optional [1], which this package already
handled appropriately, although I've added a new test here to guard
against regressions.

The process.args entry is required when process is set [2], and it's
also required to contain at least one entry [3].  The previous
implementation here assumed that would always be satisfied, and
panicked on empty process.args.  With this commit, we avoid the panic
and instead return an error message explaining why the input was
invalid.

[1]: https://github.com/opencontainers/runtime-spec/blame/v1.0.1/config.md#L145
[2]: https://github.com/opencontainers/runtime-spec/blame/v1.0.1/config.md#L157
[3]: https://github.com/opencontainers/runtime-spec/blame/v1.0.1/config.md#L158

Reported-by: Brent Baude <bbaude@redhat.com>
Signed-off-by: W. Trevor King <wking@tremily.us>

Closes: #829
Approved by: mheon
2018-05-24 21:27:05 +00:00
b09fca74af Set Entrypoint from image only if not already set
Signed-off-by: Matthew Heon <mheon@redhat.com>

Closes: #827
Approved by: rhatdan
2018-05-24 17:36:37 +00:00
915364034f Update podman build to match buildah bud functionality
Add --label, --annotations, --idfile, --squash

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

Closes: #824
Approved by: TomSweeneyRedHat
2018-05-23 22:38:17 +00:00
d252fa710e Fix test_runner call of podman varlink
- Updated some tests due to slippage between tests and code
- Skipped tests will be reinstated in a separate PR

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

Closes: #825
Approved by: rhatdan
2018-05-23 19:46:23 +00:00
05bc77f0cb Fix handling of command in images
Currently we are dropping the command entry from the create
line and using the image Cmd.  This change will only use the
image Cmd if the user did not specify a Cmd.

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

Closes: #823
Approved by: umohnani8
2018-05-23 18:39:06 +00:00
5f0d4b10e9 Add support for Zulu timestamp parsing
- Improve error message when podman varlink service is not running

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

Closes: #800
Approved by: rhatdan
2018-05-23 17:54:09 +00:00
c1efde20e0 Clarify using podman build with a URL, Git repo, or archive.
Signed-off-by: Joe Doss <joe@solidadmin.com>

Closes: #822
Approved by: rhatdan
2018-05-23 17:40:25 +00:00
926d07d0aa Vendor in latest container/storage for devicemapper support
container/storage now supports devicemapper options that allow you to
configure it.

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

Closes: #808
Approved by: mheon
2018-05-22 16:20:25 +00:00
ae7c45968d set varlink timeout to 1 seconds
Add option to varlink for --timeout.  Input for this option is in milliseconds

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

Closes: #814
Approved by: baude
2018-05-22 13:50:10 +00:00
82feafecdd podman create, start, getattachsocket
First pass at implement API endpoints for create and start.

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

Closes: #805
Approved by: baude
2018-05-21 19:26:56 +00:00
687b165a73 use $GO env-var instead of hard-coded go binary
Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>

Closes: #817
Approved by: TomSweeneyRedHat
2018-05-21 17:53:07 +00:00
390bd16d37 tidy up the copr spec
on os's (like centos) where python3 might not be installed, do not attempt to build
the python3 varlink client.  varlink python is only supported on python3.

also, change the conditions for f28 to match the fedora official specs.

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

Closes: #813
Approved by: baude
2018-05-21 17:19:14 +00:00
ca1c6ef5be honor multiple change values
In the case where changes are made to Env, Expose, Volumes, or labels, we should
honor that multiple values are valid.

Resolves: #795

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

Closes: #815
Approved by: mheon
2018-05-21 16:13:16 +00:00
31e3a50ddd hooks/README: Fix some Markdown typos (e.g. missing runc target)
I'd accidentally introduced these typos in ea415610 (hooks/docs: Add
oci-hooks.5 and per-package man page building, 2018-05-15, #772).

Signed-off-by: W. Trevor King <wking@tremily.us>

Closes: #810
Approved by: mheon
2018-05-21 14:09:25 +00:00
fb628380a2 oci-hooks.5: Discuss directory precedence and monitoring
We've had this functionality since 68eb128f (pkg/hooks: Version the
hook structure and add 1.0.0 hooks, 2018-04-27, #686), but didn't have
any user-facing docs for it.

Signed-off-by: W. Trevor King <wking@tremily.us>

Closes: #811
Approved by: mheon
2018-05-21 13:36:17 +00:00
9fe179b1ee Merge pull request #809 from baude/changevarlinkpath
finish changing the path for varlink
2018-05-19 10:34:46 -05:00
3f6a739ede finish changing the path for varlink
cleanup the last references to /run/io.projectatomic... and make sure
/run/podman/projectatomic... is used.

Signed-off-by: baude <bbaude@redhat.com>
2018-05-19 10:00:52 -05:00
9d7c50aa03 Tighten the security on the podman varlink socket
We only want root to be allowed to access this socket.
Also move socket to /run/podman directory.  This requires
us to drop a podman.conf tmpfiles.d file.

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

Closes: #806
Approved by: mheon
2018-05-19 07:47:03 +00:00
4b804e8516 Implement podman.containers.commit()
- Add API support
- Update tests
- Make changes from reviews

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

Closes: #798
Approved by: mheon
2018-05-18 21:08:21 +00:00
228c71b1da Merge pull request #803 from mheon/bump_0_5_3
Bump to v0.5.3
2018-05-18 12:43:05 -04:00
133df588a6 Update gitvalidation epoch
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-05-18 12:42:09 -04:00
2b7ba84ae1 Bump to v0.5.4-dev
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-05-18 12:41:08 -04:00
dc3f9df0b3 Bump to v0.5.3
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
v0.5.3
2018-05-18 12:40:16 -04:00
bbc522be8e remove hooks files reference and no varlink-python on f27 or epel
Signed-off-by: baude <bbaude@redhat.com>

Closes: #802
Approved by: baude
2018-05-18 15:12:52 +00:00
a9e2373f18 contrib/spec/podman.spec.in: Drop README-hooks
I'd tried to drop it here with ea415610 (hooks/docs: Add oci-hooks.5
and per-package man page building, 2018-05-15, #772), but had missed
the reference added in 796d6c89 (Add python3 package to podman,
2018-05-17, #791) when rebasing around that package.  With this
commit, I'm killing it again ;).

Signed-off-by: W. Trevor King <wking@tremily.us>

Closes: #801
Approved by: rhatdan
2018-05-18 14:59:49 +00:00
c54b423cb3 troubleshooting: Add console syntax highlighting
These blocks include both shell input and command output.  GitHub uses
Linuguist for syntax highlighting [1].  Linguist defines a
ShellSession language to highlight those [2], although I prefer the
shorter 'console' alias.

This commit also makes this file more consistent about including the
leading prompt and sudo.

I'd also be fine using the traditional '#' prompt for privileged users
instead of '$ sudo', to be less opinionated about *how* the user
acquires the privileges (via sudo or otherwise).  Linguist's
shell-session grammar is from Atom [3], and that grammar recognizes
any of >$#% as the final prompt character [4].  But I've left this
facet alone for now.

[1]: https://help.github.com/articles/creating-and-highlighting-code-blocks/#syntax-highlighting
[2]: https://github.com/github/linguist/blob/v6.1.0/lib/linguist/languages.yml#L4362-L4373
[3]: https://github.com/github/linguist/blame/v6.1.0/vendor/README.md#L335
[4]: https://github.com/atom/language-shellscript/blob/v0.26.3/grammars/shell-session.cson#L22

Signed-off-by: W. Trevor King <wking@tremily.us>

Closes: #796
Approved by: rhatdan
2018-05-18 00:11:10 +00:00
3f8587926a Fix typo
Signed-off-by: Peter Oliver <git@mavit.org.uk>

Closes: #792
Approved by: rhatdan
2018-05-17 23:41:18 +00:00
18f9e8d94f Refresh pods when refreshing podman state
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #784
Approved by: rhatdan
2018-05-17 23:10:12 +00:00
7e1ea9d26d Add per-pod CGroups
Pods can now create their own (cgroupfs) cgroups which containers
in them can (optionally) use.

This presently only works with CGroupFS, systemd cgroups are
still WIP

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #784
Approved by: rhatdan
2018-05-17 23:10:12 +00:00
018d2c6b1d Add pod state
Add a mutable state to pods, and database backend sutable for
modifying and updating said state.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #784
Approved by: rhatdan
2018-05-17 23:10:12 +00:00
c45d4c6d5c hooks: Fix monitoring of multiple directories
This isn't an issue with podman, which will only ever use one
directory.  But CRI-O generally uses two directories, and we want to
make sure that changes to the fallback directory are not clobbering
hooks configured in the override directory.  More background in [1].

I've split the handling into a single-directory block and a
multiple-directory block so we don't waste time polling the filesystem
for single-directory removals.

I'm using the single-directory block for the the zero-directory case
as well.  Managers with zero directories should not be receiving
fsnotify events, so I don't think it really matters which block
handles them.  If we want to handle this case robustly (because we're
concerned about something in the hook package adjusted the private
.directories property on the fly?), then we'll probably want to add an
explicit zero-directory block in future work.

[1]: https://github.com/kubernetes-incubator/cri-o/pull/1470

Signed-off-by: W. Trevor King <wking@tremily.us>

Closes: #757
Approved by: rhatdan
2018-05-17 22:39:13 +00:00
4704c138ae Merge pull request #797 from baude/coprhooks2
make sure hooks are renamed for copr spec
2018-05-17 15:58:26 -05:00
ca528d80c1 make sure hooks are renamed for copr spec
Signed-off-by: baude <bbaude@redhat.com>
2018-05-17 15:57:34 -05:00
20bceb787d Use container cleanup() functions when removing
Instead of manually calling the individual functions that cleanup
uses to tear down a container's resources, just call the cleanup
function to make sure that cleanup only needs to happen in one
place.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #790
Approved by: rhatdan
2018-05-17 18:55:59 +00:00
92a9f3a212 docs/podman.1: Link to hook documentation
Collecting the Podman/libpod specifics in one place allows us use the
hooks documentation which the previous commit made more generic.

The re-ordered SEE ALSO is because [1]:

> The list should be ordered by section number and then alphabetically
> by name.

[1]: http://man7.org/linux/man-pages/man7/man-pages.7.html

Signed-off-by: W. Trevor King <wking@tremily.us>

Closes: #772
Approved by: mheon
2018-05-17 18:22:10 +00:00
ea4156108d hooks/docs: Add oci-hooks.5 and per-package man page building
This allows us to reference the hooks docs from podman(1) in a way
that will survive system installation.  The downside is that the
GitHub rendered pages become less usable, now that we can no longer
embed links as freely as we could before.

I've followed the "Sections within a manual page" suggestions from
[1].

locale(7) is [2], which is Linux-specific.  Even section numbering is
platform-dependent [3], so it's unlikely that these external man
references are particularly portable.  Platform packagers can adjust
our local references to match their target system, but that leaves the
GitHub rendering in an awkward place.  For now, I think a
Linux-centric GitHub rendering without clickable links may be the best
we can do without moving away from go-md2man.

As far as I can tell, there's not a nice way to get go-md2man to wrap
the links in SEE ALSO without sometimes hyphenating a URL (which makes
it harder for man-page readers to copy/paste those links into their
browser).

I've also fixed some "extention" -> "extension" typos.

[1]: http://man7.org/linux/man-pages/man7/man-pages.7.html
[2]: http://man7.org/linux/man-pages/man7/locale.7.html
[3]: https://en.wikipedia.org/wiki/Man_page#Manual_sections

Signed-off-by: W. Trevor King <wking@tremily.us>

Closes: #772
Approved by: mheon
2018-05-17 18:22:10 +00:00
3b02a131cd Add Troubleshooting guide
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

Closes: #793
Approved by: mheon
2018-05-17 17:48:51 +00:00
e686269da3 chrootuser: default to GID 0 when given a numeric --user
When we're given a numeric --user value, default to GID 0 if the numeric
ID doesn't correspond to a user entry in /etc/passwd that can provide us
with the user's primary group ID.

Make sure that GetAdditionalGroupsForUser() returns wrapped errors.

Also test various user:group forms.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>

Closes: #728
Approved by: mheon
2018-05-17 17:05:44 +00:00
796d6c894a Add python3 package to podman
Signed-off-by: baude <bbaude@redhat.com>

Closes: #791
Approved by: mheon
2018-05-17 17:03:16 +00:00
3f0e2367c2 libpod: fix panic when using -t and the process fails to start
We were closing resize both on the receiver and the sender side.
This was racy as the sender might have written to a closed channel.
If the container could not be created, the attach exited
immediately causing the channel to be closed before the write from
resizeTty.

Change the logic to close only from the senderSide and add another
channel to notify the resizeTty goroutine when the container exited.

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

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

Closes: #787
Approved by: mheon
2018-05-17 13:26:16 +00:00