diff options
-rw-r--r-- | cmd/podman/system/varlink.go | 12 | ||||
-rw-r--r-- | contrib/varlink/io.podman.service | 2 | ||||
-rw-r--r-- | docs/source/Commands.rst | 2 | ||||
-rw-r--r-- | docs/source/index.rst | 2 | ||||
-rw-r--r-- | docs/source/markdown/podman-remote.1.md | 2 | ||||
-rw-r--r-- | docs/source/markdown/podman-system-service.1.md | 7 | ||||
-rw-r--r-- | docs/source/markdown/podman-varlink.1.md | 63 | ||||
-rw-r--r-- | docs/source/markdown/podman.1.md | 1 | ||||
-rw-r--r-- | pkg/autoupdate/autoupdate.go | 11 | ||||
-rw-r--r-- | test/apiv2/40-pods.at | 70 |
10 files changed, 92 insertions, 80 deletions
diff --git a/cmd/podman/system/varlink.go b/cmd/podman/system/varlink.go index 19535e539..33a807533 100644 --- a/cmd/podman/system/varlink.go +++ b/cmd/podman/system/varlink.go @@ -16,11 +16,13 @@ var ( Tools speaking varlink protocol can remotely manage pods, containers and images. ` varlinkCmd = &cobra.Command{ - Use: "varlink [flags] [URI]", - Args: cobra.MinimumNArgs(1), - Short: "Run varlink interface", - Long: varlinkDescription, - RunE: varlinkE, + Use: "varlink [flags] [URI]", + Args: cobra.MinimumNArgs(1), + Short: "Run varlink interface", + Long: varlinkDescription, + RunE: varlinkE, + Deprecated: "Please see 'podman system service' for RESTful APIs", + Hidden: true, Example: `podman varlink unix:/run/podman/io.podman podman varlink --time 5000 unix:/run/podman/io.podman`, } diff --git a/contrib/varlink/io.podman.service b/contrib/varlink/io.podman.service index 99d28560d..5be5329f4 100644 --- a/contrib/varlink/io.podman.service +++ b/contrib/varlink/io.podman.service @@ -6,7 +6,7 @@ Documentation=man:podman-varlink(1) [Service] Type=simple -ExecStart=/usr/bin/podman system service --varlink --timeout=60000 unix:%t/podman/io.podman +ExecStart=/usr/bin/podman varlink unix:%t/podman/io.podman --timeout=60000 TimeoutStopSec=30 KillMode=process diff --git a/docs/source/Commands.rst b/docs/source/Commands.rst index e3dbf8ecd..aba29bd82 100644 --- a/docs/source/Commands.rst +++ b/docs/source/Commands.rst @@ -100,8 +100,6 @@ Commands :doc:`unshare <markdown/podman-unshare.1>` Run a command in a modified user namespace -:doc:`varlink <markdown/podman-varlink.1>` Run varlink interface - :doc:`version <markdown/podman-version.1>` Display the Podman Version Information :doc:`volume <volume>` Manage volumes diff --git a/docs/source/index.rst b/docs/source/index.rst index 1c46f1c8a..18a5554ca 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -6,7 +6,7 @@ Podman_ is a daemonless, open source, Linux native tool designed to make it easy Containers under the control of Podman can either be run by root or by a non-privileged user. Podman manages the entire container ecosystem which includes pods, containers, container images, and container volumes using the libpod_ library. Podman specializes in all of the commands and functions that help you to maintain and modify OCI container images, such as pulling and tagging. It allows you to create, run, and maintain those containers and container images in a production environment. -The Podman service runs only on Linux platforms, however a REST API and clients are currently under development which will allow Mac and Windows platforms to call the service. There is currently a Varlink based remote client which runs on Mac or Windows platforms that allows the remote client to talk to the Podman server on a Linux platform. In addition to those clients, there is also a Mac client. NOTE: the Varlink remote client will be deprecated after the REST API is completed. +The Podman service runs only on Linux platforms, however a REST API and clients are currently under development which will allow Mac and Windows platforms to call the service. There is currently a RESTful based remote client which runs on Mac or Windows platforms that allows the remote client to talk to the Podman server on a Linux platform. In addition to those clients, there is also a Mac client. If you are completely new to containers, we recommend that you check out the :doc:`Introduction`. For power users or those comming from Docker, check out our :doc:`Tutorials`. For advanced users and contributors, you can get very detailed information about the Podman CLI by looking our :doc:`Commands` page. Finally, for Developers looking at how to interact with the Podman API, please see our API documentation :doc:`Reference`. diff --git a/docs/source/markdown/podman-remote.1.md b/docs/source/markdown/podman-remote.1.md index a7297f3f2..455631a6e 100644 --- a/docs/source/markdown/podman-remote.1.md +++ b/docs/source/markdown/podman-remote.1.md @@ -17,7 +17,7 @@ Podman uses Buildah(1) internally to create container images. Both tools share i (not container) storage, hence each can use or manipulate images (but not containers) created by the other. -Podman-remote provides a local client interacting with a Podman backend node through a varlink ssh connection. In this context, a Podman node is a Linux system with Podman installed on it and the varlink service activated. Credentials for this session can be passed in using flags, environment variables, or in `podman-remote.conf` +Podman-remote provides a local client interacting with a Podman backend node through a RESTful API tunneled through a ssh connection. In this context, a Podman node is a Linux system with Podman installed on it and the API service activated. Credentials for this session can be passed in using flags, environment variables, or in `podman-remote.conf` **podman [GLOBAL OPTIONS]** diff --git a/docs/source/markdown/podman-system-service.1.md b/docs/source/markdown/podman-system-service.1.md index 48e595641..3ae414f7a 100644 --- a/docs/source/markdown/podman-system-service.1.md +++ b/docs/source/markdown/podman-system-service.1.md @@ -31,13 +31,8 @@ Run an API listening for 5 seconds using the default socket. podman system service --timeout 5000 ``` -Run the podman varlink service with an alternate URI and accept the default timeout. -``` -$ podman system service --varlink unix:/tmp/io.podman -``` - ## SEE ALSO -podman(1), podman-varlink(1) +podman(1), podman-system-service(1), podman-system-connection(1) ## HISTORY January 2020, Originally compiled by Brent Baude<bbaude@redhat.com> diff --git a/docs/source/markdown/podman-varlink.1.md b/docs/source/markdown/podman-varlink.1.md deleted file mode 100644 index 0b04d5ba3..000000000 --- a/docs/source/markdown/podman-varlink.1.md +++ /dev/null @@ -1,63 +0,0 @@ -% podman-varlink(1) - -## NAME -podman\-varlink - Runs the varlink backend interface - -## SYNOPSIS -**podman varlink** [*options*] *uri* - -## DESCRIPTION -Starts the varlink service listening on *uri* that allows varlink clients to interact with podman. If no *uri* is provided, a default -URI will be used depending on the user calling the varlink service. The default for the root user is `unix:/run/podman/io.podman`. Regular -users will have a default *uri* of `$XDG_RUNTIME_DIR/podman/io.podman`. For example, `unix:/run/user/1000/podman/io.podman` -The varlink service should generally be done with systemd. See _Configuration_ below. - - -## OPTIONS - -**--help**, **-h** - - Print usage statement - -**--time**, **-t** - -The time until the varlink session expires in _milliseconds_. The default is 1 -second. A value of `0` means no timeout and the session will not expire. - -## EXAMPLES - -Run the podman varlink service accepting all default options. - -``` -$ podman varlink -``` - - -Run the podman varlink service with an alternate URI and accept the default timeout. - -``` -$ podman varlink unix:/tmp/io.podman -``` - -Run the podman varlink service manually with a 5 second timeout. - -``` -$ podman varlink --timeout 5000 -``` - -## CONFIGURATION - -Users of the podman varlink service should enable the _io.podman.socket_ and _io.podman.service_. -This is the preferred method for running the varlink service. - -You can do this via systemctl. - -``` -$ systemctl enable --now io.podman.socket -``` - -## SEE ALSO -podman(1), systemctl(1) - -## HISTORY -April 2018, Originally compiled by Brent Baude<bbaude@redhat.com> diff --git a/docs/source/markdown/podman.1.md b/docs/source/markdown/podman.1.md index 8dc486b65..2f338452c 100644 --- a/docs/source/markdown/podman.1.md +++ b/docs/source/markdown/podman.1.md @@ -207,7 +207,6 @@ the exit codes follow the `chroot` standard, see below: | [podman-unpause(1)](podman-unpause.1.md) | Unpause one or more containers. | | [podman-unshare(1)](podman-unshare.1.md) | Run a command inside of a modified user namespace. | | [podman-untag(1)](podman-untag.1.md) | Removes one or more names from a locally-stored image. | -| [podman-varlink(1)](podman-varlink.1.md) | Runs the varlink backend interface. | | [podman-version(1)](podman-version.1.md) | Display the Podman version information. | | [podman-volume(1)](podman-volume.1.md) | Simple management tool for volumes. | | [podman-wait(1)](podman-wait.1.md) | Wait on one or more containers to stop and print their exit codes. | diff --git a/pkg/autoupdate/autoupdate.go b/pkg/autoupdate/autoupdate.go index eca5c342c..0ec98d3b6 100644 --- a/pkg/autoupdate/autoupdate.go +++ b/pkg/autoupdate/autoupdate.go @@ -251,8 +251,19 @@ func newerImageAvailable(runtime *libpod.Runtime, img *image.Image, origName str return false, err } + data, err := img.Inspect(context.Background()) + if err != nil { + return false, err + } + sys := runtime.SystemContext() sys.AuthFilePath = options.Authfile + + // We need to account for the arch that the image uses. It seems + // common on ARM to tweak this option to pull the correct image. See + // github.com/containers/libpod/issues/6613. + sys.ArchitectureChoice = data.Architecture + remoteImg, err := remoteRef.NewImage(context.Background(), sys) if err != nil { return false, err diff --git a/test/apiv2/40-pods.at b/test/apiv2/40-pods.at index 2dea1918a..9b8ff04f0 100644 --- a/test/apiv2/40-pods.at +++ b/test/apiv2/40-pods.at @@ -25,6 +25,16 @@ t POST "libpod/pods/create (dup pod)" name=foo 409 \ #t POST libpod/pods/create a=b 400 .cause='bad parameter' # FIXME: unimplemented +t POST libpod/pods/foo/start '' 200 \ + .Errs=null \ + .Id=$pod_id + +t POST libpod/pods/foo/start '' 304 \ + +t POST libpod/pods/fakename/start '' 404 \ + .cause="no such pod" \ + .message="no pod with name or ID fakename found: no such pod" + if root || have_cgroupsv2; then t POST libpod/pods/foo/pause '' 200 else @@ -35,12 +45,72 @@ else fi t POST libpod/pods/foo/unpause '' 200 t POST "libpod/pods/foo/unpause (2nd unpause in a row)" '' 200 +t POST "libpod/pods/fakename/unpause" '' 404\ + .cause="no such pod" \ + .message="no pod with name or ID fakename found: no such pod" + + +t POST libpod/pods/foo/stop '' 200 \ + .Errs=null \ + .Id=$pod_id + t POST "libpod/pods/foo/stop (pod is already stopped)" '' 304 +t POST "libpod/pods/fakename/stop" '' 404\ + .cause="no such pod" \ + .message="no pod with name or ID fakename found: no such pod" + t POST libpod/pods/foo/restart '' 200 \ .Errs=null \ .Id=$pod_id t POST "libpod/pods/bar/restart (restart on nonexistent pod)" '' 404 +t POST libpod/pods/create name=bar 201 .Id~[0-9a-f]\\{64\\} +pod_bar_id=$(jq -r .Id <<<"$output") + +t POST libpod/pods/bar/restart '' 200 \ + .Errs=null \ + .Id=$pod_bar_id + +t GET libpod/pods/bar/json 200 \ + .State=Running + +t POST libpod/pods/bar/restart '' 200 \ + .Errs=null \ + .Id=$pod_bar_id + +t POST "libpod/pods/bar/stop?t=invalid" '' 400 \ + .cause="schema: error converting value for \"t\"" \ + .message~"Failed to parse parameters for" + +podman run -d --pod bar busybox sleep 999 + +t POST libpod/pods/bar/stop?t=1 '' 200 \ + .Errs=null \ + .Id=$pod_bar_id + +t POST libpod/pods/bar/start '' 200 + +t GET libpod/pods/stats?all=true 200 +is $(jq '. | length' <<<"$output") 3 "stats?all=true: number of records found" + +t GET libpod/pods/stats?namesOrIDs=foo 200 +is $(jq '. | length' <<<"$output") 1 "stats?namesOrIDs=foo: number of records found" + +t GET libpod/pods/stats?namesOrIDs=fakename 404 \ + .cause="no such pod" \ + .message="unable to get list of pods: no pod with name or ID fakename found: no such pod" + +t DELETE libpod/pods/bar?force=true 200 + +t GET libpod/pods/foo/top 200 \ + .Processes[0][-1]="/pause " \ + .Titles[-1]="COMMAND" + +t GET libpod/pods/foo/top?ps_args=args,pid 200 \ + .Processes[0][0]="/pause " \ + .Processes[0][1]="1" \ + .Titles[0]="COMMAND" \ + .Titles[1]="PID" \ # FIXME: I'm not sure what 'prune' is supposed to do; as of 20200224 it # just returns 200 (ok) with empty result list. |