Commit Graph

119 Commits

Author SHA1 Message Date
Qi Wang 4192298be3 Set engine env from common config
Set the env that is used by Podman.
related issue containers/common#31

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-07-03 15:29:38 -04:00
Jhon Honce 6fb5f01c73 Fixes --remote flag issues
* --remote, --url and --identity are now anchored to podman command.
  Subcommands should no longer have issues
* TraverseChildren now set to V1 expectations
* Latest flag now has helper function. Now has consistent usage.
* IsRemote() uses cobra parser to determin if --remote is given
* Moved validation functions from parser pkg to validate pkg
*

Fixes #6598
Fixes #6704

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-06-26 17:09:24 -07:00
Jhon Honce 7377e578a9 V2 podman system connection
* Implement command
* Refactor podman-remote to pull from containers.conf by default
* podman-remote defaults to --remote being true
* Write podman-system-connection.1.md

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-06-23 08:18:53 -07:00
Daniel J Walsh 4bb43b898d
Fixup issues found by golint
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-06-10 05:49:41 -04:00
Matthew Heon 89a1e7db39 Add parallel execution code for container operations
This code will run container operations in parallel, up to a
given maximum number of threads. Currently, it has only been
enabled for local `podman rm` as a proof of concept.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-06-05 11:31:05 -04:00
Jhon Honce cbca625328 V2 Add support for ssh authentication methods
* podman --remote ssh://<user>:<password>@<host>:<port><path>
* podman --remote ssh://<user>:<password>@<host>:<port><path> \
  --identity <path> --passphrase <phrase>
* ssh-add <key>
  podman --remote ssh://<user>@<host><path>
* Fix `podman help` to run even if podman missing components
* Prompt for passphrase on stdin IFF key is protected and passphrase
  not given via any other configuration

* cobra flags do not support optional value flags therefore refactored
  --remote to be a boolean and --url will now contain the URI to Podman
  service

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-06-03 09:54:39 -07:00
Valentin Rothberg dc80267b59 compat handlers: add X-Registry-Auth header support
* Support the `X-Registry-Auth` http-request header.

 * The content of the header is a base64 encoded JSON payload which can
   either be a single auth config or a map of auth configs (user+pw or
   token) with the corresponding registries being the keys.  Vanilla
   Docker, projectatomic Docker and the bindings are transparantly
   supported.

 * Add a hidden `--registries-conf` flag.  Buildah exposes the same
   flag, mostly for testing purposes.

 * Do all credential parsing in the client (i.e., `cmd/podman`) pass
   the username and password in the backend instead of unparsed
   credentials.

 * Add a `pkg/auth` which handles most of the heavy lifting.

 * Go through the authentication-handling code of most commands, bindings
   and endpoints.  Migrate them to the new code and fix issues as seen.
   A final evaluation and more tests is still required *after* this
   change.

 * The manifest-push endpoint is missing certain parameters and should
   use the ABI function instead.  Adding auth-support isn't really
   possible without these parts working.

 * The container commands and endpoints (i.e., create and run) have not
   been changed yet.  The APIs don't yet account for the authfile.

 * Add authentication tests to `pkg/bindings`.

Fixes: #6384
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-05-29 15:39:37 +02:00
Matthew Heon 66cae3209e Fix build on OS X
We disabled the OS X and Windows cross-building tests. This,
predictably, led us to regress a bit in our ability to build for
both of these.

This fixes the build on OS X and fixes one obvious Windows bug.
Unfortunately, we're dragging in all of `pkg/spec` somewhere on
Windows, and things are blowing up spectacularly because of it
(plus a few uses of the `syscall` package in the bindings).

I've giving up for the day. This fixes OS X, but does not fully
enable the cross-build CI (need Windows fixes for that).

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-05-20 18:24:56 -04:00
Daniel J Walsh 69f62a1a9c
default to tunnel without ABISupport tag
When compiling a Linux binary without ABISupport, default to use the
tunnel.  The behaviour is expected in `podman-remote`.

Also set a default for the remote flag so `podman-remote` works OOB.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-05-08 11:09:48 -04:00
Daniel J Walsh 6ed3b8841f
Fix errors found when comparing podman v1 --help versus V2
Mainly add missing commands to podman image, podman containers, podman system

Also fix some informations messages and descriptions.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-05-04 14:16:34 -04:00
Jhon Honce 22d5b2e305 V2 enable ps tests
* Combine cobra.Command helper functions into validate package
  from registry and common packages
* Introduce ChoiceValue for flags

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-04-29 15:51:37 -07:00
OpenShift Merge Robot 99f8cfc2dc
Merge pull request #5956 from jwhonce/wip/version
V2 restore podman -v command
2020-04-29 20:50:43 +02:00
Jhon Honce 6a586992c1 V2 restore podman -v command
* Removed extra spaces and improved error message
* Updated tests to use gomega matchers

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-04-29 09:15:24 -07:00
Jhon Honce a9cc13448e V2 Restore images list tests
* Fix history --quiet formatting
* Fix image inspect --format=json
* Fix image list --sort

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-04-29 08:24:56 -07:00
Brent Baude 517bc28360 system tests must pass
Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-28 15:17:00 -05: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
Brent Baude b6a264464f Enable some testing
Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-17 10:09:32 -05: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