Commit Graph

2115 Commits

Author SHA1 Message Date
Giuseppe Scrivano 64d8b4eebb
podman: implement userns=keep-id
add missing implementation for userns=keep-id and enable the user
namespaces tests.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-04-24 15:03:50 +02:00
Giuseppe Scrivano 3eeb03d1f9
podman: fix --log-opt=path=%s
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-04-24 13:02:07 +02:00
Giuseppe Scrivano 145d74716c
podman: fix --http-proxy
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-04-24 12:56:24 +02:00
Giuseppe Scrivano a1f73d0954
podman: fix podman --group-add
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-04-24 12:56:23 +02:00
Giuseppe Scrivano 2e6a62fc38
podman: fix --cgroups=disabled
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-04-24 12:56:21 +02:00
Giuseppe Scrivano a3acc4f977
podman: add support for --rootfs
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-04-24 12:56:20 +02:00
OpenShift Merge Robot 802763c604
Merge pull request #5933 from giuseppe/fix-namespaces
podman, v2: handle namespaces specified on the CLI
2020-04-23 19:32:08 +02:00
OpenShift Merge Robot e5a3e46746
Merge pull request #5946 from jwhonce/wip/shutdown
V2 restore libpod.Shutdown() when exiting podman commands
2020-04-23 18:27:32 +02:00
Giuseppe Scrivano 48530acbd9
podman: handle namespaces specified on the CLI
and handle differently the user namespace as it supports additional
options.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-04-23 18:05:03 +02:00
Giuseppe Scrivano 2fd6a84c09
specgen: do not always set shmsize
if it wasn't overriden on the CLI, leave it undefined.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-04-23 18:05:02 +02:00
OpenShift Merge Robot 397dcc358a
Merge pull request #5843 from QiWang19/manifest_create
manifest create,add,inspect
2020-04-23 17:45:38 +02:00
Qi Wang 17783dda68 manifest create,add,inspect
Implememts manifest subcommands create, add, inspect.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-04-22 20:05:21 -04:00
OpenShift Merge Robot bf1e5b875f
Merge pull request #5942 from mheon/volume_flags
Enable basic volumes support in Podmanv2
2020-04-22 23:27:07 +02:00
Jhon Honce 565f93531e V2 restore libpod.Shutdown() when exiting podman commands
Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-04-22 14:25:40 -07:00
OpenShift Merge Robot 576fe98bbc
Merge pull request #5930 from jwhonce/issues/5765
Instrumentation to answer #5765
2020-04-22 21:29:10 +02:00
Daniel J Walsh ae1731e03f
Fix podman push and podman pull to check for authfile
This fixes pull_test.go push_test.go is still broken because of
lack of registry support.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-04-22 14:30:40 -04:00
Matthew Heon b4a4338dfe Enable basic volumes support in Podmanv2
This enables the --volume, --mount, and --tmpfs flags in
Podmanv2. It does not enable init-related flags, image volumes,
and --volumes-from.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-04-22 14:24:12 -04:00
OpenShift Merge Robot 366fc0520b
Merge pull request #5941 from jwhonce/jira/792
V2 Restore exists E2E tests
2020-04-22 20:22:44 +02:00
Jhon Honce d7a27b8e84 Instrumentation to answer #5765
* currently wired to localhost:8888 to prevent access from off machine

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-04-22 11:07:28 -07:00
Jhon Honce d0caf90940 V2 Restore exists E2E tests
* Fix setting exit code in */exists.go

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-04-22 09:53:05 -07:00
Daniel J Walsh 1be8ded964
Fix podman rm to have correct exit codes
If you attempt to remove a running container is it supposed to exit with
2
If you attempt to remove a non existing container is is supposed to exit with
1

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-04-22 11:53:00 -04:00
Daniel J Walsh 94b62dac74
Fix handling of --cidfile on create/run
Currently create and run are ignoring the cidfile flag.

Enable stop_test.go to make sure this works.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-04-22 09:52:33 -04:00
OpenShift Merge Robot 1ad978a3d7
Merge pull request #5919 from rhatdan/v2
Lots more fixes for V2 conversion.
2020-04-21 16:53:53 -04:00
OpenShift Merge Robot ba1b5d4559
Merge pull request #5851 from jwhonce/wip/json
Provide a json variable pointing to a configured json API
2020-04-21 16:13:06 -04:00
Daniel J Walsh bc56236102
Handle hostname flag from client
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-04-21 16:02:11 -04:00
Daniel J Walsh 592e7867a3
Add support for devices from command line
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-04-21 16:02:11 -04:00
Daniel J Walsh 9d7b5947b9
Fix handling of CGroupsParent and CGroupsMode
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-04-21 16:00:45 -04:00
Daniel J Walsh f7fe424e19
Throw error on IPv6 ip addresses
Podman does not currently support IPv6 addresses.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-04-21 16:00:45 -04:00
Matthew Heon 1cd2b746d0 Modify namespace generation code for specgen
Namespaces have now been changed to properly handle all cases.
Spec handling code for namespaces was consolidated in a single
function.

Still missing:
- Image ports
- Pod namespaces likely still broken in Podmanv2

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-04-21 14:38:52 -04:00
OpenShift Merge Robot 2ed4a0e35f
Merge pull request #5917 from vrothberg/v2-login-logout
v2: implement log{in,out}
2020-04-21 14:28:09 -04:00
OpenShift Merge Robot 0134999034
Merge pull request #5911 from giuseppe/cgroup-skip-unset
podman: do not set empty cgroup limit blocks
2020-04-21 14:20:58 -04:00
OpenShift Merge Robot b879ccbb73
Merge pull request #5923 from baude/mybad
my bad
2020-04-21 14:00:00 -04:00
Brent Baude 860356970b my bad
typos in previous pr are causing panics

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-21 10:46:23 -05:00
Jhon Honce b21a5b7ff4 Provide a json variable pointing to a configured json API
* All commands now using the same instance of json API
* `json` variable created in each package to prevent `encoding/json`
  from being re-introduced

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-04-21 07:56:10 -07:00
Brent Baude 29ec539b3f podmanv2 cp
enable podman to copy files between container and host, local mode only. this is a straight port of v1 code to v2.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-21 09:23:27 -05:00
OpenShift Merge Robot f4c2eb1d9d
Merge pull request #5908 from baude/v2subs
podmanv2 container subcommands
2020-04-21 10:20:56 -04:00
Brent Baude 10efa1d90f podmanv2 container subcommands
add container subcommands with example text that has proper context.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-21 08:39:54 -05:00
Brent Baude ae5e7e7e78 v2podman port
add port command to podman.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-21 08:33:15 -05:00
Valentin Rothberg 0138ecfba0 v2: implement log{in,out}
Implement podman login and logout.  Smoke tests were successful but the
system tests are currently failing as we seem unable to run a registry
at the moment.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-04-21 15:10:31 +02:00
OpenShift Merge Robot 08823e7383
Merge pull request #5913 from rhatdan/v2
More fixes for podman create tests
2020-04-21 07:54:39 -04:00
Giuseppe Scrivano 46384a6189
podman: do not set empty cgroup limit blocks
refactor cgroup limits in their own function.  If there are no limits
set avoid to set the block.  Basic rootless containers work now.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-04-21 11:42:24 +02:00
OpenShift Merge Robot 47d99fb625
Merge pull request #5647 from rhatdan/containers.conf
Update podmanV2 to use containers.conf
2020-04-21 05:21:09 -04:00
Daniel J Walsh 64f774866a
Need to set the Entrypoint
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-04-21 05:18:39 -04:00
Daniel J Walsh fc76fbf945
Fix podman inspect to return errors on failure
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-04-21 05:18:16 -04:00
OpenShift Merge Robot 8884f6a4f3
Merge pull request #5875 from rhatdan/network
Cleanup network option parsing
2020-04-21 05:09:54 -04:00
Valentin Rothberg 09dc701097 podman rmi: refactor logic
While this commit was initially meant to fix #5847, it has turned into a
bigger refactoring which I did not manage to break into smaller pieces:

 * Fix #5847 by refactoring the image-removal logic.

 * Make the api handler for image-removal use the ABI code. This way,
   both (i.e., ABI and Tunnel) end up using the same code.  Achieving
   this code share required to move some code around to prevent circular
   dependencies.

 * Everything in pkg/api (excluding pkg/api/types) must now only be
   accessed from code using `ABISupport`.

 * Avoid imports from entities on handlers to prevent circular
   dependencies.

 * Move `podman system service` logic into `cmd` to prevent circular
   dependencies - it depends on pkg/api.

 * Also remove the build header from infra/abi files.  It will otherwise
   confuse swagger and other tools; errors we cannot fix as go doesn't
   expose a build-tag env variable.

Fixes: #5847
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-04-21 08:12:25 +02:00
OpenShift Merge Robot b771467224
Merge pull request #5862 from rhatdan/v2
Fix up handling of image data as well as setting Linux Capabilties correctly
2020-04-20 17:19:32 -04:00
OpenShift Merge Robot 1e9b3e7500
Merge pull request #5899 from jwhonce/wip/tree
V2 podman image tree
2020-04-20 16:37:38 -04:00
OpenShift Merge Robot 37365b166d
Merge pull request #5901 from jwhonce/wip/service
V2 Remove existing unix domain socket on startup
2020-04-20 16:17:42 -04:00
Daniel J Walsh e62d081770
Update podman to use containers.conf
Add more default options parsing

Switch to using --time as opposed to --timeout to better match Docker.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-04-20 16:11:36 -04:00
Daniel J Walsh b35a0d0cd2
Fix podman inspect to accept -l and -s fields
Podman inspect has a breaking change in that it dropped
--latest and --size options.

This PR adds these back.  Lots of tests rely on
podman inspect -l.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-04-20 15:52:46 -04:00
Daniel J Walsh eb101936e6
Handle Linux Capabilities correctly
If user sets capabilities list we need handle minimal capabilities.

Also handle seccomp-policy being passed in.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-04-20 15:50:46 -04:00
OpenShift Merge Robot 5928e8fe80
Merge pull request #5896 from giuseppe/fix-cgroup-set
common: setting cgroup resources correctly
2020-04-20 15:50:02 -04:00
OpenShift Merge Robot 80355b168c
Merge pull request #5897 from jwhonce/wip/diff
V2 Fix --latest for podman diff commands
2020-04-20 15:23:21 -04:00
Jhon Honce 405e39b0d6 V2 Rmove existing unix domain socket on startup
Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-04-20 11:52:47 -07:00
OpenShift Merge Robot 06152434e6
Merge pull request #5879 from rhatdan/pull
Pull images when doing podman create
2020-04-20 13:18:59 -04:00
Jhon Honce 9cd6bba5d5 V2 podman image tree
* Basic port of V1 podman image tree ID

TODO: Refactor to return tree from service and format in presentation
layer
TODO: Support tunneling mode

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-04-20 10:10:24 -07:00
Jhon Honce 3eac39aaa0 V2 Fix --latest for podman diff commands
* --latest now forces container diff
* diff options now passed into domain layer
* updated help/usage messages

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-04-20 09:27:54 -07:00
Giuseppe Scrivano 4e09c5ebb4
common: setting cgroup resources correctly
fix some cgroups related integration tests.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-04-20 17:26:53 +02:00
OpenShift Merge Robot e5e625b2a6
Merge pull request #5872 from jwhonce/wip/options
V2 Fix support for tcp://[::]<port> connections
2020-04-20 10:42:00 -04:00
Daniel J Walsh 28c336e996
Pull images when doing podman create
Currently podman create does not pull images if they don't
exist.  It should follow the pull policy specified by the
user.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-04-20 06:13:43 -04:00
Daniel J Walsh 426eccee63
Cleanup network option parsing
We were not handling the parsing of --ip.  This pr adds validation
checks and now will support the flag.

Move validation to the actual parsing of the network flags.

We should only parse the dns flags if the user changed them. We don't
want to pass default options if set in containers.conf to the server.
Potential for duplicating defaults.

Add support for --dns-opt flag passing

Begin handling of --network flag, although we don't have a way right now
to translate a string into a specgen.Namespace.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-04-19 05:19:30 -04:00
OpenShift Merge Robot e4e42b28df
Merge pull request #5733 from sujil02/v2-pod-prune
Add pod prune for api v2
2020-04-18 06:02:51 -04:00
OpenShift Merge Robot 3b461ed6eb
Merge pull request #5871 from baude/v2t3
enable integration testing
2020-04-18 05:58:21 -04:00
Brent Baude c2a1138aec enable integration testing
Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-17 18:57:40 -05:00
Jhon Honce 4e0326241b V2 Fix support for tcp://[::]<port> connections
* Fix support for socket activation, on remote and service

$ systemd-socket-activate -l 8083 --fdname=podman bin/podman system service --log-level=debug --time=30
$ bin/podman-remote --remote=tcp://[::]:8083 image ls

Or, use the podman.{socket,service} unit files

$ bin/podman-remote --remote=unix:///run/podman/podman.sock image ls

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-04-17 16:39:59 -07:00
Sujil02 37f3b191d5 Add pod prune for api v2.
Add the ability to prune pods for api v2,
Includes the addition of force flag, for client side prompt.
Update test suite to support this use case.

Signed-off-by: Sujil02 <sushah@redhat.com>
2020-04-17 17:30:58 -04:00
Daniel J Walsh 6c421b076f
We were not handling the user option on create
With this patch we can get run_passwd_test.go to pass

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-04-17 14:52:51 -04:00
OpenShift Merge Robot ba289dcd79
Merge pull request #5868 from baude/v2t2
Fixes for system tests
2020-04-17 14:43:21 -04:00
OpenShift Merge Robot a5884c07df
Merge pull request #5819 from vrothberg/v2-build
podmanV2: implement build
2020-04-17 14:30:49 -04:00
Brent Baude 44a8cf8676 Fixes for system tests
Various fixes to protect against regressions in system tests

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-17 13:22:06 -05:00
Brent Baude b6a264464f Enable some testing
Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-17 10:09:32 -05:00
Valentin Rothberg 60624f948b podmanV2: implement build
Implement `podman build` for the local client.  The remote client will
require some rather large work in the backend and a new build endpoint
for the libpod rest API.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-04-17 10:26:50 +02:00
Jhon Honce 554c663b5a Fix bug where two configurations had been created
* registry.PodmanConfig() new returns a pointer to the source of truth

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-04-16 16:49:59 -07:00
Brent Baude 241326a9a8 Podman V2 birth
remote podman v1 and replace with podman v2.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-16 15:53:58 -05:00
Jhon Honce 1d93d21254 V2 Enable rootless
* Enable running podman V2 rootless
* Fixed cobra.PersistentPreRunE usage in all the commands
* Leveraged cobra.PersistentPreRunE/cobra.PersistentPostRunE to manage:
  * rootless
  * trace (--trace)
  * profiling (--cpu-profile)
  * initializing the registry copies of Image/Container engines
* Help and Usage templates autoset for all sub-commands

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-04-16 11:08:08 -07:00
Brent Baude ba430bfe5e podman v2 remove bloat v2
rid ourseleves of libpod references in v2 client

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-16 12:04:46 -05:00
OpenShift Merge Robot c7d17613ec
Merge pull request #5827 from baude/v2bloat
v2 bloat pruning phase 2
2020-04-15 15:00:13 -07:00
OpenShift Merge Robot 0f7162d791
Merge pull request #5817 from rhatdan/selinux1
Fix up SELinux labeling
2020-04-15 14:28:53 -07:00
Brent Baude 30d2964ff8 v2 bloat pruning phase 2
this is second phase of removing unneeded bloat in the remote client. this is important to be able to reduce the client size as well as possible native compilation for windows/mac.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-15 16:09:27 -05:00
OpenShift Merge Robot 6e9622aa98
Merge pull request #5775 from sujil02/v2-container-prune
Ability to prune container in api V2
2020-04-15 13:42:36 -07:00
Daniel J Walsh ac94a96a74
Fix up SELinux labeling
SELinux label options processing fixes, should allow system tests to pass.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-04-15 16:30:03 -04:00
Sujil02 ec4060aef6 Ability to prune container in api V2
Adds ability to prune containers for v2.
Adds client side prompt with force flag and filters options to prune.

Signed-off-by: Sujil02 <sushah@redhat.com>
2020-04-15 11:17:33 -04:00
Brent Baude 165aef7766 podmanv2 events
add the ability to monitor events

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-15 09:38:04 -05:00
OpenShift Merge Robot a756161e80
Merge pull request #5813 from baude/v2edtests2
More system test fixes on regressions
2020-04-15 15:13:18 +02:00
Valentin Rothberg 123158e83b podmanV2: fix nil deref
Fix a typo when looking up a flag causing a nil deref and all commands
to fail.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-04-15 11:57:35 +02:00
Brent Baude 60dde457f6 More system test fixes on regressions
Fix more regressions between v1 and v2

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-14 19:47:49 -05:00
Jhon Honce d517276426 Add support for the global flags and config files
Note: This PR doesn't provide full rootless support that will be
      addressed in a future PR

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-04-14 14:48:37 -07:00
OpenShift Merge Robot a6caae0b5a
Merge pull request #5808 from baude/v2psformat2
v2podman ps revert structure changes
2020-04-14 18:01:18 +02:00
OpenShift Merge Robot 246ee93201
Merge pull request #5801 from baude/v2mount
podmanv2 mount and umount
2020-04-14 17:14:12 +02:00
Brent Baude 830f3a4462 v2podman ps revert structure changes
reverting name changes to the listcontainer structure because it negatively impacted the direct consumption of the restful API.  instead we now use a local structure in the CLI to modify the output as needed.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-14 09:40:43 -05:00
OpenShift Merge Robot e2a137327c
Merge pull request #5804 from rhatdan/seccomp
Need to set security options even if user does not specify options
2020-04-14 16:09:43 +02:00
Brent Baude d625aef0c5 podmanv2 mount and umount
add the ability to mount and unmount containers for the local client only

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-14 08:32:14 -05:00
OpenShift Merge Robot 85c352d8bc
Merge pull request #5709 from vrothberg/v2-search
podmanV2: implement search
2020-04-14 14:51:39 +02:00
Brent Baude d8d1aa49d2 v2podman add container init
add the ability to init a container both local and remote

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-13 19:51:20 -05:00
Daniel J Walsh 8fea3d0ab5
Need to set security options even if user does not specify options
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-04-13 17:09:22 -04:00
OpenShift Merge Robot 5cf64aee11
Merge pull request #5762 from baude/v2versionformat
podmanv2 version format variable name change
2020-04-13 22:44:17 +02:00
OpenShift Merge Robot 0b067b67e6
Merge pull request #5800 from baude/v2edtests
Fixes for load and other system tests
2020-04-13 21:57:39 +02:00
Brent Baude 11fa4b6eba podmanv2 version format variable name change
change the name of the variable for version to avoid collision with other commands.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-13 14:23:41 -05:00
OpenShift Merge Robot d7695dd957
Merge pull request #5777 from jwhonce/issues/5599
Refactor service idle support
2020-04-13 20:28:42 +02:00
Brent Baude 90ead05903 Fixes for load and other system tests
Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-13 13:08:04 -05:00
Jhon Honce f8892e7c6b Refactor service idle support
* Move connection tracking into APIServer using ConnState()
* Remove Connection counters from CLI code
* Update events handler to support client not closing connection
* Improve logging messages

Fixes #5599

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-04-13 08:11:36 -07:00
Brent Baude 6f650a5129 podmanv2 history and image remove templates
remove the use of template functions images and history to allow for straight-forward user experience.  instead of templates we use structs and struct methods.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-13 09:15:24 -05:00
Brent Baude 7d0e0a7129 v2podman container cleanup
add the ability to clean up after a container has attempted to run.  this is also important for podman run --rm --rmi.

also included are fixes and tweaks to various code bits to correct regressions on output.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-09 16:59:33 -05:00
OpenShift Merge Robot 1662310e51
Merge pull request #5754 from baude/v2psformat
v2podman ps alter formats
2020-04-09 15:56:26 +02:00
OpenShift Merge Robot 555b30e9eb
Merge pull request #5634 from jwhonce/wip/service
V2 podman system service
2020-04-09 14:55:45 +02:00
Valentin Rothberg ff52b7524a podmanV2: implement search
Also implement a new libpod endpoint to add more parameters and to
prevent us from converting between slices and maps and make use of
the filter parsing in the image backend.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-04-09 13:05:19 +02:00
Valentin Rothberg 7a3bfbf076 podmanV2: implement logs
Implement the `podman {container} logs` for the v2 client. The remote
client does not yet support it.  There's some more work needed for the
rest api; some options are missing (e.g., printing names) while others
are broken (e.g., the until http parameter).

The remote parts will be tackled in a future change.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-04-09 11:55:10 +02:00
OpenShift Merge Robot 3c94fa9cc7
Merge pull request #5758 from rhatdan/exitcode
Set exit codes on errors.
2020-04-09 03:02:55 +02:00
OpenShift Merge Robot 1229350377
Merge pull request #5748 from baude/v2imageformat
podmanv2 images user format
2020-04-09 03:00:40 +02:00
Daniel J Walsh 82bd7589e7
Set exit codes on errors.
podmanV2 run fedora /etc
Should exit with 126
podmanV2 run fedora /etc/foobar
Should exit with 127
podmanv2 run --fobar fedora echo hello
Should exit with 125
podmanv2 run fedora bash -c "exit 100"
Should exit with 100

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-04-08 15:54:35 -04:00
Brent Baude 8ce23775a6 v2podman ps alter formats
in order to get the go templating to work for custom input, we now use structure methods instead of template map funcs.  this requires some manipulation of fields so that the funcs can have the proper names.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-08 09:11:26 -05:00
Daniel J Walsh 4829136dab
run/create were processing options after the image name
flags.SetInterspersed(false)

Needs to be added to allow options to be used within the containers.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-04-08 08:33:34 -04:00
Jhon Honce e0847f5457 V2 podman system service
* Added support for system service
* Enabled linting on the varlinkapi source, needed to support V2
  service command
* Added support for PODMAN_SOCKET

Skip linting deprecated code

Rather than introduce bugs by correcting deprecated code, linting the
code is being skipped. Code that is being ported into V2 is being
checked.

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-04-07 19:22:10 -07:00
OpenShift Merge Robot 11c8b01e1d
Merge pull request #5739 from jwhonce/wip/diff
V2 Podman diff(changes) support
2020-04-07 21:49:24 +02:00
OpenShift Merge Robot b3a3fc3ef6
Merge pull request #5749 from rhatdan/reset
podman info needs to be run within the user namespace
2020-04-07 19:23:05 +02:00
Jhon Honce 8ae28a55ac V2 podman diff(changes) support
* Ported CLI command
* Added API endpoint
* Added bindings
* Updated swagger (TODO: n endpoints, one handler)

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-04-07 09:39:46 -07:00
Daniel J Walsh b0592e5540
podman info needs to be run within the user namespace
Accidently removed podman info from user namespace

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-04-07 10:02:50 -04:00
Brent Baude 90884ac2d2 podmanv2 images user format
honor the format provided by user for output

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-07 08:27:10 -05:00
Brent Baude 013ecca895 podmanv2 info
add ability to run info for v2

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-07 07:15:09 -05:00
Brent Baude 1bfb96b540 v2podman run
add the ability to run a container

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-06 15:23:04 -05:00
OpenShift Merge Robot 843fa25890
Merge pull request #5716 from baude/v2ps
podmanv2 ps
2020-04-06 22:04:16 +02:00
OpenShift Merge Robot 7d95e0c47a
Merge pull request #5507 from baude/newinfo
refactor info
2020-04-06 21:27:52 +02:00
OpenShift Merge Robot a858b3a6a3
Merge pull request #5705 from rhatdan/reset
Cleanup whether to enter user namespace
2020-04-06 20:48:05 +02:00
Brent Baude e20ecc733c refactor info
the current implementation of info, while typed, is very loosely done so.  we need stronger types for our apiv2 implmentation and bindings.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-06 12:45:42 -05:00
Brent Baude b22254dc8b podmanv2 ps
add the ability to list containers

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-06 12:12:59 -05:00
OpenShift Merge Robot e318b09b68
Merge pull request #5620 from cfelder/play-kube-networking
Add support for specifying CNI networks in podman play kube
2020-04-06 18:45:25 +02:00
Brent Baude 5e0b449736 podmanv2 start
add the ability to start containers

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-06 09:26:11 -05:00
OpenShift Merge Robot ba64186750
Merge pull request #5689 from sujil02/v2-pod-inspect
podmanv2 pod inspect
2020-04-06 15:23:19 +02:00
OpenShift Merge Robot 8dea3c3419
Merge pull request #5714 from baude/v2attach
v2podman attach
2020-04-06 14:52:25 +02:00
OpenShift Merge Robot 0b1b1710d3
Merge pull request #5713 from baude/v2version
podmanv2 version
2020-04-06 14:49:56 +02:00
Brent Baude 4d895dcb54 v2podman attach and exec
add the ability to attach to a running container.  the tunnel side of this is not enabled yet as we have work on the endpoints and plumbing to do yet.

add the ability to exec a command in a running container.  the tunnel side is also being deferred for same reason.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-05 15:54:51 -05:00
Brent Baude 6514a5c80e v2podman container create
create a container in podmanv2 using specgen approach.  this is the core implementation and still has quite a bit of code commented out specifically around volumes, devices, and namespaces.  need contributions from smes on these parts.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-03 15:43:03 -05:00
OpenShift Merge Robot 35f5867833
Merge pull request #5672 from baude/v2save
podmanv2 save image
2020-04-03 22:41:18 +02:00
Daniel J Walsh 9f2d9679d7
Cleanup whether to enter user namespace for rootless commands
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-04-03 15:25:57 -04:00
Brent Baude 837aad724f podmanv2 save image
add ability to save an image for podman v2

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-03 13:07:35 -05:00
OpenShift Merge Robot 64cade0f71
Merge pull request #5638 from baude/v2containercheck
podmanv2 checkpoint and restore
2020-04-03 20:05:30 +02:00
Brent Baude 9894fde732 podmanv2 version
this is only for the abi side and does not print out the remote information yet.  the remote information will need to be worked on and agreed upon later.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-03 12:45:57 -05:00
OpenShift Merge Robot a89d62ac3a
Merge pull request #5701 from vrothberg/v2-push
podmanV2: implement push
2020-04-03 18:11:54 +02:00
Brent Baude 8a16674722 podmanv2 checkpoint and restore
add the ability to checkpoint and restore containers on v2podman

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-03 09:32:06 -05:00
Daniel J Walsh 1f8569f7d7
Fix environment handling from containers.conf
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-04-02 13:10:08 -04:00
Valentin Rothberg 44a515015c podmanV2: implement push
* Implement `podman-push` and `podman-image-push` for the podmanV2
  client.

* Tests for `pkg/bindings` are not possible at the time of writing as we
  don't have a local registry running.

* Implement `/images/{name}/push` compat endpoint. Tests are not
  implemented for this v2 endpoint.  It has been tested manually.

General note: The auth config extraction from the http header is not
implement for push.  Since it's not yet supported for other endpoints
either, I deferred it to future work.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-04-02 17:01:32 +02:00
OpenShift Merge Robot 82610d657d
Merge pull request #5688 from baude/v2import
podmanv2 import
2020-04-02 14:20:57 +02:00
Brent Baude bb39051616 podmanv2 export
add ability to export a container to a tarball

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-01 16:02:53 -05:00
Brent Baude 0433081983 podmanv2 import
add the ability to import a container image from a container export

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-01 15:56:26 -05:00
Brent Baude 8500ce6b9a podmanv2 load
enable podman load for v2

add reexec into main

add systemd build flag to v2 makefile

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-01 14:10:57 -05:00
Sujil02 7cbc09971a podmanv2 pod inspect
Add the ability to inspect pod in podmanv2

Signed-off-by: Sujil02 <sushah@redhat.com>
2020-04-01 15:10:49 -04:00
Jhon Honce 46e3b2efb8 V2 podman inspect
* Expose podman container inspect
* Expose podman image inspect

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-04-01 08:07:43 -07:00
OpenShift Merge Robot 82cbebcbea
Merge pull request #5656 from baude/v2imagetag
podman v2 image tag and untag
2020-04-01 16:10:10 +02:00
Brent Baude 26644d7cb8 podman v2 image tag and untag
add the ability to tag and untag images in podmanv2

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-03-31 19:36:26 -05:00
Brent Baude 7def91910c podmanv2 pod ps
add the ability to list pods in podmanv2

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-03-31 19:32:37 -05:00
OpenShift Merge Robot 9f5fcc3565
Merge pull request #5655 from baude/v2hcrun
podmanv2 enable healthcheck run
2020-03-31 23:01:19 +02:00
OpenShift Merge Robot 6e8f6cab60
Merge pull request #5675 from vrothberg/v2-pull
podmanV2: implement pull
2020-03-31 21:12:49 +02:00
OpenShift Merge Robot 56ab9e4cc8
Merge pull request #5649 from jwhonce/wip/varlink
V2 Move varlink home
2020-03-31 20:34:36 +02:00
Daniel J Walsh 3449b27cd1
Switch to using --time as opposed to --timeout to better match Docker.
We need to consistently use --time rather then --timeout throughout the code.
Fix locations where timeout defaults are not set correctly as well.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-03-31 08:50:32 -04:00
Valentin Rothberg 3bdad6fa2a podmanV2: implement pull
Implement pulling images for the v2 client.  What I _really_ don't like
is the fact that we are now having a near identical code clone among
`pkg/domain/infra/abi` and `pkg/api/handlers/libpod`.  Partly because we
don't yet have a higher-level pull function and partly because we have
redudancy among `pkg/domain` and `pkg/api`.  Pull might be a high
outlier but I am concerned already by the potential of introducing more
redundancy.  I'd love to `infra/abi` and `pkg/abi` to really use the
same code in the future.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-03-31 13:01:27 +02:00
OpenShift Merge Robot 95d9a1e667
Merge pull request #5664 from giuseppe/rootless-make-error-not-fatal
rootless: make cgroup ownership detection not fatal
2020-03-30 17:50:06 +02:00
Jhon Honce 7a12e01556 V2 Move varlink home
* move cmd/podman/varlink/* to pkg/varlink to support podmanV2 refactor
* update Makefile
* reformatted all impacted code

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-03-30 08:18:35 -07:00
OpenShift Merge Robot cc22b94a7a
Merge pull request #5602 from rhatdan/vendor
Update vendor of boltdb and containers/image
2020-03-30 15:54:36 +02:00
OpenShift Merge Robot 8193751287
Merge pull request #5639 from vrothberg/v2-pod-top
V2 pod top
2020-03-30 13:59:37 +02:00
Giuseppe Scrivano f59c948928
rootless: make cgroup ownership detection not fatal
do not fail if we cannot detect the cgroup ownership.  The detection
fails when running in a container, since the cgroup showed in
/proc/self/cgroup is not accessible, due to the runtime mounting it
directly as the cgroup root.

Closes: https://github.com/containers/libpod/issues/5488

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-03-30 12:24:10 +02:00
Brent Baude a84c006368 podmanv2 enable healthcheck run
run healthcheck with podmanv2

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-03-29 18:48:29 -05:00
Daniel J Walsh 366001fb5f
Update vendor of boltdb and containers/image
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-03-29 06:16:27 -04:00
Valentin Rothberg 9812804f75 podmanv2: implement pod top
Implement `podman pod top` for podmanV2.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-03-28 17:32:22 +01:00
Brent Baude 3ff1583814 podmanv2 commit
add commit of a container to a container-image

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-03-28 10:11:50 -05:00
Daniel J Walsh 4352d58549
Add support for containers.conf
vendor in c/common config pkg for containers.conf

Signed-off-by: Qi Wang qiwan@redhat.com
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-03-27 14:36:03 -04:00
OpenShift Merge Robot 2c5c198020
Merge pull request #5632 from jwhonce/wip/images
V2 podman image prune
2020-03-27 18:47:51 +01:00
OpenShift Merge Robot 4233250c43
Merge pull request #5611 from baude/v2podcreate
podmanv2 pod create using podspecgen
2020-03-27 16:25:30 +01:00
OpenShift Merge Robot 3ddb5b10d5
Merge pull request #5595 from stefano-pogliani/pod-ps-filter-label
Support label filters for podman pod ps
2020-03-27 15:18:27 +01:00
Brent Baude e56d529561 podmanv2 pod create using podspecgen
using the factory approach similar to container, we now create pods based on a pod spec generator.  wired up the podmanv2 pod create command, podcreatewithspec binding, simple binding test, and apiv2 endpoint.

also included some code refactoring as it introduced as easy circular import.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-03-27 09:04:10 -05:00
Christian Felder 91dbdff77e Add support for specifying CNI networks in podman play kube
Fixes: #5609
Signed-off-by: Christian Felder <c.felder@fz-juelich.de>
2020-03-27 10:00:01 +01:00
Valentin Rothberg 500a2d508b podmanV2: implement top
Implement the `top` command for podmanV2.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-03-27 09:14:01 +01:00
Jhon Honce 581dd312af V2 podman image prune
* Fixed header for `podman image ls`
* Implemented prune `all` flag, preserved filter method for backwards
  capability
* Updated binding tests

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-03-26 18:32:44 -07:00
Stefano Pogliani df568e4963
Support label filters for podman pod ps.
Update the podman pod ps command to support filtering by labels.
This brings the command in line with the documentation as well as
the functionality by the containers equivalent podman ps.

Signed-off-by: Stefano Pogliani <stefano@spogliani.net>
2020-03-26 23:11:07 +00:00
Brent Baude 2fa78938a9 podmanv2 container inspect
add ability to inspect a container

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-03-26 15:54:26 -05:00
Brent Baude c5ce210f7d podmanv2 pod subcommands
add pod kill, pause, restart, rm, start, stop, and unpause

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-03-26 14:14:05 -05:00
OpenShift Merge Robot 4f38509b6c
Merge pull request #5615 from jwhonce/wip/images
V2 podman image rm | podman rmi [IMAGE]
2020-03-26 18:11:38 +01:00
Jhon Honce f38a26bfa0 V2 podman image rm | podman rmi [IMAGE]
* Add support for rm and rmi commands
* Support for registry.ExitCode
* Support for N-errors from domain layer

* Add log-level support
* Add syslog support

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-03-25 17:54:14 -07:00
Jhon Honce 36a4cc864d V2 podman image
* Exists()

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-03-25 17:54:14 -07:00
Brent Baude 06e2a5dd86 podmanv2 add pre-run to each commmand
each container command needs a prerune because it is not part of the containers subcommand yet

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-03-25 19:24:24 -05:00
OpenShift Merge Robot 69b011d3ac
Merge pull request #5604 from jwhonce/wip/images
V2 podman images/image list
2020-03-25 01:26:21 +01:00
Jhon Honce 1d7cb7cc48 V2 podman images/image list
* Updated entities to support flags/options
* Updated bindings caused by entities changes
* Removed handlers.ImageSummary in favor of entities.ImageSummary

* Introduced StringSet() container object to simply error checking

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-03-24 16:06:01 -07:00
Brent Baude ae614920bf podmanv2 volumes
add volume commands: create, inspect, ls, prune, and rm

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-03-24 16:03:49 -05:00
Jhon Honce 77a2af8817 Combine GlobalFlags and EngineFlags into EngineOptions
* EngineOptions obtained in command via
  `opt, err := registry.Options(cmd)`

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-03-24 11:03:13 -07:00
OpenShift Merge Robot d6f8c3e07d
Merge pull request #5596 from jwhonce/wip/history
Complete podmanV2 history command
2020-03-24 18:07:50 +01:00
Jhon Honce 2c698f0140 Complete podmanV2 history command
* All format options now implemented

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-03-24 07:40:34 -07:00
Brent Baude 2d4fa996ef podmanv2 exit code
add ability to set and get exit code.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-03-24 07:28:55 -05:00
OpenShift Merge Robot 3dbf2cb5af
Merge pull request #5581 from baude/v2containers
podmanv2 add core container commands
2020-03-24 13:12:06 +01:00
OpenShift Merge Robot 02de8d576b
Merge pull request #5560 from QiWang19/remote_ceds
Use creds form PullImage remote
2020-03-23 21:22:41 +01:00
Daniel J Walsh 31d14457a5
Merge pull request #5582 from kunalkushwaha/bugfix-5001
Improved readability in image json output
2020-03-22 17:40:20 -04:00
Brent Baude 9536560b4f podmanv2 add core container commands
add core container commands for podmanv2: kill, pause, restart, rm, stop, unpause

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-03-22 13:24:45 -05:00
Kunal Kushwaha 19bf7adedb Improved readability in image json output
Changes made in json output to improve readability of
podman images output.

Signed-off-by: Kunal Kushwaha <kunal.kushwaha@gmail.com>
2020-03-22 21:38:07 +09:00
OpenShift Merge Robot 89a3e5979b
Merge pull request #5579 from mtrmac/macOS-unit-tests
Make macOS unit tests runnable
2020-03-21 14:48:50 +01:00
OpenShift Merge Robot 195a82ffbc
Merge pull request #5577 from baude/v2volumecreate
podmanv2 volume create
2020-03-21 14:46:39 +01:00
Brent Baude c3a9ff1174 podmanv2 volume create
add volume create

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-03-20 18:27:08 -05:00
Miloslav Trmač de7bcca7d5 Add stubs for cmd/podman in non-Linux local mode
This is _only_ to be able able to run unit tests.

I didn't even TRY running the result, I'm scared of what it would do.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2020-03-21 00:21:59 +01:00
Miloslav Trmač bdfe8e699e Make cmd/podman/shared.GenerateCommand tests Linux-only
They rely on existence of /proc/self/exe .

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2020-03-21 00:21:59 +01:00
Brent Baude 0feec5de98 podmanv2 pod exists
add pod exists for podman v2

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-03-20 17:07:57 -05:00
Brent Baude c81e065149 podmanv2 enable remote wait
enable remote container wait with condition

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-03-20 14:33:33 -05:00
Brent Baude baf3a9b3a7 use boolreport for containerexists response
in the case of exists, use a boolreport structure so that responses can be consistent pointer and error

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-03-20 13:01:24 -05:00
Brent Baude 87293028e6 podmanv2 container exists|wait
enable container exists and wait for podmanv2

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-03-20 12:54:45 -05:00
OpenShift Merge Robot ccc30c606e
Merge pull request #5539 from sujil02/issue-5461
Implemented --iidfile for podman commit
2020-03-20 11:45:32 +01:00
Sujil02 5efa6dae90 Implemented --iidfile for podman commit
Added flag to Write the image ID to the file with podman commit command.
Fix to issue #5461

Signed-off-by: Sujil02 <sushah@redhat.com>
2020-03-19 16:32:02 -04:00
Jhon Honce 46b338c77d Add guildline for writing podman V2 CLI commands
Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-03-19 11:54:27 -07:00
Qi Wang 9ac58fd78e Use creds form PullImage remote
fix #5511
Adds creds argument to PullImage API and Enables podman-remote to pull image with --creds

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-03-19 14:38:12 -04:00
Brent Baude 9e886d3a4a [CI:DOCS]remove podmanv2 binary
Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-03-19 12:23:08 -05:00
OpenShift Merge Robot 093d9ef673
Merge pull request #5546 from jwhonce/wip/entities
V2 podman command
2020-03-19 18:19:43 +01:00
OpenShift Merge Robot 1be6178915
Merge pull request #5445 from sujil02/podFilter-new
Filter pods through pod list api
2020-03-19 15:50:50 +01:00
Jhon Honce fbe743501e V2 podman command
Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-03-18 16:41:12 -07:00
Sujil02 15326f051d Filter pods through pod list api
Refactored current filter pods flow through the shared pod functions
so filter pod functionalities can be shared between api and cmd.

Signed-off-by: Sujil02 <sushah@redhat.com>
2020-03-17 17:46:20 -04:00
Valentin Rothberg f4e873c4e1 auto updates
Add support to auto-update containers running in systemd units as
generated with `podman generate systemd --new`.

`podman auto-update` looks up containers with a specified
"io.containers.autoupdate" label (i.e., the auto-update policy).

If the label is present and set to "image", Podman reaches out to the
corresponding registry to check if the image has been updated.  We
consider an image to be updated if the digest in the local storage is
different than the one of the remote image.  If an image must be
updated, Podman pulls it down and restarts the container.  Note that the
restarting sequence relies on systemd.

At container-creation time, Podman looks up the "PODMAN_SYSTEMD_UNIT"
environment variables and stores it verbatim in the container's label.
This variable is now set by all systemd units generated by
`podman-generate-systemd` and is set to `%n` (i.e., the name of systemd
unit starting the container).  This data is then being used in the
auto-update sequence to instruct systemd (via DBUS) to restart the unit
and hence to restart the container.

Note that this implementation of auto-updates relies on systemd and
requires a fully-qualified image reference to be used to create the
container.  This enforcement is necessary to know which image to
actually check and pull.  If we used an image ID, we would not know
which image to check/pull anymore.

Fixes: #3575
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-03-17 17:18:56 +01:00
Brent Baude 9ca4b6c6f5 add os|arch attributes when building
when building images, we can now add the os and arch of the image using overrides from the commandline.  the commandline options set sane defaults so we use those as well.

Fixes: #5503

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-03-15 12:49:42 -05:00
Brent Baude 3aa58ccd0a remove imagefilter for varlink remote client
the api for getting images changed to use filters but back level podman versions cannot handle it.  so temporarily disabling the filtering for remote clients until the restful approach can be used.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-03-12 12:43:32 -05:00
OpenShift Merge Robot 235f367861
Merge pull request #5469 from giuseppe/no-size-create-container
create: do not calculate image size
2020-03-12 10:20:02 -04:00
Giuseppe Scrivano 8741eb8a92
create: do not calculate image size
calculating the image size can be an expensive operation.  Avoid doing
it when creating a new container since the size is not needed.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-03-12 09:51:17 +01:00
Ed Santiago 3d1bff6db9 man page cross-reference fixes: part 2
The other direction: fix or clean up elements documented in
man pages but which did/do not exist in actual podman:

  * runlabel: add missing "-n" alias for --name

And, remove man page entries for nonexistent options:

  * podman commit: --iidfile
  * podman container runlabel: --rootfs, --storage
  * podman create: --cpu-count

There are two problems I don't know how to deal with. Both
are related to main_local.go:rootCmd.PersistentFlags() :

  1) podman-build.1.md documents --cni-config-dir and
     --runtime options, but these are not actually options
     under podman build; they are global options. The
     documentation in this man page differs from that
     under podman-build.

  2) podman ps implements a binary --namespace option,
     but this option does not (cannot?) appear in --help
     because there's a global --namespace string option
     and Cobra somehow gets confused about this.

Do we really intend for global options to be parsed on
the right-hand side of subcommands? This strikes me as
unintuitive and potentially confusing, although the
fact that it has taken me this long to discover it
suggests that it's not _that_ confusing.

Suggestions welcome. I can file issues for 1/2 above,
or simply teach my script to special-case ignore them.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-03-11 11:05:37 -06:00
Ed Santiago 281def2647 man pages: fix inconsistencies
I wrote a script to cross-reference podman --help against
man pages. It found a bunch of inconsistencies fix them:

 * options missing from man pages
 * options misspelled or misformatted in man pages (usually
   misplaced asterisks or missing dashes, but see --dns-opt)
 * one spurious comma in the actual source file --help

This is a fix in which I iterate over 'podman CMD --help'
and check for presence in man pages. The other way around
(look for flags in man pages, check podman CMD --help)
is probably impossible: there are too many special cases

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-03-10 15:03:59 -06:00
Valentin Rothberg 7534f9dd1a hide --trace flag
The tracing flag is not really something users should worry about.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-03-10 08:33:39 +01:00
Valentin Rothberg 7b10b71445 podman --help: mention defaults of bools
While string variables are shown to expect a string argument, boolean
variables are not.  This easily tricks users into believing they are
simple switches without arguments.  Hence, explicitly mention the
default to clarify it a bit more.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-03-10 08:33:39 +01:00
Valentin Rothberg 6f1ba67300 use storage/pkg/homedir
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-03-09 08:57:23 +01:00
OpenShift Merge Robot f378e82e2d
Merge pull request #5412 from rhatdan/tmpdir
Allow users to set TMPDIR environment
2020-03-08 17:03:59 +01:00
Daniel J Walsh ac354ac94a
Fix spelling mistakes in code found by codespell
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-03-07 10:30:44 -05:00
Brent Baude 8b5e2a6297 add default network for apiv2 create
during container creation, if no network is provided, we need to add a default value so the container can be later started.

use apiv2 container creation for RunTopContainer instead of an exec to the system podman. RunTopContainer now also returns the container id and an error.

added a libpod commit endpoint.

also, changed the use of the connections and bindings slightly to make it more convenient to write tests.

Fixes: 5366
Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-03-06 14:31:45 -06:00
Daniel J Walsh cb51707f91
Allow users to set TMPDIR environment
Some users have small /var/tmp directories and need to be able to specify a different location
for temporary files, which includes more space.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-03-06 10:21:37 -05:00
Valentin Rothberg 593eb7625a golangci: enable goimports
Enable the goimports linter and fix reports.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-03-05 20:03:44 +01:00
OpenShift Merge Robot 834f397db2
Merge pull request #5389 from openSUSE/fix-image-sign-help
Fix podman image sign help output
2020-03-04 22:48:58 -05:00
OpenShift Merge Robot 797da2a57b
Merge pull request #5381 from vrothberg/ENVFIX
env: set "container" to current binary
2020-03-04 13:26:48 -05:00
Valentin Rothberg 6d2d6898f8 env: don't set "container" env
Leave setting the "container" variable to consumers of pkg/env.
Podman is now hard-setting it to "podman" while "libpod" will
set it internally to "libpod" if it's unset.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-03-04 17:07:47 +01:00
OpenShift Merge Robot 90eef95cb1
Merge pull request #4772 from boaz0/closes_4628
Add the rmi flag to podman-run to delete container image
2020-03-04 10:58:10 -05:00
Sascha Grunert 6e1de159eb
Fix podman image sign help output
Adjust the help output to mention `podman image sign` instead of just
`podman sign`.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2020-03-04 09:22:53 +01:00
Boaz Shuster 11e5c53d11 Add the rmi flag to podman-run to delete container image
The --rmi flag will delete the container image after its execution
unless that image is already been used by another container(s).

This is useful when one wants to execute a container once and remove
any resources attached to it.

Signed-off-by: Boaz Shuster <boaz.shuster.github@gmail.com>
2020-03-03 14:27:11 +02:00
Valentin Rothberg ad8e0e5e49 consolidate env handling into pkg/env
Env-variable related code is scattered across several packages making it
hard to maintain and extend.  Consolidate the code into a new pkg/env
package.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-03-03 11:47:24 +01:00
OpenShift Merge Robot a58bf77d3e
Merge pull request #5244 from Akasurde/i4962
Add cmd flag to show container name in log
2020-02-28 18:55:58 +01:00
Giuseppe Scrivano c59080b463
build: specify input fd to buildah
It solves a tight loop with poll as stdin will be initialized to
/dev/null in buildah/imagebuildah/StageExecutor.Run.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-02-28 16:24:08 +01:00
Jhon Honce 997e3c8863 Remove 1 sec delay
* Stop closing net.Listener() twice on interrupt
 * Do not report error if closing server twice

Fixes #5311

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-02-25 11:04:20 -07:00
OpenShift Merge Robot 6babc9f20c
Merge pull request #5305 from mheon/check_for_common_deadlocks
Add basic deadlock detection for container start/remove
2020-02-25 13:17:12 +01:00
Giuseppe Scrivano 1e94c2964d
build: move initialization after SetXdgDirs
otherwise it triggers the config file initialization from
vendor/github.com/containers/common/pkg/config before the init() in
main.go can set correctly XDG_RUNTIME_DIR and DBUS_SESSION_BUS_ADDRESS
when they are missing.

commit 96de762eed introduced the
regression.

Closes: https://github.com/containers/libpod/issues/5314

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-02-24 22:39:19 +01:00
Matthew Heon 4004f646cd Add basic deadlock detection for container start/remove
We can easily tell if we're going to deadlock by comparing lock
IDs before actually taking the lock. Add a few checks for this in
common places where deadlocks might occur.

This does not yet cover pod operations, where detection is more
difficult (and costly) due to the number of locks being involved
being higher than 2.

Also, add some error wrapping on the Podman side, so we can tell
people to use `system renumber` when it occurs.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-02-24 09:29:34 -05:00
OpenShift Merge Robot 18dcb84d64
Merge pull request #4889 from baude/portsearch
fix port list by container with port
2020-02-23 13:00:10 -05:00
Ed Santiago fab5b35b2a Friendly amendment: tests, and a help message
1) Help message for podman port was missing [PORT]

2) Add test for 'podman port'. And, actually, an entire
   networking test that I'd written some weeks ago but
   apparently didn't 'git add'.

Signed-off-by: Ed Santiago <santiago@redhat.com>
Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-02-23 11:04:39 -06:00
baude 5a1609b9cf fix port list by container with port
code was erronously misinterpretting the port as a containername.

Fixes: #1791832

Signed-off-by: baude <bbaude@redhat.com>
Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-02-23 11:03:56 -06:00
Brent Baude 0184714a82 Add --no-healthcheck command to create/run
Now support --no-healthcheck option to disable defined healthchecks in a container image.  --health-cmd=none remains supported as well.

Fixes: #5299

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-02-22 12:45:15 -06:00
Jhon Honce 0f0b4fd3c2 Add support for ssh:// and unix:// podman clients
* Make context keys package safe
 * Add support for PODMAN_HOST and PODMAN_SSHKEY
 * Add slight increasing delay when client connections fail
 * Remove usages of path.Join(), added JoinURL(). '/' is not OS
   dependent.

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-02-20 14:18:45 -07:00
OpenShift Merge Robot e7d8bda870
Merge pull request #5268 from Akasurde/warn_bare_password
Warn user about --password cli option in login
2020-02-20 15:55:31 +01:00
Abhijeet Kasurde db60abe3d8 Warn user about --password cli option in login
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-02-20 15:27:01 +05:30
OpenShift Merge Robot c8436cd870
Merge pull request #5253 from rhatdan/buildah
Update to the latest version of buildah
2020-02-20 10:56:06 +01:00
OpenShift Merge Robot 846405256b
Merge pull request #5241 from mheon/pod_network_opts_add
Add network opts to pods
2020-02-20 10:39:15 +01:00
Daniel J Walsh 96de762eed
Update to the latest version of buildah
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-02-19 16:04:00 -05:00
OpenShift Merge Robot da249e2fe2
Merge pull request #5225 from vrothberg/fix-5087
config: use built-in TOML merge and adhere to label setting
2020-02-19 17:30:21 +01:00
Matthew Heon 97323808ed Add network options to podman pod create
Enables most of the network-related functionality from
`podman run` in `podman pod create`. Custom CNI networks can be
specified, host networking is supported, DNS options can be
configured.

Also enables host networking in `podman play kube`.

Fixes #2808
Fixes #3837
Fixes #4432
Fixes #4718
Fixes #4770

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-02-19 11:29:30 -05:00
OpenShift Merge Robot cba5791a5d
Merge pull request #5233 from QiWang19/login/out-parameter
fix mandatory parameter in login/logout
2020-02-19 15:11:54 +01:00
Abhijeet Kasurde 7f411cb325 Review comments
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-02-19 17:14:20 +05:30
Abhijeet Kasurde 88a8d9e3fa [WIP] Add cmd flag to show container name in log
This flag allows user to show container name in podman log command

Fixes: #4962

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-02-19 16:58:04 +05:30
Valentin Rothberg 58cbbbc56e set process labels in pkg/spec
Set the (default) process labels in `pkg/spec`. This way, we can also
query libpod.conf and disable labeling if needed.

Fixes: #5087
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-02-19 11:04:02 +01:00
OpenShift Merge Robot c58926e54b
Merge pull request #5243 from Akasurde/misc_typo
Misc typo fixes
2020-02-18 21:58:14 +01:00
Qi Wang 4c135017b2 fix mandatory parameter in login/logout
fix #5146
Insted of using a registry as mandatory parameter, this path allows podman to use the first registry from registries.conf.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-02-18 15:30:49 -05:00
OpenShift Merge Robot 5dacee9395
Merge pull request #5223 from vrothberg/ps-image-id
podman-ps: support image IDs
2020-02-18 16:11:28 +01:00
Abhijeet Kasurde 9419807cef Misc typo fixes
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-02-18 16:00:36 +05:30
Jhon Honce c0c44ae8a3 Fix handler and systemd activation errors
On panic from handler: log warning and stack trace, report
InternalServerError to client

When using `podman system service` make determining the listening endpoint deterministic.

  // When determining _*THE*_ listening endpoint --
  // 1) User input wins always
  // 2) systemd socket activation
  // 3) rootless honors XDG_RUNTIME_DIR
  // 4) if varlink -- adapter.DefaultVarlinkAddress
  // 5) lastly adapter.DefaultAPIAddress

Fixes #5150
Fixes #5151

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-02-17 10:29:32 -07:00
Valentin Rothberg 3c2cc67867 podman-ps: support image IDs
Support printing image IDs via `--format "{{.ImageID}}"`.

Fixes: #5160
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-02-17 15:22:21 +01:00
Sascha Grunert 93358ef915
Refactor image tree for API usage
Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2020-02-17 11:12:35 +01:00
OpenShift Merge Robot ff0f838813
Merge pull request #5218 from Jumanjii/update-go-md2man-pkg-name
Update documentation of commit command to show image reference is optional
2020-02-17 08:47:08 +01:00
Allan Jacquet-Cretides 59c91069c0 Update documentation of commit command to show image reference is optional
Following
Commit ba1d1304a6 ("make image reference for commit optional")

Updates usage text used by cobra and markdown document used to generate MAN page.

Fixes: #5145

Signed-off-by: Allan Jacquet-Cretides <allan.jacquet@gmail.com>
2020-02-15 11:11:00 +01:00
Matthew Heon 36a0ed9702 Rework label parsing
We attempted to share all logic for parsing labels and
environment variables, which on the surface makes lots of sense
(both are formatted key=value so parsing logic should be
identical) but has begun to fall apart now that we have added
additional logic to environment variable handling. Environment
variables that are unset, for example, are looked up against
environment variables set for the process. We don't want this for
labels, so we have to split parsing logic.

Fixes #3854

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-02-14 16:06:20 -05:00
OpenShift Merge Robot 3e0475eb88
Merge pull request #5189 from mheon/only_set_all_on_status
Only set --all when a status filter is given to ps
2020-02-13 20:51:22 +01:00
OpenShift Merge Robot 2814995a92
Merge pull request #5115 from QiWang19/images-format
images --format compatible with docker
2020-02-13 11:42:47 +01:00
OpenShift Merge Robot a65f6b888a
Merge pull request #5152 from QiWang19/device-cgroup-rule
support device-cgroup-rule
2020-02-13 02:34:42 +01:00
Matthew Heon d2100cd473 Only set --all when a status filter is given to ps
The changes in #5075 turn out to be too aggressive; we should
only be setting --all if a status= filter is given. Otherwise
only running containers are filtered.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-02-12 20:14:20 -05:00
Qi Wang d3260738d3 support device-cgroup-rule
fix #4876
Add `--device-cgroup-rule` to podman create and run. This enables to add device rules after the container has been created.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-02-12 14:30:23 -05:00
Valentin Rothberg 65d10ffab3 add pkg/seccomp
Add pkg/seccomp to consolidate all seccomp-policy related code which is
currently scattered across multiple packages and complicating the
creatconfig refactoring.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-02-12 17:10:18 +01:00
Valentin Rothberg 61b890268a cmd/podman/pull: refactor code
Refactor and simplify the code in cmd/podman/pull.go to address a couple
of issues w.r.t. how the arguments were passed.  Also make sure to
always use the c/image API for parsing instead of working around it.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-02-12 15:11:17 +01:00
OpenShift Merge Robot d34ce1320c
Merge pull request #5083 from vrothberg/v2-libpod-image-endpoints
v2 api: /libpod/images/{import,load,pull}
2020-02-11 21:25:35 +01:00
OpenShift Merge Robot c705d2cefc
Merge pull request #5159 from baude/apiv2cockpit1
Rewire ListContainers for APIv2 libpod
2020-02-11 17:13:33 +01:00
Brent Baude ddffc865f3 Rewire ListContainers for APIv2 libpod
consumers of the api remarked how they would prefer a more strongly typed data structure from list containers oon the libpod side of things.  for example, events should be consumable and consistent timestamps.  also, for the sake of compatibility, it is helpful to have the json named atttributes for Id to not be ID.

listcontainers on the libpod side no longer strongly uses the the ps cli to obtain information but we do benefit from turning on the ability to list the last X containers, something CLI does not have yet. we also flipped the bit on defaulting to truncated output in the return.

thanks to the efforts of the cockpit team to help us here.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-02-11 08:14:28 -06:00
Valentin Rothberg b0abd1c36e container create: relax os/arch checks
Relax the os/arch checks when creating a container and only info-log
mismatches instead of erroring out.  There are too many images used
in the wild which do not set their arch correctly correctly.  Erroring
out has hit users sufficiently enough to justify relaxing the errors
and only log to at least inform the users and image vendors.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-02-11 09:48:26 +01:00
Matthew Heon d99f2ee784 Remove incorrect validation of --change for commit
The validation logic was failing on properly-formatted changes.
There's already validation in Commit itself, so no need to
duplicate.

Fixes #5148

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-02-10 16:32:02 -05:00
Qi Wang 3afd1b5a7c images --format compatible with docker
This patch lets valid values of --format be compatible with docker. Replace CreatedTime with CreatedAt, Created with CreatedSince.
Keep CreatedTime and Created are valid as hidden options.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-02-10 10:34:40 -05:00
Valentin Rothberg 76e2a0c5d3 v2 api: /libpod/images/pull
Implement the /libpod/images/pull endpoint and correct the swagger docs.
The reference parameter is mandatory and must either be a
c/image/docker/reference or a reference to the "docker://" transport as
the pull endpoint is meant to only support pulling images from a
registry.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-02-10 12:36:45 +01:00
Sascha Grunert 9bc171b86d
Refactor runtime functions to pass options structure
This makes the code easier to read but should not change the overall
behavior.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2020-02-07 13:45:29 +01:00
Matthew Heon 41b735af05 Move podman-service to podman-system-service
Fixes #5108

Signed-off-by: Matthew Heon <mheon@redhat.com>
2020-02-06 13:41:57 -05:00
OpenShift Merge Robot 62111bceb7
Merge pull request #5098 from rhatdan/memory-swap
Special case memory-swap=-1
2020-02-06 18:51:05 +01:00
Daniel J Walsh 100d2fdcfd
Special case memory-swap=-1
We document that memory-swap==-1 means unlimited, but currently we
won't allow the user to specify the -1 value.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-02-05 10:37:51 -05:00
OpenShift Merge Robot 348e58b59a
Merge pull request #5075 from mheon/filter_forces_all
Force --all when --filter is passed to podman ps
2020-02-04 13:22:57 -08:00
Matthew Heon ee5b749e65 Force --all when --filter is passed to podman ps
When we filter, it should be out of all containers, not just
running ones, by default - this is necessary to ensure Docker
compatability.

Fixes #5050

Signed-off-by: Matthew Heon <mheon@redhat.com>
2020-02-04 09:52:25 -05:00
Sascha Grunert 59328a22db
Fix wrong Containerfile location on build
Podman does select the wrong Containerfile if the current working
directory contains a Containerfile but we specify one from a different
location.

Reproducer:
```
> mkdir 1
> echo FROM scratch > Containerfile
> echo FROM golang > 1/Containerfile
> podman build -f 1/Containerfile -t test
STEP 1: FROM scratch
```

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2020-02-04 14:47:33 +01:00
Brent Baude b438cb2cce seperate container create network options
this pr splits off some of the network container create options into a different flag set.  the options in question are:

--add-host
--dns
--dns-opt
--dns-search
--ip
--mac-address
--network
--no-hosts
--publish

in the future, these options are going to be added to the pod create flags.  this makes that transition easier and provides for less code duplication.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-02-03 15:30:17 -06:00
Brent Baude f1eaccedfa fix longname handling for bindings
the api needs to account for image input where the image is encoded as a fqd image name.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-01-31 08:38:25 -06:00
Brent Baude 9bbf08de25 make image reference for commit optional
to match docker compat, the image tag should be optional.

Fixes: #5027

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-01-30 09:51:59 -06:00
Daniel J Walsh 38d2ef0cbd
Throw error on invalid sort value
We define the valid sort values, so we should throw an error
on invalid sort values.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-01-28 16:34:18 -05:00
OpenShift Merge Robot d8f2333b29
Merge pull request #4984 from baude/pullarchoverride
expose --arch-override option for pull
2020-01-28 11:39:56 -08:00
Brent Baude d42b064c8c expose --arch-override option for pull
We no longer wish to hide the --arch-override from the cli on pulls. we now expose it.  docs updated.  tests already exist.

Fixes: #4849

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-01-27 10:06:39 -06:00
Brent Baude 7f69669a3a Hidden remote flags can be nil
The pull command has several options that are hidden for the remote client.  In that case, when checking to see if the flag has been flipped with .Changed, we get a nil pointer error.  Using IsSet is tolerant of this.

Fixes: #4706

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-01-26 14:53:22 -06:00
OpenShift Merge Robot d07f611885
Merge pull request #4965 from baude/reviewcorrections3
APIv2 review corrections #3
2020-01-25 23:23:39 -08:00
Brent Baude 5da70b04dd APIv2 review corrections #3
The third pass of corrections for the APIv2.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-01-25 15:09:09 -06:00
Valentin Rothberg ac8e6c9910 fork fatih/camelcase
faith/camelcase has been archived and is no longer maintained.
The package is sufficiently small and self-contained enough to
maintain it in libpod.

Fixes: #4783
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-01-25 09:42:48 +01:00
Valentin Rothberg 1531509542 seccomp policy: expect profile in config label
Move the seccomp profile from a manifest annotation to a config label.
This way, we can support it for Docker images as well and provide an
easy way to add that data via Dockerfiles.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-01-23 10:06:43 +01:00
OpenShift Merge Robot 9f146b1b54
Merge pull request #4861 from giuseppe/add-cgroups-disabled-conmon
oci_conmon: do not create a cgroup under systemd
2020-01-22 17:00:48 +01:00
baude d4c2aaf38a Add service endpoint
add service endpoint for the new API.  Also supports the varlink
implementation.

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

Refactor to allow developer more control of API server

* Add api.NewServerWithSettings() to create an API server with custom
  settings
* Add api.ListenUnix() to create a UDS net.Listener and setup UDS

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

More service completion

Add podman service command that allows users to run either a RESTful or
varlink protocol API service.

Addition of docs and RESTful listening.

Signed-off-by: baude <bbaude@redhat.com>
Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-01-21 16:35:45 -06:00
Sascha Grunert 38ba9e6922
Update `tag` documentation regarding 'alias' usage
The word `alias` is not very common when speaking about image names and
tags. So we just refer to image name as the overall identifier of an
image.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2020-01-17 08:51:36 +01:00
Giuseppe Scrivano ba0a6f34e3
podman: add new option --cgroups=no-conmon
it allows to disable cgroups creation only for the conmon process.

A new cgroup is created for the container payload.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-01-16 18:56:51 +01:00