summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--RELEASE_NOTES.md3
-rw-r--r--cmd/podman/images/build.go7
-rw-r--r--cmd/podman/machine/init.go4
-rw-r--r--cmd/podman/machine/list.go2
-rw-r--r--cmd/podman/machine/rm.go2
-rw-r--r--cmd/podman/machine/ssh.go6
-rw-r--r--cmd/podman/machine/start.go2
-rw-r--r--cmd/podman/machine/stop.go2
-rw-r--r--cmd/podman/root.go8
-rw-r--r--docs/source/markdown/podman-manifest-add.1.md16
-rw-r--r--docs/source/markdown/podman-manifest-push.1.md36
-rw-r--r--docs/source/markdown/podman.1.md2
-rw-r--r--libpod/container_exec.go27
-rw-r--r--libpod/container_internal_linux.go10
-rw-r--r--libpod/container_validate.go6
-rw-r--r--libpod/oci_conmon_exec_linux.go124
-rw-r--r--libpod/oci_conmon_linux.go120
-rw-r--r--libpod/options.go3
-rw-r--r--pkg/api/server/docs.go12
-rw-r--r--pkg/api/server/register_archive.go8
-rw-r--r--pkg/api/server/register_auth.go2
-rw-r--r--pkg/api/server/register_containers.go96
-rw-r--r--pkg/api/server/register_events.go4
-rw-r--r--pkg/api/server/register_exec.go18
-rw-r--r--pkg/api/server/register_generate.go4
-rw-r--r--pkg/api/server/register_healthcheck.go2
-rw-r--r--pkg/api/server/register_images.go75
-rw-r--r--pkg/api/server/register_info.go4
-rw-r--r--pkg/api/server/register_manifest.go12
-rw-r--r--pkg/api/server/register_networks.go35
-rw-r--r--pkg/api/server/register_ping.go2
-rw-r--r--pkg/api/server/register_play.go2
-rw-r--r--pkg/api/server/register_pods.go28
-rw-r--r--pkg/api/server/register_secrets.go16
-rw-r--r--pkg/api/server/register_system.go17
-rw-r--r--pkg/api/server/register_version.go4
-rw-r--r--pkg/api/server/register_volumes.go22
-rw-r--r--pkg/api/tags.yaml2
-rw-r--r--pkg/bindings/test/networks_test.go72
-rw-r--r--pkg/domain/infra/runtime_libpod.go6
-rw-r--r--pkg/specgen/generate/namespaces.go10
-rw-r--r--test/apiv2/35-networks.at23
-rw-r--r--test/e2e/exec_test.go14
-rw-r--r--test/system/001-basic.bats7
-rw-r--r--test/system/005-info.bats9
-rw-r--r--test/system/070-build.bats5
-rw-r--r--test/system/410-selinux.bats28
47 files changed, 601 insertions, 318 deletions
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md
index 85daba722..5ba5e251b 100644
--- a/RELEASE_NOTES.md
+++ b/RELEASE_NOTES.md
@@ -17,6 +17,9 @@
- The `podman generate kube` command can now generate `PersistentVolumeClaim` YAML for Podman named volumes ([#5788](https://github.com/containers/podman/issues/5788)).
- The `podman generate kube` command can now generate YAML files containing multiple resources (pods or deployments) ([#9129](https://github.com/containers/podman/issues/9129)).
+### Security
+- This release resolves CVE-2021-20291, a deadlock vulnerability in the storage library caused by pulling a specially-crafted container image.
+
### Changes
- The Podman remote client's `podman build` command no longer allows the `-v` flag to be used. Volumes are not yet supported with remote Podman when the client and service are on different machines.
- The `podman kill` and `podman stop` commands now print the name given by the user for each container, instead of the full ID.
diff --git a/cmd/podman/images/build.go b/cmd/podman/images/build.go
index da7f5d862..04fdeab0a 100644
--- a/cmd/podman/images/build.go
+++ b/cmd/podman/images/build.go
@@ -11,6 +11,7 @@ import (
buildahDefine "github.com/containers/buildah/define"
buildahCLI "github.com/containers/buildah/pkg/cli"
"github.com/containers/buildah/pkg/parse"
+ "github.com/containers/common/pkg/auth"
"github.com/containers/common/pkg/completion"
"github.com/containers/common/pkg/config"
encconfig "github.com/containers/ocicrypt/config"
@@ -330,6 +331,12 @@ func buildFlagsWrapperToOptions(c *cobra.Command, contextDir string, flags *buil
pullPolicy = buildahDefine.PullNever
}
+ if c.Flag("authfile").Changed {
+ if err := auth.CheckAuthFile(flags.Authfile); err != nil {
+ return nil, err
+ }
+ }
+
args := make(map[string]string)
if c.Flag("build-arg").Changed {
for _, arg := range flags.BuildArg {
diff --git a/cmd/podman/machine/init.go b/cmd/podman/machine/init.go
index 61261e008..02dfc80aa 100644
--- a/cmd/podman/machine/init.go
+++ b/cmd/podman/machine/init.go
@@ -15,8 +15,8 @@ import (
var (
initCmd = &cobra.Command{
Use: "init [options] [NAME]",
- Short: "initialize a vm",
- Long: "initialize a virtual machine for Podman to run on. Virtual machines are used to run Podman.",
+ Short: "Initialize a virtual machine",
+ Long: "initialize a virtual machine ",
RunE: initMachine,
Args: cobra.MaximumNArgs(1),
Example: `podman machine init myvm`,
diff --git a/cmd/podman/machine/list.go b/cmd/podman/machine/list.go
index 3c8368c6b..ce4129e87 100644
--- a/cmd/podman/machine/list.go
+++ b/cmd/podman/machine/list.go
@@ -28,7 +28,7 @@ var (
Use: "list [options]",
Aliases: []string{"ls"},
Short: "List machines",
- Long: "List Podman managed virtual machines.",
+ Long: "List managed virtual machines.",
RunE: list,
Args: validate.NoArgs,
Example: `podman machine list,
diff --git a/cmd/podman/machine/rm.go b/cmd/podman/machine/rm.go
index e05b5f7a8..0be2ba40c 100644
--- a/cmd/podman/machine/rm.go
+++ b/cmd/podman/machine/rm.go
@@ -19,7 +19,7 @@ var (
rmCmd = &cobra.Command{
Use: "rm [options] [MACHINE]",
Short: "Remove an existing machine",
- Long: "Remove an existing machine ",
+ Long: "Remove a managed virtual machine ",
RunE: rm,
Args: cobra.MaximumNArgs(1),
Example: `podman machine rm myvm`,
diff --git a/cmd/podman/machine/ssh.go b/cmd/podman/machine/ssh.go
index fc7c71992..504fcbe46 100644
--- a/cmd/podman/machine/ssh.go
+++ b/cmd/podman/machine/ssh.go
@@ -14,11 +14,11 @@ import (
var (
sshCmd = &cobra.Command{
Use: "ssh [NAME] [COMMAND [ARG ...]]",
- Short: "SSH into a virtual machine",
- Long: "SSH into a virtual machine ",
+ Short: "SSH into an existing machine",
+ Long: "SSH into a managed virtual machine ",
RunE: ssh,
Example: `podman machine ssh myvm
- podman machine ssh -e myvm echo hello`,
+ podman machine ssh myvm echo hello`,
ValidArgsFunction: autocompleteMachineSSH,
}
)
diff --git a/cmd/podman/machine/start.go b/cmd/podman/machine/start.go
index 959fa21d2..d06e04f41 100644
--- a/cmd/podman/machine/start.go
+++ b/cmd/podman/machine/start.go
@@ -14,7 +14,7 @@ var (
startCmd = &cobra.Command{
Use: "start [MACHINE]",
Short: "Start an existing machine",
- Long: "Start an existing machine ",
+ Long: "Start a managed virtual machine ",
RunE: start,
Args: cobra.MaximumNArgs(1),
Example: `podman machine start myvm`,
diff --git a/cmd/podman/machine/stop.go b/cmd/podman/machine/stop.go
index 36b434d8e..4235b64f1 100644
--- a/cmd/podman/machine/stop.go
+++ b/cmd/podman/machine/stop.go
@@ -14,7 +14,7 @@ var (
stopCmd = &cobra.Command{
Use: "stop [MACHINE]",
Short: "Stop an existing machine",
- Long: "Stop an existing machine ",
+ Long: "Stop a managed virtual machine ",
RunE: stop,
Args: cobra.MaximumNArgs(1),
Example: `podman machine stop myvm`,
diff --git a/cmd/podman/root.go b/cmd/podman/root.go
index 2b77afbeb..4527c2646 100644
--- a/cmd/podman/root.go
+++ b/cmd/podman/root.go
@@ -180,6 +180,10 @@ func persistentPreRunE(cmd *cobra.Command, args []string) error {
os.Setenv("TMPDIR", "/var/tmp")
}
+ context := cmd.Root().LocalFlags().Lookup("context")
+ if context.Value.String() != "default" {
+ return errors.New("Podman does not support swarm, the only --context value allowed is \"default\"")
+ }
if !registry.IsRemote() {
if cmd.Flag("cpu-profile").Changed {
f, err := os.Create(cfg.CPUProfile)
@@ -269,6 +273,10 @@ func rootFlags(cmd *cobra.Command, opts *entities.PodmanConfig) {
lFlags.StringVar(&opts.URI, urlFlagName, uri, "URL to access Podman service (CONTAINER_HOST)")
_ = cmd.RegisterFlagCompletionFunc(urlFlagName, completion.AutocompleteDefault)
+ // Context option added just for compatibility with DockerCLI.
+ lFlags.String("context", "default", "Name of the context to use to connect to the daemon (This flag is a NOOP and provided solely for scripting compatibility.)")
+ _ = lFlags.MarkHidden("context")
+
identityFlagName := "identity"
lFlags.StringVar(&opts.Identity, identityFlagName, ident, "path to SSH identity file, (CONTAINER_SSHKEY)")
_ = cmd.RegisterFlagCompletionFunc(identityFlagName, completion.AutocompleteDefault)
diff --git a/docs/source/markdown/podman-manifest-add.1.md b/docs/source/markdown/podman-manifest-add.1.md
index c3c1ea1cf..2727843da 100644
--- a/docs/source/markdown/podman-manifest-add.1.md
+++ b/docs/source/markdown/podman-manifest-add.1.md
@@ -4,7 +4,7 @@
podman\-manifest\-add - Add an image to a manifest list or image index
## SYNOPSIS
-**podman manifest add** [*options*] *listnameorindexname* *imagename*
+**podman manifest add** [*options*] *listnameorindexname* [*transport*]:*imagename*
## DESCRIPTION
@@ -79,6 +79,20 @@ Specify the variant which the list or index records for the image. This option
is typically used to distinguish between multiple entries which share the same
architecture value, but which expect different versions of its instruction set.
+## Transport
+
+ Multiple transports are supported:
+
+ **docker://**_docker-reference_ _(default)_
+ An image in a registry implementing the "Docker Registry HTTP API V2". By default, uses the authorization state in `$XDG_RUNTIME_DIR/containers/auth.json`, which is set using `(podman login)`. If the authorization state is not found there, `$HOME/.docker/config.json` is checked, which is set using `(docker login)`.
+
+ $ podman manifest add mylist:v1.11 docker://quay.io/username/myimage
+
+ **containers-storage:**_oci-reference_
+ An image in _oci-reference_ format stored in the local container storage. _oci-reference_ must contain a tag.
+
+ $ podman manifest add mylist:v1.11 containers-storage:quay.io/username/myimage
+
## EXAMPLE
```
diff --git a/docs/source/markdown/podman-manifest-push.1.md b/docs/source/markdown/podman-manifest-push.1.md
index 4e7118dad..5236dd7c3 100644
--- a/docs/source/markdown/podman-manifest-push.1.md
+++ b/docs/source/markdown/podman-manifest-push.1.md
@@ -4,7 +4,7 @@
podman\-manifest\-push - Push a manifest list or image index to a registry
## SYNOPSIS
-**podman manifest push** [*options*] *listnameorindexname* *transport:details*
+**podman manifest push** [*options*] *listnameorindexname* [*destination*]
## DESCRIPTION
Pushes a manifest list or image index to a registry.
@@ -66,6 +66,40 @@ Sign the pushed images using the GPG key that matches the specified fingerprint.
Require HTTPS and verify certificates when talking to container registries. (defaults to true)
+## DESTINATION
+
+ The DESTINATION is a location to store container images
+ The Image "DESTINATION" uses a "transport":"details" format.
+ If a transport is not given, podman push will attempt to push
+ to a registry.
+
+ Multiple transports are supported:
+
+ **dir:**_path_
+ An existing local directory _path_ storing the manifest, layer tarballs and signatures as individual files. This is a non-standardized format, primarily useful for debugging or noninvasive container inspection.
+
+ $ podman manfiest push mylist:v1.11 dir:/tmp/mylist
+
+ **docker://**_docker-reference_
+ An image in a registry implementing the "Docker Registry HTTP API V2". By default, uses the authorization state in `$XDG_RUNTIME_DIR/containers/auth.json`, which is set using `(podman login)`. If the authorization state is not found there, `$HOME/.docker/config.json` is checked, which is set using `(docker login)`.
+
+ $ podman manfiest push mylist:v1.11 docker://registry.example.org/mylist:v1.11
+
+ **docker-archive:**_path_[**:**_docker-reference_]
+ An image is stored in the `docker save` formatted file. _docker-reference_ is only used when creating such a file, and it must not contain a digest.
+
+ $ podman manfiest push mylist:v1.11 docker-archive:/tmp/mylist
+
+ **docker-daemon:**_docker-reference_
+ An image in _docker-reference_ format stored in the docker daemon internal storage. _docker-reference_ must contain a tag.
+
+ $ podman manfiest push mylist:v1.11 docker-daemon:registry.example.org/mylist:v1.11
+
+ **oci-archive:**_path_**:**_tag_
+ An image _tag_ in a directory compliant with "Open Container Image Layout Specification" at _path_.
+
+ $ podman manifest push mylist:v1.11 oci-archive:/tmp/mylist
+
## EXAMPLE
```
diff --git a/docs/source/markdown/podman.1.md b/docs/source/markdown/podman.1.md
index 7a6a51c39..5755b45ac 100644
--- a/docs/source/markdown/podman.1.md
+++ b/docs/source/markdown/podman.1.md
@@ -148,7 +148,7 @@ specify additional options via the `--storage-opt` flag.
#### **\-\-storage-opt**=*value*
-Storage driver option, Default storage driver options are configured in /etc/containers/storage.conf (`$HOME/.config/containers/storage.conf` in rootless mode). The `STORAGE_OPTS` environment variable overrides the default. The --storage-opt specified options overrides all.
+Storage driver option, Default storage driver options are configured in /etc/containers/storage.conf (`$HOME/.config/containers/storage.conf` in rootless mode). The `STORAGE_OPTS` environment variable overrides the default. The --storage-opt specified options overrides all. If you specify --storage-opt="", no storage options will be used.
#### **\-\-syslog**=*true|false*
diff --git a/libpod/container_exec.go b/libpod/container_exec.go
index bb43287d9..8d8ed14aa 100644
--- a/libpod/container_exec.go
+++ b/libpod/container_exec.go
@@ -696,6 +696,24 @@ func (c *Container) ExecResize(sessionID string, newSize define.TerminalSize) er
return errors.Wrapf(define.ErrExecSessionStateInvalid, "cannot resize container %s exec session %s as it is not running", c.ID(), session.ID())
}
+ // The exec session may have exited since we last updated.
+ // Needed to prevent race conditions around short-running exec sessions.
+ running, err := c.ociRuntime.ExecUpdateStatus(c, session.ID())
+ if err != nil {
+ return err
+ }
+ if !running {
+ session.State = define.ExecStateStopped
+
+ if err := c.save(); err != nil {
+ logrus.Errorf("Error saving state of container %s: %v", c.ID(), err)
+ }
+
+ return errors.Wrapf(define.ErrExecSessionStateInvalid, "cannot resize container %s exec session %s as it has stopped", c.ID(), session.ID())
+ }
+
+ // Make sure the exec session is still running.
+
return c.ociRuntime.ExecAttachResize(c, sessionID, newSize)
}
@@ -720,8 +738,13 @@ func (c *Container) Exec(config *ExecConfig, streams *define.AttachStreams, resi
logrus.Debugf("Sending resize events to exec session %s", sessionID)
for resizeRequest := range resize {
if err := c.ExecResize(sessionID, resizeRequest); err != nil {
- // Assume the exec session went down.
- logrus.Warnf("Error resizing exec session %s: %v", sessionID, err)
+ if errors.Cause(err) == define.ErrExecSessionStateInvalid {
+ // The exec session stopped
+ // before we could resize.
+ logrus.Infof("Missed resize on exec session %s, already stopped", sessionID)
+ } else {
+ logrus.Warnf("Error resizing exec session %s: %v", sessionID, err)
+ }
return
}
}
diff --git a/libpod/container_internal_linux.go b/libpod/container_internal_linux.go
index d167bf188..4fc45e4f0 100644
--- a/libpod/container_internal_linux.go
+++ b/libpod/container_internal_linux.go
@@ -376,8 +376,14 @@ func (c *Container) generateSpec(ctx context.Context) (*spec.Spec, error) {
case "z":
fallthrough
case "Z":
- if err := label.Relabel(m.Source, c.MountLabel(), label.IsShared(o)); err != nil {
- return nil, err
+ if c.MountLabel() != "" {
+ if c.ProcessLabel() != "" {
+ if err := label.Relabel(m.Source, c.MountLabel(), label.IsShared(o)); err != nil {
+ return nil, err
+ }
+ } else {
+ logrus.Infof("Not relabeling volume %q in container %s as SELinux is disabled", m.Source, c.ID())
+ }
}
default:
diff --git a/libpod/container_validate.go b/libpod/container_validate.go
index 245121a91..aae96ae85 100644
--- a/libpod/container_validate.go
+++ b/libpod/container_validate.go
@@ -126,5 +126,11 @@ func (c *Container) validate() error {
}
}
+ // If User in the OCI spec is set, require that c.config.User is set for
+ // security reasons (a lot of our code relies on c.config.User).
+ if c.config.User == "" && (c.config.Spec.Process.User.UID != 0 || c.config.Spec.Process.User.GID != 0) {
+ return errors.Wrapf(define.ErrInvalidArg, "please set User explicitly via WithUser() instead of in OCI spec directly")
+ }
+
return nil
}
diff --git a/libpod/oci_conmon_exec_linux.go b/libpod/oci_conmon_exec_linux.go
index 173edba2b..b43316951 100644
--- a/libpod/oci_conmon_exec_linux.go
+++ b/libpod/oci_conmon_exec_linux.go
@@ -2,18 +2,23 @@ package libpod
import (
"fmt"
+ "io/ioutil"
"net/http"
"os"
"os/exec"
"path/filepath"
+ "strings"
"syscall"
"time"
+ "github.com/containers/common/pkg/capabilities"
"github.com/containers/common/pkg/config"
"github.com/containers/podman/v3/libpod/define"
"github.com/containers/podman/v3/pkg/errorhandling"
+ "github.com/containers/podman/v3/pkg/lookup"
"github.com/containers/podman/v3/pkg/util"
"github.com/containers/podman/v3/utils"
+ spec "github.com/opencontainers/runtime-spec/specs-go"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"golang.org/x/sys/unix"
@@ -654,3 +659,122 @@ func attachExecHTTP(c *Container, sessionID string, r *http.Request, w http.Resp
}
}
}
+
+// prepareProcessExec returns the path of the process.json used in runc exec -p
+// caller is responsible to close the returned *os.File if needed.
+func prepareProcessExec(c *Container, options *ExecOptions, env []string, sessionID string) (*os.File, error) {
+ f, err := ioutil.TempFile(c.execBundlePath(sessionID), "exec-process-")
+ if err != nil {
+ return nil, err
+ }
+ pspec := new(spec.Process)
+ if err := JSONDeepCopy(c.config.Spec.Process, pspec); err != nil {
+ return nil, err
+ }
+ pspec.SelinuxLabel = c.config.ProcessLabel
+ pspec.Args = options.Cmd
+
+ // We need to default this to false else it will inherit terminal as true
+ // from the container.
+ pspec.Terminal = false
+ if options.Terminal {
+ pspec.Terminal = true
+ }
+ if len(env) > 0 {
+ pspec.Env = append(pspec.Env, env...)
+ }
+
+ if options.Cwd != "" {
+ pspec.Cwd = options.Cwd
+ }
+
+ var addGroups []string
+ var sgids []uint32
+
+ // if the user is empty, we should inherit the user that the container is currently running with
+ user := options.User
+ if user == "" {
+ logrus.Debugf("Set user to %s", c.config.User)
+ user = c.config.User
+ addGroups = c.config.Groups
+ }
+
+ overrides := c.getUserOverrides()
+ execUser, err := lookup.GetUserGroupInfo(c.state.Mountpoint, user, overrides)
+ if err != nil {
+ return nil, err
+ }
+
+ if len(addGroups) > 0 {
+ sgids, err = lookup.GetContainerGroups(addGroups, c.state.Mountpoint, overrides)
+ if err != nil {
+ return nil, errors.Wrapf(err, "error looking up supplemental groups for container %s exec session %s", c.ID(), sessionID)
+ }
+ }
+
+ // If user was set, look it up in the container to get a UID to use on
+ // the host
+ if user != "" || len(sgids) > 0 {
+ if user != "" {
+ for _, sgid := range execUser.Sgids {
+ sgids = append(sgids, uint32(sgid))
+ }
+ }
+ processUser := spec.User{
+ UID: uint32(execUser.Uid),
+ GID: uint32(execUser.Gid),
+ AdditionalGids: sgids,
+ }
+
+ pspec.User = processUser
+ }
+
+ ctrSpec, err := c.specFromState()
+ if err != nil {
+ return nil, err
+ }
+
+ allCaps, err := capabilities.BoundingSet()
+ if err != nil {
+ return nil, err
+ }
+ if options.Privileged {
+ pspec.Capabilities.Bounding = allCaps
+ } else {
+ pspec.Capabilities.Bounding = ctrSpec.Process.Capabilities.Bounding
+ }
+ if execUser.Uid == 0 {
+ pspec.Capabilities.Effective = pspec.Capabilities.Bounding
+ pspec.Capabilities.Inheritable = pspec.Capabilities.Bounding
+ pspec.Capabilities.Permitted = pspec.Capabilities.Bounding
+ pspec.Capabilities.Ambient = pspec.Capabilities.Bounding
+ } else {
+ if user == c.config.User {
+ pspec.Capabilities.Effective = ctrSpec.Process.Capabilities.Effective
+ pspec.Capabilities.Inheritable = ctrSpec.Process.Capabilities.Effective
+ pspec.Capabilities.Permitted = ctrSpec.Process.Capabilities.Effective
+ pspec.Capabilities.Ambient = ctrSpec.Process.Capabilities.Effective
+ }
+ }
+
+ hasHomeSet := false
+ for _, s := range pspec.Env {
+ if strings.HasPrefix(s, "HOME=") {
+ hasHomeSet = true
+ break
+ }
+ }
+ if !hasHomeSet {
+ pspec.Env = append(pspec.Env, fmt.Sprintf("HOME=%s", execUser.Home))
+ }
+
+ processJSON, err := json.Marshal(pspec)
+ if err != nil {
+ return nil, err
+ }
+
+ if err := ioutil.WriteFile(f.Name(), processJSON, 0644); err != nil {
+ return nil, err
+ }
+ return f, nil
+}
diff --git a/libpod/oci_conmon_linux.go b/libpod/oci_conmon_linux.go
index 1c7089e5d..f26ca67ce 100644
--- a/libpod/oci_conmon_linux.go
+++ b/libpod/oci_conmon_linux.go
@@ -22,7 +22,6 @@ import (
"text/template"
"time"
- "github.com/containers/common/pkg/capabilities"
"github.com/containers/common/pkg/config"
conmonConfig "github.com/containers/conmon/runner/config"
"github.com/containers/podman/v3/libpod/define"
@@ -30,7 +29,6 @@ import (
"github.com/containers/podman/v3/pkg/cgroups"
"github.com/containers/podman/v3/pkg/checkpoint/crutils"
"github.com/containers/podman/v3/pkg/errorhandling"
- "github.com/containers/podman/v3/pkg/lookup"
"github.com/containers/podman/v3/pkg/rootless"
"github.com/containers/podman/v3/pkg/util"
"github.com/containers/podman/v3/utils"
@@ -1195,124 +1193,6 @@ func (r *ConmonOCIRuntime) createOCIContainer(ctr *Container, restoreOptions *Co
return nil
}
-// prepareProcessExec returns the path of the process.json used in runc exec -p
-// caller is responsible to close the returned *os.File if needed.
-func prepareProcessExec(c *Container, options *ExecOptions, env []string, sessionID string) (*os.File, error) {
- f, err := ioutil.TempFile(c.execBundlePath(sessionID), "exec-process-")
- if err != nil {
- return nil, err
- }
- pspec := new(spec.Process)
- if err := JSONDeepCopy(c.config.Spec.Process, pspec); err != nil {
- return nil, err
- }
- pspec.SelinuxLabel = c.config.ProcessLabel
- pspec.Args = options.Cmd
-
- // We need to default this to false else it will inherit terminal as true
- // from the container.
- pspec.Terminal = false
- if options.Terminal {
- pspec.Terminal = true
- }
- if len(env) > 0 {
- pspec.Env = append(pspec.Env, env...)
- }
-
- if options.Cwd != "" {
- pspec.Cwd = options.Cwd
- }
-
- var addGroups []string
- var sgids []uint32
-
- // if the user is empty, we should inherit the user that the container is currently running with
- user := options.User
- if user == "" {
- user = c.config.User
- addGroups = c.config.Groups
- }
-
- overrides := c.getUserOverrides()
- execUser, err := lookup.GetUserGroupInfo(c.state.Mountpoint, user, overrides)
- if err != nil {
- return nil, err
- }
-
- if len(addGroups) > 0 {
- sgids, err = lookup.GetContainerGroups(addGroups, c.state.Mountpoint, overrides)
- if err != nil {
- return nil, errors.Wrapf(err, "error looking up supplemental groups for container %s exec session %s", c.ID(), sessionID)
- }
- }
-
- // If user was set, look it up in the container to get a UID to use on
- // the host
- if user != "" || len(sgids) > 0 {
- if user != "" {
- for _, sgid := range execUser.Sgids {
- sgids = append(sgids, uint32(sgid))
- }
- }
- processUser := spec.User{
- UID: uint32(execUser.Uid),
- GID: uint32(execUser.Gid),
- AdditionalGids: sgids,
- }
-
- pspec.User = processUser
- }
-
- ctrSpec, err := c.specFromState()
- if err != nil {
- return nil, err
- }
-
- allCaps, err := capabilities.BoundingSet()
- if err != nil {
- return nil, err
- }
- if options.Privileged {
- pspec.Capabilities.Bounding = allCaps
- } else {
- pspec.Capabilities.Bounding = ctrSpec.Process.Capabilities.Bounding
- }
- if execUser.Uid == 0 {
- pspec.Capabilities.Effective = pspec.Capabilities.Bounding
- pspec.Capabilities.Inheritable = pspec.Capabilities.Bounding
- pspec.Capabilities.Permitted = pspec.Capabilities.Bounding
- pspec.Capabilities.Ambient = pspec.Capabilities.Bounding
- } else {
- if user == c.config.User {
- pspec.Capabilities.Effective = ctrSpec.Process.Capabilities.Effective
- pspec.Capabilities.Inheritable = ctrSpec.Process.Capabilities.Effective
- pspec.Capabilities.Permitted = ctrSpec.Process.Capabilities.Effective
- pspec.Capabilities.Ambient = ctrSpec.Process.Capabilities.Effective
- }
- }
-
- hasHomeSet := false
- for _, s := range pspec.Env {
- if strings.HasPrefix(s, "HOME=") {
- hasHomeSet = true
- break
- }
- }
- if !hasHomeSet {
- pspec.Env = append(pspec.Env, fmt.Sprintf("HOME=%s", execUser.Home))
- }
-
- processJSON, err := json.Marshal(pspec)
- if err != nil {
- return nil, err
- }
-
- if err := ioutil.WriteFile(f.Name(), processJSON, 0644); err != nil {
- return nil, err
- }
- return f, nil
-}
-
// configureConmonEnv gets the environment values to add to conmon's exec struct
// TODO this may want to be less hardcoded/more configurable in the future
func (r *ConmonOCIRuntime) configureConmonEnv(ctr *Container, runtimeDir string) ([]string, []*os.File) {
diff --git a/libpod/options.go b/libpod/options.go
index 24e9d74f4..333a7c4a5 100644
--- a/libpod/options.go
+++ b/libpod/options.go
@@ -77,8 +77,7 @@ func WithStorageConfig(config storage.StoreOptions) RuntimeOption {
rt.storageConfig.GraphDriverOptions = make([]string, len(config.GraphDriverOptions))
copy(rt.storageConfig.GraphDriverOptions, config.GraphDriverOptions)
} else {
- // append new options after what is specified in the config files
- rt.storageConfig.GraphDriverOptions = append(rt.storageConfig.GraphDriverOptions, config.GraphDriverOptions...)
+ rt.storageConfig.GraphDriverOptions = config.GraphDriverOptions
}
setField = true
}
diff --git a/pkg/api/server/docs.go b/pkg/api/server/docs.go
index a99fefd7b..e72b78221 100644
--- a/pkg/api/server/docs.go
+++ b/pkg/api/server/docs.go
@@ -1,4 +1,4 @@
-// Package api Provides a container compatible interface.
+// Package api Provides an API for the Libpod library
//
// This documentation describes the Podman v2.0 RESTful API.
// It replaces the Podman v1.0 API and was initially delivered
@@ -21,22 +21,22 @@
//
// 'podman info'
//
-// curl --unix-socket /run/podman/podman.sock http://d/v1.0.0/libpod/info
+// curl --unix-socket /run/podman/podman.sock http://d/v3.0.0/libpod/info
//
// 'podman pull quay.io/containers/podman'
//
-// curl -XPOST --unix-socket /run/podman/podman.sock -v 'http://d/v1.0.0/images/create?fromImage=quay.io%2Fcontainers%2Fpodman'
+// curl -XPOST --unix-socket /run/podman/podman.sock -v 'http://d/v3.0.0/images/create?fromImage=quay.io%2Fcontainers%2Fpodman'
//
// 'podman list images'
//
-// curl --unix-socket /run/podman/podman.sock -v 'http://d/v1.0.0/libpod/images/json' | jq
+// curl --unix-socket /run/podman/podman.sock -v 'http://d/v3.0.0/libpod/images/json' | jq
//
// Terms Of Service:
//
// Schemes: http, https
// Host: podman.io
// BasePath: /
-// Version: 0.0.1
+// Version: 3.2.0
// License: Apache-2.0 https://opensource.org/licenses/Apache-2.0
// Contact: Podman <podman@lists.podman.io> https://podman.io/community/
//
@@ -47,8 +47,8 @@
//
// Produces:
// - application/json
+// - application/octet-stream
// - text/plain
-// - text/html
//
// Consumes:
// - application/json
diff --git a/pkg/api/server/register_archive.go b/pkg/api/server/register_archive.go
index 2ac126644..ee7449fbb 100644
--- a/pkg/api/server/register_archive.go
+++ b/pkg/api/server/register_archive.go
@@ -8,7 +8,7 @@ import (
)
func (s *APIServer) registerArchiveHandlers(r *mux.Router) error {
- // swagger:operation PUT /containers/{name}/archive compat putArchive
+ // swagger:operation PUT /containers/{name}/archive compat PutContainerArchive
// ---
// summary: Put files into a container
// description: Put a tar archive of files into a container
@@ -52,7 +52,7 @@ func (s *APIServer) registerArchiveHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
- // swagger:operation GET /containers/{name}/archive compat getArchive
+ // swagger:operation GET /containers/{name}/archive compat ContainerArchive
// ---
// summary: Get files from a container
// description: Get a tar archive of files from a container
@@ -91,7 +91,7 @@ func (s *APIServer) registerArchiveHandlers(r *mux.Router) error {
Libpod
*/
- // swagger:operation PUT /libpod/containers/{name}/archive libpod libpodPutArchive
+ // swagger:operation PUT /libpod/containers/{name}/archive libpod PutContainerArchiveLibpod
// ---
// summary: Copy files into a container
// description: Copy a tar archive of files into a container
@@ -132,7 +132,7 @@ func (s *APIServer) registerArchiveHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
- // swagger:operation GET /libpod/containers/{name}/archive libpod libpodGetArchive
+ // swagger:operation GET /libpod/containers/{name}/archive libpod ContainerArchiveLibpod
// ---
// summary: Copy files from a container
// description: Copy a tar archive of files from a container
diff --git a/pkg/api/server/register_auth.go b/pkg/api/server/register_auth.go
index 56e115e30..c07337653 100644
--- a/pkg/api/server/register_auth.go
+++ b/pkg/api/server/register_auth.go
@@ -8,7 +8,7 @@ import (
)
func (s *APIServer) registerAuthHandlers(r *mux.Router) error {
- // swagger:operation POST /auth compat auth
+ // swagger:operation POST /auth compat SystemAuth
// ---
// summary: Check auth configuration
// tags:
diff --git a/pkg/api/server/register_containers.go b/pkg/api/server/register_containers.go
index b379d52ce..3bf3e4e11 100644
--- a/pkg/api/server/register_containers.go
+++ b/pkg/api/server/register_containers.go
@@ -9,7 +9,7 @@ import (
)
func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
- // swagger:operation POST /containers/create compat createContainer
+ // swagger:operation POST /containers/create compat ContainerCreate
// ---
// summary: Create a container
// tags:
@@ -35,7 +35,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
r.HandleFunc(VersionedPath("/containers/create"), s.APIHandler(compat.CreateContainer)).Methods(http.MethodPost)
// Added non version path to URI to support docker non versioned paths
r.HandleFunc("/containers/create", s.APIHandler(compat.CreateContainer)).Methods(http.MethodPost)
- // swagger:operation GET /containers/json compat listContainers
+ // swagger:operation GET /containers/json compat ContainerList
// ---
// tags:
// - containers (compat)
@@ -92,7 +92,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
r.HandleFunc(VersionedPath("/containers/json"), s.APIHandler(compat.ListContainers)).Methods(http.MethodGet)
// Added non version path to URI to support docker non versioned paths
r.HandleFunc("/containers/json", s.APIHandler(compat.ListContainers)).Methods(http.MethodGet)
- // swagger:operation POST /containers/prune compat pruneContainers
+ // swagger:operation POST /containers/prune compat ContainerPrune
// ---
// tags:
// - containers (compat)
@@ -116,7 +116,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
r.HandleFunc(VersionedPath("/containers/prune"), s.APIHandler(compat.PruneContainers)).Methods(http.MethodPost)
// Added non version path to URI to support docker non versioned paths
r.HandleFunc("/containers/prune", s.APIHandler(compat.PruneContainers)).Methods(http.MethodPost)
- // swagger:operation DELETE /containers/{name} compat removeContainer
+ // swagger:operation DELETE /containers/{name} compat ContainerDelete
// ---
// tags:
// - containers (compat)
@@ -157,7 +157,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
r.HandleFunc(VersionedPath("/containers/{name}"), s.APIHandler(compat.RemoveContainer)).Methods(http.MethodDelete)
// Added non version path to URI to support docker non versioned paths
r.HandleFunc("/containers/{name}", s.APIHandler(compat.RemoveContainer)).Methods(http.MethodDelete)
- // swagger:operation GET /containers/{name}/json compat getContainer
+ // swagger:operation GET /containers/{name}/json compat ContainerInspect
// ---
// tags:
// - containers (compat)
@@ -186,7 +186,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
r.HandleFunc(VersionedPath("/containers/{name}/json"), s.APIHandler(compat.GetContainer)).Methods(http.MethodGet)
// Added non version path to URI to support docker non versioned paths
r.HandleFunc("/containers/{name}/json", s.APIHandler(compat.GetContainer)).Methods(http.MethodGet)
- // swagger:operation POST /containers/{name}/kill compat killContainer
+ // swagger:operation POST /containers/{name}/kill compat ContainerKill
// ---
// tags:
// - containers (compat)
@@ -223,7 +223,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
r.HandleFunc(VersionedPath("/containers/{name}/kill"), s.APIHandler(compat.KillContainer)).Methods(http.MethodPost)
// Added non version path to URI to support docker non versioned paths
r.HandleFunc("/containers/{name}/kill", s.APIHandler(compat.KillContainer)).Methods(http.MethodPost)
- // swagger:operation GET /containers/{name}/logs compat logsFromContainer
+ // swagger:operation GET /containers/{name}/logs compat ContainerLogs
// ---
// tags:
// - containers (compat)
@@ -277,7 +277,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
r.HandleFunc(VersionedPath("/containers/{name}/logs"), s.APIHandler(compat.LogsFromContainer)).Methods(http.MethodGet)
// Added non version path to URI to support docker non versioned paths
r.HandleFunc("/containers/{name}/logs", s.APIHandler(compat.LogsFromContainer)).Methods(http.MethodGet)
- // swagger:operation POST /containers/{name}/pause compat pauseContainer
+ // swagger:operation POST /containers/{name}/pause compat ContainerPause
// ---
// tags:
// - containers (compat)
@@ -301,7 +301,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
r.HandleFunc(VersionedPath("/containers/{name}/pause"), s.APIHandler(compat.PauseContainer)).Methods(http.MethodPost)
// Added non version path to URI to support docker non versioned paths
r.HandleFunc("/containers/{name}/pause", s.APIHandler(compat.PauseContainer)).Methods(http.MethodPost)
- // swagger:operation POST /containers/{name}/restart compat restartContainer
+ // swagger:operation POST /containers/{name}/restart compat ContainerRestart
// ---
// tags:
// - containers (compat)
@@ -328,7 +328,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
r.HandleFunc(VersionedPath("/containers/{name}/restart"), s.APIHandler(compat.RestartContainer)).Methods(http.MethodPost)
// Added non version path to URI to support docker non versioned paths
r.HandleFunc("/containers/{name}/restart", s.APIHandler(compat.RestartContainer)).Methods(http.MethodPost)
- // swagger:operation POST /containers/{name}/start compat startContainer
+ // swagger:operation POST /containers/{name}/start compat ContainerStart
// ---
// tags:
// - containers (compat)
@@ -358,7 +358,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
r.HandleFunc(VersionedPath("/containers/{name}/start"), s.APIHandler(compat.StartContainer)).Methods(http.MethodPost)
// Added non version path to URI to support docker non versioned paths
r.HandleFunc("/containers/{name}/start", s.APIHandler(compat.StartContainer)).Methods(http.MethodPost)
- // swagger:operation GET /containers/{name}/stats compat statsContainer
+ // swagger:operation GET /containers/{name}/stats compat ContainerStats
// ---
// tags:
// - containers (compat)
@@ -387,7 +387,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
r.HandleFunc(VersionedPath("/containers/{name}/stats"), s.APIHandler(compat.StatsContainer)).Methods(http.MethodGet)
// Added non version path to URI to support docker non versioned paths
r.HandleFunc("/containers/{name}/stats", s.APIHandler(compat.StatsContainer)).Methods(http.MethodGet)
- // swagger:operation POST /containers/{name}/stop compat stopContainer
+ // swagger:operation POST /containers/{name}/stop compat ContainerStop
// ---
// tags:
// - containers (compat)
@@ -417,7 +417,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
r.HandleFunc(VersionedPath("/containers/{name}/stop"), s.APIHandler(compat.StopContainer)).Methods(http.MethodPost)
// Added non version path to URI to support docker non versioned paths
r.HandleFunc("/containers/{name}/stop", s.APIHandler(compat.StopContainer)).Methods(http.MethodPost)
- // swagger:operation GET /containers/{name}/top compat topContainer
+ // swagger:operation GET /containers/{name}/top compat ContainerTop
// ---
// tags:
// - containers (compat)
@@ -444,7 +444,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
r.HandleFunc(VersionedPath("/containers/{name}/top"), s.APIHandler(compat.TopContainer)).Methods(http.MethodGet)
// Added non version path to URI to support docker non versioned paths
r.HandleFunc("/containers/{name}/top", s.APIHandler(compat.TopContainer)).Methods(http.MethodGet)
- // swagger:operation POST /containers/{name}/unpause compat unpauseContainer
+ // swagger:operation POST /containers/{name}/unpause compat ContainerUnpause
// ---
// tags:
// - containers (compat)
@@ -468,7 +468,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
r.HandleFunc(VersionedPath("/containers/{name}/unpause"), s.APIHandler(compat.UnpauseContainer)).Methods(http.MethodPost)
// Added non version path to URI to support docker non versioned paths
r.HandleFunc("/containers/{name}/unpause", s.APIHandler(compat.UnpauseContainer)).Methods(http.MethodPost)
- // swagger:operation POST /containers/{name}/wait compat waitContainer
+ // swagger:operation POST /containers/{name}/wait compat ContainerWait
// ---
// tags:
// - containers (compat)
@@ -508,7 +508,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
r.HandleFunc(VersionedPath("/containers/{name}/wait"), s.APIHandler(compat.WaitContainer)).Methods(http.MethodPost)
// Added non version path to URI to support docker non versioned paths
r.HandleFunc("/containers/{name}/wait", s.APIHandler(compat.WaitContainer)).Methods(http.MethodPost)
- // swagger:operation POST /containers/{name}/attach compat attachContainer
+ // swagger:operation POST /containers/{name}/attach compat ContainerAttach
// ---
// tags:
// - containers (compat)
@@ -565,7 +565,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
r.HandleFunc(VersionedPath("/containers/{name}/attach"), s.APIHandler(compat.AttachContainer)).Methods(http.MethodPost)
// Added non version path to URI to support docker non versioned paths
r.HandleFunc("/containers/{name}/attach", s.APIHandler(compat.AttachContainer)).Methods(http.MethodPost)
- // swagger:operation POST /containers/{name}/resize compat resizeContainer
+ // swagger:operation POST /containers/{name}/resize compat ContainerResize
// ---
// tags:
// - containers (compat)
@@ -604,7 +604,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
r.HandleFunc(VersionedPath("/containers/{name}/resize"), s.APIHandler(compat.ResizeTTY)).Methods(http.MethodPost)
// Added non version path to URI to support docker non versioned paths
r.HandleFunc("/containers/{name}/resize", s.APIHandler(compat.ResizeTTY)).Methods(http.MethodPost)
- // swagger:operation GET /containers/{name}/export compat exportContainer
+ // swagger:operation GET /containers/{name}/export compat ContainerExport
// ---
// tags:
// - containers (compat)
@@ -627,7 +627,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/containers/{name}/export"), s.APIHandler(compat.ExportContainer)).Methods(http.MethodGet)
r.HandleFunc("/containers/{name}/export", s.APIHandler(compat.ExportContainer)).Methods(http.MethodGet)
- // swagger:operation POST /containers/{name}/rename compat renameContainer
+ // swagger:operation POST /containers/{name}/rename compat ContainerRename
// ---
// tags:
// - containers (compat)
@@ -662,7 +662,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
libpod endpoints
*/
- // swagger:operation POST /libpod/containers/create libpod libpodCreateContainer
+ // swagger:operation POST /libpod/containers/create libpod ContainerCreateLibpod
// ---
// summary: Create a container
// tags:
@@ -687,7 +687,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/containers/create"), s.APIHandler(libpod.CreateContainer)).Methods(http.MethodPost)
- // swagger:operation GET /libpod/containers/json libpod libpodListContainers
+ // swagger:operation GET /libpod/containers/json libpod ContainerListLibpod
// ---
// tags:
// - containers
@@ -752,7 +752,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/containers/json"), s.APIHandler(libpod.ListContainers)).Methods(http.MethodGet)
- // swagger:operation POST /libpod/containers/prune libpod libpodPruneContainers
+ // swagger:operation POST /libpod/containers/prune libpod ContainerPruneLibpod
// ---
// tags:
// - containers
@@ -774,7 +774,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/containers/prune"), s.APIHandler(compat.PruneContainers)).Methods(http.MethodPost)
- // swagger:operation GET /libpod/containers/showmounted libpod libpodShowMountedContainers
+ // swagger:operation GET /libpod/containers/showmounted libpod ShowMountedContainersLibpod
// ---
// tags:
// - containers
@@ -792,7 +792,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/containers/showmounted"), s.APIHandler(libpod.ShowMountedContainers)).Methods(http.MethodGet)
- // swagger:operation DELETE /libpod/containers/{name} libpod libpodRemoveContainer
+ // swagger:operation DELETE /libpod/containers/{name} libpod ContainerDeleteLibpod
// ---
// tags:
// - containers
@@ -826,7 +826,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/containers/{name}"), s.APIHandler(compat.RemoveContainer)).Methods(http.MethodDelete)
- // swagger:operation GET /libpod/containers/{name}/json libpod libpodGetContainer
+ // swagger:operation GET /libpod/containers/{name}/json libpod ContainerInspectLibpod
// ---
// tags:
// - containers
@@ -852,7 +852,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/containers/{name}/json"), s.APIHandler(libpod.GetContainer)).Methods(http.MethodGet)
- // swagger:operation POST /libpod/containers/{name}/kill libpod libpodKillContainer
+ // swagger:operation POST /libpod/containers/{name}/kill libpod ContainerKillLibpod
// ---
// tags:
// - containers
@@ -881,7 +881,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/containers/{name}/kill"), s.APIHandler(compat.KillContainer)).Methods(http.MethodPost)
- // swagger:operation POST /libpod/containers/{name}/mount libpod libpodMountContainer
+ // swagger:operation POST /libpod/containers/{name}/mount libpod ContainerMountLibpod
// ---
// tags:
// - containers
@@ -907,7 +907,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/containers/{name}/mount"), s.APIHandler(libpod.MountContainer)).Methods(http.MethodPost)
- // swagger:operation POST /libpod/containers/{name}/unmount libpod libpodUnmountContainer
+ // swagger:operation POST /libpod/containers/{name}/unmount libpod ContainerUnmountLibpod
// ---
// tags:
// - containers
@@ -929,7 +929,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/containers/{name}/unmount"), s.APIHandler(libpod.UnmountContainer)).Methods(http.MethodPost)
- // swagger:operation GET /libpod/containers/{name}/logs libpod libpodLogsFromContainer
+ // swagger:operation GET /libpod/containers/{name}/logs libpod ContainerLogsLibpod
// ---
// tags:
// - containers
@@ -981,7 +981,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/containers/{name}/logs"), s.APIHandler(compat.LogsFromContainer)).Methods(http.MethodGet)
- // swagger:operation POST /libpod/containers/{name}/pause libpod libpodPauseContainer
+ // swagger:operation POST /libpod/containers/{name}/pause libpod ContainerPauseLibpod
// ---
// tags:
// - containers
@@ -1003,7 +1003,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// "$ref": "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/containers/{name}/pause"), s.APIHandler(compat.PauseContainer)).Methods(http.MethodPost)
- // swagger:operation POST /libpod/containers/{name}/restart libpod libpodRestartContainer
+ // swagger:operation POST /libpod/containers/{name}/restart libpod ContainerRestartLibpod
// ---
// tags:
// - containers
@@ -1028,7 +1028,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/containers/{name}/restart"), s.APIHandler(compat.RestartContainer)).Methods(http.MethodPost)
- // swagger:operation POST /libpod/containers/{name}/start libpod libpodStartContainer
+ // swagger:operation POST /libpod/containers/{name}/start libpod ContainerStartLibpod
// ---
// tags:
// - containers
@@ -1056,7 +1056,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/containers/{name}/start"), s.APIHandler(compat.StartContainer)).Methods(http.MethodPost)
- // swagger:operation GET /libpod/containers/{name}/stats libpod libpodStatsContainer
+ // swagger:operation GET /libpod/containers/{name}/stats libpod ContainerStatsLibpod
// ---
// tags:
// - containers
@@ -1083,7 +1083,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/containers/{name}/stats"), s.APIHandler(compat.StatsContainer)).Methods(http.MethodGet)
- // swagger:operation GET /libpod/containers/stats libpod libpodStatsContainers
+ // swagger:operation GET /libpod/containers/stats libpod ContainersStatsAllLibpod
// ---
// tags:
// - containers
@@ -1112,7 +1112,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/containers/stats"), s.APIHandler(libpod.StatsContainer)).Methods(http.MethodGet)
- // swagger:operation GET /libpod/containers/{name}/top libpod libpodTopContainer
+ // swagger:operation GET /libpod/containers/{name}/top libpod ContainerTopLibpod
// ---
// tags:
// - containers
@@ -1146,7 +1146,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/containers/{name}/top"), s.APIHandler(compat.TopContainer)).Methods(http.MethodGet)
- // swagger:operation POST /libpod/containers/{name}/unpause libpod libpodUnpauseContainer
+ // swagger:operation POST /libpod/containers/{name}/unpause libpod ContainerUnpauseLibpod
// ---
// tags:
// - containers
@@ -1167,7 +1167,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/containers/{name}/unpause"), s.APIHandler(compat.UnpauseContainer)).Methods(http.MethodPost)
- // swagger:operation POST /libpod/containers/{name}/wait libpod libpodWaitContainer
+ // swagger:operation POST /libpod/containers/{name}/wait libpod ContainerWaitLibpod
// ---
// tags:
// - containers
@@ -1204,7 +1204,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/containers/{name}/wait"), s.APIHandler(libpod.WaitContainer)).Methods(http.MethodPost)
- // swagger:operation GET /libpod/containers/{name}/exists libpod libpodContainerExists
+ // swagger:operation GET /libpod/containers/{name}/exists libpod ContainerExistsLibpod
// ---
// tags:
// - containers
@@ -1226,7 +1226,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/containers/{name}/exists"), s.APIHandler(libpod.ContainerExists)).Methods(http.MethodGet)
- // swagger:operation POST /libpod/containers/{name}/stop libpod libpodStopContainer
+ // swagger:operation POST /libpod/containers/{name}/stop libpod ContainerStopLibpod
// ---
// tags:
// - containers
@@ -1264,7 +1264,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/containers/{name}/stop"), s.APIHandler(compat.StopContainer)).Methods(http.MethodPost)
- // swagger:operation POST /libpod/containers/{name}/attach libpod libpodAttachContainer
+ // swagger:operation POST /libpod/containers/{name}/attach libpod ContainerAttachLibpod
// ---
// tags:
// - containers
@@ -1319,7 +1319,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/containers/{name}/attach"), s.APIHandler(compat.AttachContainer)).Methods(http.MethodPost)
- // swagger:operation POST /libpod/containers/{name}/resize libpod libpodResizeContainer
+ // swagger:operation POST /libpod/containers/{name}/resize libpod ContainerResizeLibpod
// ---
// tags:
// - containers
@@ -1351,7 +1351,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/containers/{name}/resize"), s.APIHandler(compat.ResizeTTY)).Methods(http.MethodPost)
- // swagger:operation GET /libpod/containers/{name}/export libpod libpodExportContainer
+ // swagger:operation GET /libpod/containers/{name}/export libpod ContainerExportLibpod
// ---
// tags:
// - containers
@@ -1373,7 +1373,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/containers/{name}/export"), s.APIHandler(compat.ExportContainer)).Methods(http.MethodGet)
- // swagger:operation POST /libpod/containers/{name}/checkpoint libpod libpodCheckpointContainer
+ // swagger:operation POST /libpod/containers/{name}/checkpoint libpod ContainerCheckpointLibpod
// ---
// tags:
// - containers
@@ -1414,7 +1414,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/containers/{name}/checkpoint"), s.APIHandler(libpod.Checkpoint)).Methods(http.MethodPost)
- // swagger:operation POST /libpod/containers/{name}/restore libpod libpodRestoreContainer
+ // swagger:operation POST /libpod/containers/{name}/restore libpod ContainerRestoreLibpod
// ---
// tags:
// - containers
@@ -1468,8 +1468,8 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/containers/{name}/restore"), s.APIHandler(libpod.Restore)).Methods(http.MethodPost)
- // swagger:operation GET /containers/{name}/changes libpod libpodChangesContainer
- // swagger:operation GET /libpod/containers/{name}/changes compat changesContainer
+ // swagger:operation GET /containers/{name}/changes libpod ContainerChangesLibpod
+ // swagger:operation GET /libpod/containers/{name}/changes compat ContainerChanges
// ---
// tags:
// - containers
@@ -1501,7 +1501,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
r.HandleFunc(VersionedPath("/containers/{name}/changes"), s.APIHandler(compat.Changes)).Methods(http.MethodGet)
r.HandleFunc("/containers/{name}/changes", s.APIHandler(compat.Changes)).Methods(http.MethodGet)
r.HandleFunc(VersionedPath("/libpod/containers/{name}/changes"), s.APIHandler(compat.Changes)).Methods(http.MethodGet)
- // swagger:operation POST /libpod/containers/{name}/init libpod libpodInitContainer
+ // swagger:operation POST /libpod/containers/{name}/init libpod ContainerInitLibpod
// ---
// tags:
// - containers
@@ -1525,7 +1525,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/containers/{name}/init"), s.APIHandler(libpod.InitContainer)).Methods(http.MethodPost)
- // swagger:operation POST /libpod/containers/{name}/rename libpod libpodRenameContainer
+ // swagger:operation POST /libpod/containers/{name}/rename libpod ContainerRenameLibpod
// ---
// tags:
// - containers
diff --git a/pkg/api/server/register_events.go b/pkg/api/server/register_events.go
index acccebac1..553f2c0ea 100644
--- a/pkg/api/server/register_events.go
+++ b/pkg/api/server/register_events.go
@@ -8,7 +8,7 @@ import (
)
func (s *APIServer) registerEventsHandlers(r *mux.Router) error {
- // swagger:operation GET /events system getEvents
+ // swagger:operation GET /events system SystemEvents
// ---
// tags:
// - system (compat)
@@ -37,7 +37,7 @@ func (s *APIServer) registerEventsHandlers(r *mux.Router) error {
r.Handle(VersionedPath("/events"), s.APIHandler(compat.GetEvents)).Methods(http.MethodGet)
// Added non version path to URI to support docker non versioned paths
r.Handle("/events", s.APIHandler(compat.GetEvents)).Methods(http.MethodGet)
- // swagger:operation GET /libpod/events system libpodGetEvents
+ // swagger:operation GET /libpod/events system SystemEventsLibpod
// ---
// tags:
// - system
diff --git a/pkg/api/server/register_exec.go b/pkg/api/server/register_exec.go
index de437ab1a..3716ef6a2 100644
--- a/pkg/api/server/register_exec.go
+++ b/pkg/api/server/register_exec.go
@@ -8,7 +8,7 @@ import (
)
func (s *APIServer) registerExecHandlers(r *mux.Router) error {
- // swagger:operation POST /containers/{name}/exec compat createExec
+ // swagger:operation POST /containers/{name}/exec compat ContainerExec
// ---
// tags:
// - exec (compat)
@@ -77,7 +77,7 @@ func (s *APIServer) registerExecHandlers(r *mux.Router) error {
r.Handle(VersionedPath("/containers/{name}/exec"), s.APIHandler(compat.ExecCreateHandler)).Methods(http.MethodPost)
// Added non version path to URI to support docker non versioned paths
r.Handle("/containers/{name}/exec", s.APIHandler(compat.ExecCreateHandler)).Methods(http.MethodPost)
- // swagger:operation POST /exec/{id}/start compat startExec
+ // swagger:operation POST /exec/{id}/start compat ExecStart
// ---
// tags:
// - exec (compat)
@@ -102,7 +102,7 @@ func (s *APIServer) registerExecHandlers(r *mux.Router) error {
// type: boolean
// description: Allocate a pseudo-TTY. Presently ignored.
// produces:
- // - application/json
+ // - application/octet-stream
// responses:
// 200:
// description: no error
@@ -115,7 +115,7 @@ func (s *APIServer) registerExecHandlers(r *mux.Router) error {
r.Handle(VersionedPath("/exec/{id}/start"), s.APIHandler(compat.ExecStartHandler)).Methods(http.MethodPost)
// Added non version path to URI to support docker non versioned paths
r.Handle("/exec/{id}/start", s.APIHandler(compat.ExecStartHandler)).Methods(http.MethodPost)
- // swagger:operation POST /exec/{id}/resize compat resizeExec
+ // swagger:operation POST /exec/{id}/resize compat ExecResize
// ---
// tags:
// - exec (compat)
@@ -153,7 +153,7 @@ func (s *APIServer) registerExecHandlers(r *mux.Router) error {
r.Handle(VersionedPath("/exec/{id}/resize"), s.APIHandler(compat.ResizeTTY)).Methods(http.MethodPost)
// Added non version path to URI to support docker non versioned paths
r.Handle("/exec/{id}/resize", s.APIHandler(compat.ResizeTTY)).Methods(http.MethodPost)
- // swagger:operation GET /exec/{id}/json compat inspectExec
+ // swagger:operation GET /exec/{id}/json compat ExecInspect
// ---
// tags:
// - exec (compat)
@@ -182,7 +182,7 @@ func (s *APIServer) registerExecHandlers(r *mux.Router) error {
libpod api follows
*/
- // swagger:operation POST /libpod/containers/{name}/exec libpod libpodCreateExec
+ // swagger:operation POST /libpod/containers/{name}/exec libpod ContainerExecLibpod
// ---
// tags:
// - exec
@@ -249,7 +249,7 @@ func (s *APIServer) registerExecHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.Handle(VersionedPath("/libpod/containers/{name}/exec"), s.APIHandler(compat.ExecCreateHandler)).Methods(http.MethodPost)
- // swagger:operation POST /libpod/exec/{id}/start libpod libpodStartExec
+ // swagger:operation POST /libpod/exec/{id}/start libpod ExecStartLibpod
// ---
// tags:
// - exec
@@ -285,7 +285,7 @@ func (s *APIServer) registerExecHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.Handle(VersionedPath("/libpod/exec/{id}/start"), s.APIHandler(compat.ExecStartHandler)).Methods(http.MethodPost)
- // swagger:operation POST /libpod/exec/{id}/resize libpod libpodResizeExec
+ // swagger:operation POST /libpod/exec/{id}/resize libpod ExecResizeLibpod
// ---
// tags:
// - exec
@@ -316,7 +316,7 @@ func (s *APIServer) registerExecHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.Handle(VersionedPath("/libpod/exec/{id}/resize"), s.APIHandler(compat.ResizeTTY)).Methods(http.MethodPost)
- // swagger:operation GET /libpod/exec/{id}/json libpod libpodInspectExec
+ // swagger:operation GET /libpod/exec/{id}/json libpod ExecInspectLibpod
// ---
// tags:
// - exec
diff --git a/pkg/api/server/register_generate.go b/pkg/api/server/register_generate.go
index abbad1485..208bf668c 100644
--- a/pkg/api/server/register_generate.go
+++ b/pkg/api/server/register_generate.go
@@ -8,7 +8,7 @@ import (
)
func (s *APIServer) registerGenerateHandlers(r *mux.Router) error {
- // swagger:operation GET /libpod/generate/{name:.*}/systemd libpod libpodGenerateSystemd
+ // swagger:operation GET /libpod/generate/{name:.*}/systemd libpod GenerateSystemdLibpod
// ---
// tags:
// - containers
@@ -75,7 +75,7 @@ func (s *APIServer) registerGenerateHandlers(r *mux.Router) error {
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/generate/{name:.*}/systemd"), s.APIHandler(libpod.GenerateSystemd)).Methods(http.MethodGet)
- // swagger:operation GET /libpod/generate/kube libpod libpodGenerateKube
+ // swagger:operation GET /libpod/generate/kube libpod GenerateKubeLibpod
// ---
// tags:
// - containers
diff --git a/pkg/api/server/register_healthcheck.go b/pkg/api/server/register_healthcheck.go
index 85f3d720c..e2fd5ac68 100644
--- a/pkg/api/server/register_healthcheck.go
+++ b/pkg/api/server/register_healthcheck.go
@@ -8,7 +8,7 @@ import (
)
func (s *APIServer) registerHealthCheckHandlers(r *mux.Router) error {
- // swagger:operation GET /libpod/containers/{name:.*}/healthcheck libpod libpodRunHealthCheck
+ // swagger:operation GET /libpod/containers/{name:.*}/healthcheck libpod ContainerHealthcheckLibpod
// ---
// tags:
// - containers
diff --git a/pkg/api/server/register_images.go b/pkg/api/server/register_images.go
index 423766bd8..de8d50cc9 100644
--- a/pkg/api/server/register_images.go
+++ b/pkg/api/server/register_images.go
@@ -13,12 +13,15 @@ import (
// * /images/create is missing the "message" and "platform" parameters
func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
- // swagger:operation POST /images/create compat createImage
+ // swagger:operation POST /images/create compat ImageCreate
// ---
// tags:
// - images (compat)
// summary: Create an image
// description: Create an image by either pulling it from a registry or importing it.
+ // consumes:
+ // - text/plain
+ // - application/octet-stream
// produces:
// - application/json
// parameters:
@@ -56,7 +59,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
r.Handle(VersionedPath("/images/create"), s.APIHandler(compat.CreateImageFromSrc)).Methods(http.MethodPost).Queries("fromSrc", "{fromSrc}")
// Added non version path to URI to support docker non versioned paths
r.Handle("/images/create", s.APIHandler(compat.CreateImageFromSrc)).Methods(http.MethodPost).Queries("fromSrc", "{fromSrc}")
- // swagger:operation GET /images/json compat listImages
+ // swagger:operation GET /images/json compat ImageList
// ---
// tags:
// - images (compat)
@@ -93,7 +96,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
r.Handle(VersionedPath("/images/json"), s.APIHandler(compat.GetImages)).Methods(http.MethodGet)
// Added non version path to URI to support docker non versioned paths
r.Handle("/images/json", s.APIHandler(compat.GetImages)).Methods(http.MethodGet)
- // swagger:operation POST /images/load compat importImage
+ // swagger:operation POST /images/load compat ImageLoad
// ---
// tags:
// - images (compat)
@@ -119,7 +122,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
r.Handle(VersionedPath("/images/load"), s.APIHandler(compat.LoadImages)).Methods(http.MethodPost)
// Added non version path to URI to support docker non versioned paths
r.Handle("/images/load", s.APIHandler(compat.LoadImages)).Methods(http.MethodPost)
- // swagger:operation POST /images/prune compat pruneImages
+ // swagger:operation POST /images/prune compat ImagePrune
// ---
// tags:
// - images (compat)
@@ -146,7 +149,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
r.Handle(VersionedPath("/images/prune"), s.APIHandler(compat.PruneImages)).Methods(http.MethodPost)
// Added non version path to URI to support docker non versioned paths
r.Handle("/images/prune", s.APIHandler(compat.PruneImages)).Methods(http.MethodPost)
- // swagger:operation GET /images/search compat searchImages
+ // swagger:operation GET /images/search compat ImageSearch
// ---
// tags:
// - images (compat)
@@ -185,7 +188,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
r.Handle(VersionedPath("/images/search"), s.APIHandler(compat.SearchImages)).Methods(http.MethodGet)
// Added non version path to URI to support docker non versioned paths
r.Handle("/images/search", s.APIHandler(compat.SearchImages)).Methods(http.MethodGet)
- // swagger:operation DELETE /images/{name:.*} compat removeImage
+ // swagger:operation DELETE /images/{name:.*} compat ImageDelete
// ---
// tags:
// - images (compat)
@@ -219,7 +222,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
r.Handle(VersionedPath("/images/{name:.*}"), s.APIHandler(compat.RemoveImage)).Methods(http.MethodDelete)
// Added non version path to URI to support docker non versioned paths
r.Handle("/images/{name:.*}", s.APIHandler(compat.RemoveImage)).Methods(http.MethodDelete)
- // swagger:operation POST /images/{name:.*}/push compat pushImage
+ // swagger:operation POST /images/{name:.*}/push compat ImagePush
// ---
// tags:
// - images (compat)
@@ -266,7 +269,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
r.Handle(VersionedPath("/images/{name:.*}/push"), s.APIHandler(compat.PushImage)).Methods(http.MethodPost)
// Added non version path to URI to support docker non versioned paths
r.Handle("/images/{name:.*}/push", s.APIHandler(compat.PushImage)).Methods(http.MethodPost)
- // swagger:operation GET /images/{name:.*}/get compat exportImage
+ // swagger:operation GET /images/{name:.*}/get compat ImageGet
// ---
// tags:
// - images (compat)
@@ -279,7 +282,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// required: true
// description: the name or ID of the container
// produces:
- // - application/json
+ // - application/x-tar
// responses:
// 200:
// description: no error
@@ -291,7 +294,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
r.Handle(VersionedPath("/images/{name:.*}/get"), s.APIHandler(compat.ExportImage)).Methods(http.MethodGet)
// Added non version path to URI to support docker non versioned paths
r.Handle("/images/{name:.*}/get", s.APIHandler(compat.ExportImage)).Methods(http.MethodGet)
- // swagger:operation GET /images/get compat get
+ // swagger:operation GET /images/get compat ImageGetAll
// ---
// tags:
// - images (compat)
@@ -316,7 +319,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
r.Handle(VersionedPath("/images/get"), s.APIHandler(compat.ExportImages)).Methods(http.MethodGet)
// Added non version path to URI to support docker non versioned paths
r.Handle("/images/get", s.APIHandler(compat.ExportImages)).Methods(http.MethodGet)
- // swagger:operation GET /images/{name:.*}/history compat imageHistory
+ // swagger:operation GET /images/{name:.*}/history compat ImageHistory
// ---
// tags:
// - images (compat)
@@ -340,7 +343,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
r.Handle(VersionedPath("/images/{name:.*}/history"), s.APIHandler(compat.HistoryImage)).Methods(http.MethodGet)
// Added non version path to URI to support docker non versioned paths
r.Handle("/images/{name:.*}/history", s.APIHandler(compat.HistoryImage)).Methods(http.MethodGet)
- // swagger:operation GET /images/{name:.*}/json compat inspectImage
+ // swagger:operation GET /images/{name:.*}/json compat ImageInspect
// ---
// tags:
// - images (compat)
@@ -364,7 +367,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
r.Handle(VersionedPath("/images/{name:.*}/json"), s.APIHandler(compat.GetImage)).Methods(http.MethodGet)
// Added non version path to URI to support docker non versioned paths
r.Handle("/images/{name:.*}/json", s.APIHandler(compat.GetImage)).Methods(http.MethodGet)
- // swagger:operation POST /images/{name:.*}/tag compat tagImage
+ // swagger:operation POST /images/{name:.*}/tag compat ImageTag
// ---
// tags:
// - images (compat)
@@ -400,7 +403,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
r.Handle(VersionedPath("/images/{name:.*}/tag"), s.APIHandler(compat.TagImage)).Methods(http.MethodPost)
// Added non version path to URI to support docker non versioned paths
r.Handle("/images/{name:.*}/tag", s.APIHandler(compat.TagImage)).Methods(http.MethodPost)
- // swagger:operation POST /commit compat commitContainer
+ // swagger:operation POST /commit compat ImageCommit
// ---
// tags:
// - containers (compat)
@@ -448,7 +451,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// Added non version path to URI to support docker non versioned paths
r.Handle("/commit", s.APIHandler(compat.CommitContainer)).Methods(http.MethodPost)
- // swagger:operation POST /build compat buildImage
+ // swagger:operation POST /build compat ImageBuild
// ---
// tags:
// - images (compat)
@@ -664,7 +667,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
libpod endpoints
*/
- // swagger:operation POST /libpod/images/{name:.*}/push libpod libpodPushImage
+ // swagger:operation POST /libpod/images/{name:.*}/push libpod ImagePushLibpod
// ---
// tags:
// - images
@@ -702,7 +705,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// 500:
// $ref: '#/responses/InternalError'
r.Handle(VersionedPath("/libpod/images/{name:.*}/push"), s.APIHandler(libpod.PushImage)).Methods(http.MethodPost)
- // swagger:operation GET /libpod/images/{name:.*}/exists libpod libpodImageExists
+ // swagger:operation GET /libpod/images/{name:.*}/exists libpod ImageExistsLibpod
// ---
// tags:
// - images
@@ -724,7 +727,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// 500:
// $ref: '#/responses/InternalError'
r.Handle(VersionedPath("/libpod/images/{name:.*}/exists"), s.APIHandler(libpod.ImageExists)).Methods(http.MethodGet)
- // swagger:operation GET /libpod/images/{name:.*}/tree libpod libpodImageTree
+ // swagger:operation GET /libpod/images/{name:.*}/tree libpod ImageTreeLibpod
// ---
// tags:
// - images
@@ -750,7 +753,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// 500:
// $ref: '#/responses/InternalError'
r.Handle(VersionedPath("/libpod/images/{name:.*}/tree"), s.APIHandler(libpod.ImageTree)).Methods(http.MethodGet)
- // swagger:operation GET /libpod/images/{name:.*}/history libpod libpodImageHistory
+ // swagger:operation GET /libpod/images/{name:.*}/history libpod ImageHistoryLibpod
// ---
// tags:
// - images
@@ -772,7 +775,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// 500:
// $ref: '#/responses/InternalError'
r.Handle(VersionedPath("/libpod/images/{name:.*}/history"), s.APIHandler(compat.HistoryImage)).Methods(http.MethodGet)
- // swagger:operation GET /libpod/images/json libpod libpodListImages
+ // swagger:operation GET /libpod/images/json libpod ImageListLibpod
// ---
// tags:
// - images
@@ -803,7 +806,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// 500:
// $ref: '#/responses/InternalError'
r.Handle(VersionedPath("/libpod/images/json"), s.APIHandler(libpod.GetImages)).Methods(http.MethodGet)
- // swagger:operation POST /libpod/images/load libpod libpodImagesLoad
+ // swagger:operation POST /libpod/images/load libpod ImageLoadLibpod
// ---
// tags:
// - images
@@ -828,7 +831,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// 500:
// $ref: '#/responses/InternalError'
r.Handle(VersionedPath("/libpod/images/load"), s.APIHandler(libpod.ImagesLoad)).Methods(http.MethodPost)
- // swagger:operation POST /libpod/images/import libpod libpodImagesImport
+ // swagger:operation POST /libpod/images/import libpod ImageImportLibpod
// ---
// tags:
// - images
@@ -871,7 +874,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// 500:
// $ref: '#/responses/InternalError'
r.Handle(VersionedPath("/libpod/images/import"), s.APIHandler(libpod.ImagesImport)).Methods(http.MethodPost)
- // swagger:operation DELETE /libpod/images/remove libpod libpodImagesRemove
+ // swagger:operation DELETE /libpod/images/remove libpod ImageDeleteAllLibpod
// ---
// tags:
// - images
@@ -903,7 +906,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// 500:
// $ref: '#/responses/InternalError'
r.Handle(VersionedPath("/libpod/images/remove"), s.APIHandler(libpod.ImagesBatchRemove)).Methods(http.MethodDelete)
- // swagger:operation DELETE /libpod/images/{name:.*} libpod libpodRemoveImage
+ // swagger:operation DELETE /libpod/images/{name:.*} libpod ImageDeleteLibpod
// ---
// tags:
// - images
@@ -933,7 +936,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// 500:
// $ref: '#/responses/InternalError'
r.Handle(VersionedPath("/libpod/images/{name:.*}"), s.APIHandler(libpod.ImagesRemove)).Methods(http.MethodDelete)
- // swagger:operation POST /libpod/images/pull libpod libpodImagesPull
+ // swagger:operation POST /libpod/images/pull libpod ImagePullLibpod
// ---
// tags:
// - images
@@ -979,7 +982,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// 500:
// $ref: '#/responses/InternalError'
r.Handle(VersionedPath("/libpod/images/pull"), s.APIHandler(libpod.ImagesPull)).Methods(http.MethodPost)
- // swagger:operation POST /libpod/images/prune libpod libpodPruneImages
+ // swagger:operation POST /libpod/images/prune libpod ImagePruneLibpod
// ---
// tags:
// - images
@@ -1004,7 +1007,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// 500:
// $ref: '#/responses/InternalError'
r.Handle(VersionedPath("/libpod/images/prune"), s.APIHandler(libpod.PruneImages)).Methods(http.MethodPost)
- // swagger:operation GET /libpod/images/search libpod libpodSearchImages
+ // swagger:operation GET /libpod/images/search libpod ImageSearchLibpod
// ---
// tags:
// - images
@@ -1039,7 +1042,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// 500:
// $ref: '#/responses/InternalError'
r.Handle(VersionedPath("/libpod/images/search"), s.APIHandler(compat.SearchImages)).Methods(http.MethodGet)
- // swagger:operation GET /libpod/images/{name:.*}/get libpod libpodExportImage
+ // swagger:operation GET /libpod/images/{name:.*}/get libpod ImageGetLibpod
// ---
// tags:
// - images
@@ -1060,7 +1063,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// type: boolean
// description: use compression on image
// produces:
- // - application/json
+ // - application/x-tar
// responses:
// 200:
// description: no error
@@ -1072,7 +1075,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// 500:
// $ref: '#/responses/InternalError'
r.Handle(VersionedPath("/libpod/images/{name:.*}/get"), s.APIHandler(libpod.ExportImage)).Methods(http.MethodGet)
- // swagger:operation GET /libpod/images/export libpod libpodExportImages
+ // swagger:operation GET /libpod/images/export libpod ImageExportLibpod
// ---
// tags:
// - images
@@ -1106,7 +1109,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// 500:
// $ref: '#/responses/InternalError'
r.Handle(VersionedPath("/libpod/images/export"), s.APIHandler(libpod.ExportImages)).Methods(http.MethodGet)
- // swagger:operation GET /libpod/images/{name:.*}/json libpod libpodInspectImage
+ // swagger:operation GET /libpod/images/{name:.*}/json libpod ImageInspectLibpod
// ---
// tags:
// - images
@@ -1128,7 +1131,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// 500:
// $ref: '#/responses/InternalError'
r.Handle(VersionedPath("/libpod/images/{name:.*}/json"), s.APIHandler(libpod.GetImage)).Methods(http.MethodGet)
- // swagger:operation POST /libpod/images/{name:.*}/tag libpod libpodTagImage
+ // swagger:operation POST /libpod/images/{name:.*}/tag libpod ImageTagLibpod
// ---
// tags:
// - images
@@ -1162,7 +1165,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// 500:
// $ref: '#/responses/InternalError'
r.Handle(VersionedPath("/libpod/images/{name:.*}/tag"), s.APIHandler(compat.TagImage)).Methods(http.MethodPost)
- // swagger:operation POST /libpod/commit libpod libpodCommitContainer
+ // swagger:operation POST /libpod/commit libpod ImageCommitLibpod
// ---
// tags:
// - containers
@@ -1214,7 +1217,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// 500:
// $ref: '#/responses/InternalError'
r.Handle(VersionedPath("/libpod/commit"), s.APIHandler(libpod.CommitContainer)).Methods(http.MethodPost)
- // swagger:operation POST /libpod/images/{name:.*}/untag libpod libpodUntagImage
+ // swagger:operation POST /libpod/images/{name:.*}/untag libpod ImageUntagLibpod
// ---
// tags:
// - images
@@ -1249,7 +1252,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// $ref: '#/responses/InternalError'
r.Handle(VersionedPath("/libpod/images/{name:.*}/untag"), s.APIHandler(libpod.UntagImage)).Methods(http.MethodPost)
- // swagger:operation GET /libpod/images/{name}/changes libpod libpodChangesImages
+ // swagger:operation GET /libpod/images/{name}/changes libpod ImageChangesLibpod
// ---
// tags:
// - images
@@ -1279,7 +1282,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/images/{name}/changes"), s.APIHandler(compat.Changes)).Methods(http.MethodGet)
- // swagger:operation POST /libpod/build libpod libpodBuildImage
+ // swagger:operation POST /libpod/build libpod ImageBuildLibpod
// ---
// tags:
// - images
diff --git a/pkg/api/server/register_info.go b/pkg/api/server/register_info.go
index c07d4699d..45185ba3b 100644
--- a/pkg/api/server/register_info.go
+++ b/pkg/api/server/register_info.go
@@ -9,7 +9,7 @@ import (
)
func (s *APIServer) registerInfoHandlers(r *mux.Router) error {
- // swagger:operation GET /info compat getInfo
+ // swagger:operation GET /info compat SystemInfo
// ---
// tags:
// - system (compat)
@@ -25,7 +25,7 @@ func (s *APIServer) registerInfoHandlers(r *mux.Router) error {
r.Handle(VersionedPath("/info"), s.APIHandler(compat.GetInfo)).Methods(http.MethodGet)
// Added non version path to URI to support docker non versioned paths
r.Handle("/info", s.APIHandler(compat.GetInfo)).Methods(http.MethodGet)
- // swagger:operation GET /libpod/info libpod libpodGetInfo
+ // swagger:operation GET /libpod/info libpod SystemInfoLibpod
// ---
// tags:
// - system
diff --git a/pkg/api/server/register_manifest.go b/pkg/api/server/register_manifest.go
index c2da5156b..0417462a6 100644
--- a/pkg/api/server/register_manifest.go
+++ b/pkg/api/server/register_manifest.go
@@ -8,7 +8,7 @@ import (
)
func (s *APIServer) registerManifestHandlers(r *mux.Router) error {
- // swagger:operation POST /libpod/manifests/create manifests Create
+ // swagger:operation POST /libpod/manifests/create manifests ManifestCreateLibpod
// ---
// summary: Create
// description: Create a manifest list
@@ -39,7 +39,7 @@ func (s *APIServer) registerManifestHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.Handle(VersionedPath("/libpod/manifests/create"), s.APIHandler(libpod.ManifestCreate)).Methods(http.MethodPost)
- // swagger:operation GET /libpod/manifests/{name}/exists manifests Exists
+ // swagger:operation GET /libpod/manifests/{name}/exists manifests ManifestExistsLibpod
// ---
// summary: Exists
// description: Check if manifest list exists
@@ -59,7 +59,7 @@ func (s *APIServer) registerManifestHandlers(r *mux.Router) error {
// 500:
// $ref: '#/responses/InternalError'
r.Handle(VersionedPath("/libpod/manifests/{name}/exists"), s.APIHandler(libpod.ExistsManifest)).Methods(http.MethodGet)
- // swagger:operation GET /libpod/manifests/{name:.*}/json manifests Inspect
+ // swagger:operation GET /libpod/manifests/{name:.*}/json manifests ManifestInspectLibpod
// ---
// summary: Inspect
// description: Display a manifest list
@@ -79,7 +79,7 @@ func (s *APIServer) registerManifestHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.Handle(VersionedPath("/libpod/manifests/{name:.*}/json"), s.APIHandler(libpod.ManifestInspect)).Methods(http.MethodGet)
- // swagger:operation POST /libpod/manifests/{name:.*}/add manifests AddManifest
+ // swagger:operation POST /libpod/manifests/{name:.*}/add manifests ManifestAddLibpod
// ---
// description: Add an image to a manifest list
// produces:
@@ -106,7 +106,7 @@ func (s *APIServer) registerManifestHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.Handle(VersionedPath("/libpod/manifests/{name:.*}/add"), s.APIHandler(libpod.ManifestAdd)).Methods(http.MethodPost)
- // swagger:operation DELETE /libpod/manifests/{name:.*} manifests RemoveManifest
+ // swagger:operation DELETE /libpod/manifests/{name:.*} manifests ManifestDeleteLibpod
// ---
// summary: Remove
// description: Remove an image from a manifest list
@@ -133,7 +133,7 @@ func (s *APIServer) registerManifestHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.Handle(VersionedPath("/libpod/manifests/{name:.*}"), s.APIHandler(libpod.ManifestRemove)).Methods(http.MethodDelete)
- // swagger:operation POST /libpod/manifests/{name}/push manifests PushManifest
+ // swagger:operation POST /libpod/manifests/{name}/push manifests ManifestPushLibpod
// ---
// summary: Push
// description: Push a manifest list or image index to a registry
diff --git a/pkg/api/server/register_networks.go b/pkg/api/server/register_networks.go
index a07c6a55e..e25fd071c 100644
--- a/pkg/api/server/register_networks.go
+++ b/pkg/api/server/register_networks.go
@@ -9,7 +9,7 @@ import (
)
func (s *APIServer) registerNetworkHandlers(r *mux.Router) error {
- // swagger:operation DELETE /networks/{name} compat compatRemoveNetwork
+ // swagger:operation DELETE /networks/{name} compat NetworkDelete
// ---
// tags:
// - networks (compat)
@@ -32,7 +32,7 @@ func (s *APIServer) registerNetworkHandlers(r *mux.Router) error {
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/networks/{name}"), s.APIHandler(compat.RemoveNetwork)).Methods(http.MethodDelete)
r.HandleFunc("/networks/{name}", s.APIHandler(compat.RemoveNetwork)).Methods(http.MethodDelete)
- // swagger:operation GET /networks/{name} compat compatInspectNetwork
+ // swagger:operation GET /networks/{name} compat NetworkInspect
// ---
// tags:
// - networks (compat)
@@ -55,7 +55,7 @@ func (s *APIServer) registerNetworkHandlers(r *mux.Router) error {
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/networks/{name}"), s.APIHandler(compat.InspectNetwork)).Methods(http.MethodGet)
r.HandleFunc("/networks/{name}", s.APIHandler(compat.InspectNetwork)).Methods(http.MethodGet)
- // swagger:operation GET /networks compat compatListNetwork
+ // swagger:operation GET /networks compat NetworkList
// ---
// tags:
// - networks (compat)
@@ -80,7 +80,7 @@ func (s *APIServer) registerNetworkHandlers(r *mux.Router) error {
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/networks"), s.APIHandler(compat.ListNetworks)).Methods(http.MethodGet)
r.HandleFunc("/networks", s.APIHandler(compat.ListNetworks)).Methods(http.MethodGet)
- // swagger:operation POST /networks/create compat compatCreateNetwork
+ // swagger:operation POST /networks/create compat NetworkCreate
// ---
// tags:
// - networks (compat)
@@ -103,7 +103,7 @@ func (s *APIServer) registerNetworkHandlers(r *mux.Router) error {
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/networks/create"), s.APIHandler(compat.CreateNetwork)).Methods(http.MethodPost)
r.HandleFunc("/networks/create", s.APIHandler(compat.CreateNetwork)).Methods(http.MethodPost)
- // swagger:operation POST /networks/{name}/connect compat compatConnectNetwork
+ // swagger:operation POST /networks/{name}/connect compat NetworkConnect
// ---
// tags:
// - networks (compat)
@@ -131,7 +131,7 @@ func (s *APIServer) registerNetworkHandlers(r *mux.Router) error {
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/networks/{name}/connect"), s.APIHandler(compat.Connect)).Methods(http.MethodPost)
r.HandleFunc("/networks/{name}/connect", s.APIHandler(compat.Connect)).Methods(http.MethodPost)
- // swagger:operation POST /networks/{name}/disconnect compat compatDisconnectNetwork
+ // swagger:operation POST /networks/{name}/disconnect compat NetworkDisconnect
// ---
// tags:
// - networks (compat)
@@ -159,7 +159,7 @@ func (s *APIServer) registerNetworkHandlers(r *mux.Router) error {
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/networks/{name}/disconnect"), s.APIHandler(compat.Disconnect)).Methods(http.MethodPost)
r.HandleFunc("/networks/{name}/disconnect", s.APIHandler(compat.Disconnect)).Methods(http.MethodPost)
- // swagger:operation POST /networks/prune compat compatPruneNetwork
+ // swagger:operation POST /networks/prune compat NetworkPrune
// ---
// tags:
// - networks (compat)
@@ -188,7 +188,7 @@ func (s *APIServer) registerNetworkHandlers(r *mux.Router) error {
r.HandleFunc(VersionedPath("/networks/prune"), s.APIHandler(compat.Prune)).Methods(http.MethodPost)
r.HandleFunc("/networks/prune", s.APIHandler(compat.Prune)).Methods(http.MethodPost)
- // swagger:operation DELETE /libpod/networks/{name} libpod libpodRemoveNetwork
+ // swagger:operation DELETE /libpod/networks/{name} libpod NetworkDeleteLibpod
// ---
// tags:
// - networks
@@ -213,13 +213,8 @@ func (s *APIServer) registerNetworkHandlers(r *mux.Router) error {
// $ref: "#/responses/NoSuchNetwork"
// 500:
// $ref: "#/responses/InternalError"
-
- /*
- Libpod
- */
-
r.HandleFunc(VersionedPath("/libpod/networks/{name}"), s.APIHandler(libpod.RemoveNetwork)).Methods(http.MethodDelete)
- // swagger:operation GET /libpod/networks/{name}/exists libpod libpodExistsNetwork
+ // swagger:operation GET /libpod/networks/{name}/exists libpod NetworkExistsLibpod
// ---
// tags:
// - networks
@@ -241,7 +236,7 @@ func (s *APIServer) registerNetworkHandlers(r *mux.Router) error {
// 500:
// $ref: '#/responses/InternalError'
r.Handle(VersionedPath("/libpod/networks/{name}/exists"), s.APIHandler(libpod.ExistsNetwork)).Methods(http.MethodGet)
- // swagger:operation GET /libpod/networks/json libpod libpodListNetwork
+ // swagger:operation GET /libpod/networks/json libpod NetworkListLibpod
// ---
// tags:
// - networks
@@ -266,7 +261,7 @@ func (s *APIServer) registerNetworkHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/networks/json"), s.APIHandler(libpod.ListNetworks)).Methods(http.MethodGet)
- // swagger:operation GET /libpod/networks/{name}/json libpod libpodInspectNetwork
+ // swagger:operation GET /libpod/networks/{name}/json libpod NetworkInspectLibpod
// ---
// tags:
// - networks
@@ -289,7 +284,7 @@ func (s *APIServer) registerNetworkHandlers(r *mux.Router) error {
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/networks/{name}/json"), s.APIHandler(libpod.InspectNetwork)).Methods(http.MethodGet)
r.HandleFunc(VersionedPath("/libpod/networks/{name}"), s.APIHandler(libpod.InspectNetwork)).Methods(http.MethodGet)
- // swagger:operation POST /libpod/networks/create libpod libpodCreateNetwork
+ // swagger:operation POST /libpod/networks/create libpod NetworkCreateLibpod
// ---
// tags:
// - networks
@@ -315,7 +310,7 @@ func (s *APIServer) registerNetworkHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/networks/create"), s.APIHandler(libpod.CreateNetwork)).Methods(http.MethodPost)
- // swagger:operation POST /libpod/networks/{name}/connect libpod libpodConnectNetwork
+ // swagger:operation POST /libpod/networks/{name}/connect libpod NetworkConnectLibpod
// ---
// tags:
// - networks
@@ -342,7 +337,7 @@ func (s *APIServer) registerNetworkHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/networks/{name}/connect"), s.APIHandler(libpod.Connect)).Methods(http.MethodPost)
- // swagger:operation POST /libpod/networks/{name}/disconnect libpod libpodDisconnectNetwork
+ // swagger:operation POST /libpod/networks/{name}/disconnect libpod NetworkDisconnectLibpod
// ---
// tags:
// - networks
@@ -369,7 +364,7 @@ func (s *APIServer) registerNetworkHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/networks/{name}/disconnect"), s.APIHandler(compat.Disconnect)).Methods(http.MethodPost)
- // swagger:operation POST /libpod/networks/prune libpod libpodPruneNetwork
+ // swagger:operation POST /libpod/networks/prune libpod NetworkPruneLibpod
// ---
// tags:
// - networks
diff --git a/pkg/api/server/register_ping.go b/pkg/api/server/register_ping.go
index 1d0876ec1..1222b3dba 100644
--- a/pkg/api/server/register_ping.go
+++ b/pkg/api/server/register_ping.go
@@ -10,7 +10,7 @@ import (
func (s *APIServer) registerPingHandlers(r *mux.Router) error {
r.Handle("/_ping", s.APIHandler(compat.Ping)).Methods(http.MethodGet, http.MethodHead)
r.Handle(VersionedPath("/_ping"), s.APIHandler(compat.Ping)).Methods(http.MethodGet, http.MethodHead)
- // swagger:operation GET /libpod/_ping libpod libpodPingGet
+ // swagger:operation GET /libpod/_ping libpod SystemPing
// ---
// summary: Ping service
// description: |
diff --git a/pkg/api/server/register_play.go b/pkg/api/server/register_play.go
index dbb13cba3..b9d3349be 100644
--- a/pkg/api/server/register_play.go
+++ b/pkg/api/server/register_play.go
@@ -8,7 +8,7 @@ import (
)
func (s *APIServer) registerPlayHandlers(r *mux.Router) error {
- // swagger:operation POST /libpod/play/kube libpod libpodPlayKube
+ // swagger:operation POST /libpod/play/kube libpod KubePlayLibpod
// ---
// tags:
// - containers
diff --git a/pkg/api/server/register_pods.go b/pkg/api/server/register_pods.go
index c66cc48ff..226cbce11 100644
--- a/pkg/api/server/register_pods.go
+++ b/pkg/api/server/register_pods.go
@@ -8,7 +8,7 @@ import (
)
func (s *APIServer) registerPodsHandlers(r *mux.Router) error {
- // swagger:operation GET /libpod/pods/json pods ListPods
+ // swagger:operation GET /libpod/pods/json pods PodListLibpod
// ---
// summary: List pods
// produces:
@@ -26,7 +26,7 @@ func (s *APIServer) registerPodsHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.Handle(VersionedPath("/libpod/pods/json"), s.APIHandler(libpod.Pods)).Methods(http.MethodGet)
- // swagger:operation POST /libpod/pods/create pods CreatePod
+ // swagger:operation POST /libpod/pods/create pods PodCreateLibpod
// ---
// summary: Create a pod
// produces:
@@ -51,7 +51,7 @@ func (s *APIServer) registerPodsHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.Handle(VersionedPath("/libpod/pods/create"), s.APIHandler(libpod.PodCreate)).Methods(http.MethodPost)
- // swagger:operation POST /libpod/pods/prune pods PrunePods
+ // swagger:operation POST /libpod/pods/prune pods PodPruneLibpod
// ---
// summary: Prune unused pods
// produces:
@@ -66,7 +66,7 @@ func (s *APIServer) registerPodsHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.Handle(VersionedPath("/libpod/pods/prune"), s.APIHandler(libpod.PodPrune)).Methods(http.MethodPost)
- // swagger:operation DELETE /libpod/pods/{name} pods removePod
+ // swagger:operation DELETE /libpod/pods/{name} pods PodDeleteLibpod
// ---
// summary: Remove pod
// produces:
@@ -91,7 +91,7 @@ func (s *APIServer) registerPodsHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.Handle(VersionedPath("/libpod/pods/{name}"), s.APIHandler(libpod.PodDelete)).Methods(http.MethodDelete)
- // swagger:operation GET /libpod/pods/{name}/json pods inspectPod
+ // swagger:operation GET /libpod/pods/{name}/json pods PodInspectLibpod
// ---
// summary: Inspect pod
// produces:
@@ -110,7 +110,7 @@ func (s *APIServer) registerPodsHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.Handle(VersionedPath("/libpod/pods/{name}/json"), s.APIHandler(libpod.PodInspect)).Methods(http.MethodGet)
- // swagger:operation GET /libpod/pods/{name}/exists pods podExists
+ // swagger:operation GET /libpod/pods/{name}/exists pods PodExistsLibpod
// ---
// summary: Pod exists
// description: Check if a pod exists by name or ID
@@ -130,7 +130,7 @@ func (s *APIServer) registerPodsHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.Handle(VersionedPath("/libpod/pods/{name}/exists"), s.APIHandler(libpod.PodExists)).Methods(http.MethodGet)
- // swagger:operation POST /libpod/pods/{name}/kill pods killPod
+ // swagger:operation POST /libpod/pods/{name}/kill pods PodKillLibpod
// ---
// summary: Kill a pod
// produces:
@@ -158,7 +158,7 @@ func (s *APIServer) registerPodsHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.Handle(VersionedPath("/libpod/pods/{name}/kill"), s.APIHandler(libpod.PodKill)).Methods(http.MethodPost)
- // swagger:operation POST /libpod/pods/{name}/pause pods pausePod
+ // swagger:operation POST /libpod/pods/{name}/pause pods PodPauseLibpod
// ---
// summary: Pause a pod
// description: Pause a pod
@@ -180,7 +180,7 @@ func (s *APIServer) registerPodsHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.Handle(VersionedPath("/libpod/pods/{name}/pause"), s.APIHandler(libpod.PodPause)).Methods(http.MethodPost)
- // swagger:operation POST /libpod/pods/{name}/restart pods restartPod
+ // swagger:operation POST /libpod/pods/{name}/restart pods PodRestartLibpod
// ---
// summary: Restart a pod
// produces:
@@ -201,7 +201,7 @@ func (s *APIServer) registerPodsHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.Handle(VersionedPath("/libpod/pods/{name}/restart"), s.APIHandler(libpod.PodRestart)).Methods(http.MethodPost)
- // swagger:operation POST /libpod/pods/{name}/start pods startPod
+ // swagger:operation POST /libpod/pods/{name}/start pods PodStartLibpod
// ---
// summary: Start a pod
// produces:
@@ -224,7 +224,7 @@ func (s *APIServer) registerPodsHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.Handle(VersionedPath("/libpod/pods/{name}/start"), s.APIHandler(libpod.PodStart)).Methods(http.MethodPost)
- // swagger:operation POST /libpod/pods/{name}/stop pods stopPod
+ // swagger:operation POST /libpod/pods/{name}/stop pods PodStopLibpod
// ---
// summary: Stop a pod
// produces:
@@ -253,7 +253,7 @@ func (s *APIServer) registerPodsHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.Handle(VersionedPath("/libpod/pods/{name}/stop"), s.APIHandler(libpod.PodStop)).Methods(http.MethodPost)
- // swagger:operation POST /libpod/pods/{name}/unpause pods unpausePod
+ // swagger:operation POST /libpod/pods/{name}/unpause pods PodUnpauseLibpod
// ---
// summary: Unpause a pod
// produces:
@@ -274,7 +274,7 @@ func (s *APIServer) registerPodsHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.Handle(VersionedPath("/libpod/pods/{name}/unpause"), s.APIHandler(libpod.PodUnpause)).Methods(http.MethodPost)
- // swagger:operation GET /libpod/pods/{name}/top pods topPod
+ // swagger:operation GET /libpod/pods/{name}/top pods PodTopLibpod
// ---
// summary: List processes
// description: List processes running inside a pod
@@ -305,7 +305,7 @@ func (s *APIServer) registerPodsHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.Handle(VersionedPath("/libpod/pods/{name}/top"), s.APIHandler(libpod.PodTop)).Methods(http.MethodGet)
- // swagger:operation GET /libpod/pods/stats pods statsPod
+ // swagger:operation GET /libpod/pods/stats pods PodStatsLibpod
// ---
// tags:
// - pods
diff --git a/pkg/api/server/register_secrets.go b/pkg/api/server/register_secrets.go
index 531623845..ca9790e93 100644
--- a/pkg/api/server/register_secrets.go
+++ b/pkg/api/server/register_secrets.go
@@ -9,7 +9,7 @@ import (
)
func (s *APIServer) registerSecretHandlers(r *mux.Router) error {
- // swagger:operation POST /libpod/secrets/create libpod libpodCreateSecret
+ // swagger:operation POST /libpod/secrets/create libpod SecretCreateLibpod
// ---
// tags:
// - secrets
@@ -38,7 +38,7 @@ func (s *APIServer) registerSecretHandlers(r *mux.Router) error {
// '500':
// "$ref": "#/responses/InternalError"
r.Handle(VersionedPath("/libpod/secrets/create"), s.APIHandler(libpod.CreateSecret)).Methods(http.MethodPost)
- // swagger:operation GET /libpod/secrets/json libpod libpodListSecret
+ // swagger:operation GET /libpod/secrets/json libpod SecretListLibpod
// ---
// tags:
// - secrets
@@ -53,7 +53,7 @@ func (s *APIServer) registerSecretHandlers(r *mux.Router) error {
// '500':
// "$ref": "#/responses/InternalError"
r.Handle(VersionedPath("/libpod/secrets/json"), s.APIHandler(compat.ListSecrets)).Methods(http.MethodGet)
- // swagger:operation GET /libpod/secrets/{name}/json libpod libpodInspectSecret
+ // swagger:operation GET /libpod/secrets/{name}/json libpod SecretInspectLibpod
// ---
// tags:
// - secrets
@@ -74,7 +74,7 @@ func (s *APIServer) registerSecretHandlers(r *mux.Router) error {
// '500':
// "$ref": "#/responses/InternalError"
r.Handle(VersionedPath("/libpod/secrets/{name}/json"), s.APIHandler(compat.InspectSecret)).Methods(http.MethodGet)
- // swagger:operation DELETE /libpod/secrets/{name} libpod libpodRemoveSecret
+ // swagger:operation DELETE /libpod/secrets/{name} libpod SecretDeleteLibpod
// ---
// tags:
// - secrets
@@ -104,7 +104,7 @@ func (s *APIServer) registerSecretHandlers(r *mux.Router) error {
/*
* Docker compatibility endpoints
*/
- // swagger:operation GET /secrets compat ListSecret
+ // swagger:operation GET /secrets compat SecretList
// ---
// tags:
// - secrets (compat)
@@ -120,7 +120,7 @@ func (s *APIServer) registerSecretHandlers(r *mux.Router) error {
// "$ref": "#/responses/InternalError"
r.Handle(VersionedPath("/secrets"), s.APIHandler(compat.ListSecrets)).Methods(http.MethodGet)
r.Handle("/secrets", s.APIHandler(compat.ListSecrets)).Methods(http.MethodGet)
- // swagger:operation POST /secrets/create compat CreateSecret
+ // swagger:operation POST /secrets/create compat SecretCreate
// ---
// tags:
// - secrets (compat)
@@ -143,7 +143,7 @@ func (s *APIServer) registerSecretHandlers(r *mux.Router) error {
// "$ref": "#/responses/InternalError"
r.Handle(VersionedPath("/secrets/create"), s.APIHandler(compat.CreateSecret)).Methods(http.MethodPost)
r.Handle("/secrets/create", s.APIHandler(compat.CreateSecret)).Methods(http.MethodPost)
- // swagger:operation GET /secrets/{name} compat InspectSecret
+ // swagger:operation GET /secrets/{name} compat SecretInspect
// ---
// tags:
// - secrets (compat)
@@ -165,7 +165,7 @@ func (s *APIServer) registerSecretHandlers(r *mux.Router) error {
// "$ref": "#/responses/InternalError"
r.Handle(VersionedPath("/secrets/{name}"), s.APIHandler(compat.InspectSecret)).Methods(http.MethodGet)
r.Handle("/secrets/{name}", s.APIHandler(compat.InspectSecret)).Methods(http.MethodGet)
- // swagger:operation DELETE /secrets/{name} compat RemoveSecret
+ // swagger:operation DELETE /secrets/{name} compat SecretDelete
// ---
// tags:
// - secrets (compat)
diff --git a/pkg/api/server/register_system.go b/pkg/api/server/register_system.go
index 7bc16acc0..739daf7a6 100644
--- a/pkg/api/server/register_system.go
+++ b/pkg/api/server/register_system.go
@@ -9,10 +9,23 @@ import (
)
func (s *APIServer) registerSystemHandlers(r *mux.Router) error {
+ // swagger:operation GET /system/df compat SystemDataUsage
+ // ---
+ // tags:
+ // - system (compat)
+ // summary: Show disk usage
+ // description: Return information about disk usage for containers, images, and volumes
+ // produces:
+ // - application/json
+ // responses:
+ // 200:
+ // $ref: '#/responses/SystemDiskUse'
+ // 500:
+ // $ref: "#/responses/InternalError"
r.Handle(VersionedPath("/system/df"), s.APIHandler(compat.GetDiskUsage)).Methods(http.MethodGet)
// Added non version path to URI to support docker non versioned paths
r.Handle("/system/df", s.APIHandler(compat.GetDiskUsage)).Methods(http.MethodGet)
- // swagger:operation POST /libpod/system/prune libpod pruneSystem
+ // swagger:operation POST /libpod/system/prune libpod SystemPruneLibpod
// ---
// tags:
// - system
@@ -27,7 +40,7 @@ func (s *APIServer) registerSystemHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.Handle(VersionedPath("/libpod/system/prune"), s.APIHandler(libpod.SystemPrune)).Methods(http.MethodPost)
- // swagger:operation GET /libpod/system/df libpod df
+ // swagger:operation GET /libpod/system/df libpod SystemDataUsageLibpod
// ---
// tags:
// - system
diff --git a/pkg/api/server/register_version.go b/pkg/api/server/register_version.go
index 0cedb5dc6..462edf4ee 100644
--- a/pkg/api/server/register_version.go
+++ b/pkg/api/server/register_version.go
@@ -8,7 +8,7 @@ import (
)
func (s *APIServer) registerVersionHandlers(r *mux.Router) error {
- // swagger:operation GET /version compat CompatSystemVersion
+ // swagger:operation GET /version compat SystemVersion
// ---
// summary: Component Version information
// tags:
@@ -20,7 +20,7 @@ func (s *APIServer) registerVersionHandlers(r *mux.Router) error {
// $ref: "#/responses/Version"
r.Handle("/version", s.APIHandler(compat.VersionHandler)).Methods(http.MethodGet)
r.Handle(VersionedPath("/version"), s.APIHandler(compat.VersionHandler)).Methods(http.MethodGet)
- // swagger:operation GET /libpod/version libpod SystemVersion
+ // swagger:operation GET /libpod/version libpod SystemVersionLibpod
// ---
// summary: Component Version information
// tags:
diff --git a/pkg/api/server/register_volumes.go b/pkg/api/server/register_volumes.go
index b19faefdd..58f056626 100644
--- a/pkg/api/server/register_volumes.go
+++ b/pkg/api/server/register_volumes.go
@@ -9,7 +9,7 @@ import (
)
func (s *APIServer) registerVolumeHandlers(r *mux.Router) error {
- // swagger:operation POST /libpod/volumes/create libpod libpodCreateVolume
+ // swagger:operation POST /libpod/volumes/create libpod VolumeCreateLibpod
// ---
// tags:
// - volumes
@@ -28,7 +28,7 @@ func (s *APIServer) registerVolumeHandlers(r *mux.Router) error {
// '500':
// "$ref": "#/responses/InternalError"
r.Handle(VersionedPath("/libpod/volumes/create"), s.APIHandler(libpod.CreateVolume)).Methods(http.MethodPost)
- // swagger:operation GET /libpod/volumes/{name}/exists libpod libpodExistsVolume
+ // swagger:operation GET /libpod/volumes/{name}/exists libpod VolumeExistsLibpod
// ---
// tags:
// - volumes
@@ -50,7 +50,7 @@ func (s *APIServer) registerVolumeHandlers(r *mux.Router) error {
// 500:
// $ref: '#/responses/InternalError'
r.Handle(VersionedPath("/libpod/volumes/{name}/exists"), s.APIHandler(libpod.ExistsVolume)).Methods(http.MethodGet)
- // swagger:operation GET /libpod/volumes/json libpod libpodListVolumes
+ // swagger:operation GET /libpod/volumes/json libpod VolumeListLibpod
// ---
// tags:
// - volumes
@@ -74,7 +74,7 @@ func (s *APIServer) registerVolumeHandlers(r *mux.Router) error {
// '500':
// "$ref": "#/responses/InternalError"
r.Handle(VersionedPath("/libpod/volumes/json"), s.APIHandler(libpod.ListVolumes)).Methods(http.MethodGet)
- // swagger:operation POST /libpod/volumes/prune libpod libpodPruneVolumes
+ // swagger:operation POST /libpod/volumes/prune libpod VolumePruneLibpod
// ---
// tags:
// - volumes
@@ -87,7 +87,7 @@ func (s *APIServer) registerVolumeHandlers(r *mux.Router) error {
// '500':
// "$ref": "#/responses/InternalError"
r.Handle(VersionedPath("/libpod/volumes/prune"), s.APIHandler(libpod.PruneVolumes)).Methods(http.MethodPost)
- // swagger:operation GET /libpod/volumes/{name}/json libpod libpodInspectVolume
+ // swagger:operation GET /libpod/volumes/{name}/json libpod VolumeInspectLibpod
// ---
// tags:
// - volumes
@@ -108,7 +108,7 @@ func (s *APIServer) registerVolumeHandlers(r *mux.Router) error {
// '500':
// "$ref": "#/responses/InternalError"
r.Handle(VersionedPath("/libpod/volumes/{name}/json"), s.APIHandler(libpod.InspectVolume)).Methods(http.MethodGet)
- // swagger:operation DELETE /libpod/volumes/{name} libpod libpodRemoveVolume
+ // swagger:operation DELETE /libpod/volumes/{name} libpod VolumeDeleteLibpod
// ---
// tags:
// - volumes
@@ -140,7 +140,7 @@ func (s *APIServer) registerVolumeHandlers(r *mux.Router) error {
* Docker compatibility endpoints
*/
- // swagger:operation GET /volumes compat listVolumes
+ // swagger:operation GET /volumes compat VolumeList
// ---
// tags:
// - volumes (compat)
@@ -168,7 +168,7 @@ func (s *APIServer) registerVolumeHandlers(r *mux.Router) error {
r.Handle(VersionedPath("/volumes"), s.APIHandler(compat.ListVolumes)).Methods(http.MethodGet)
r.Handle("/volumes", s.APIHandler(compat.ListVolumes)).Methods(http.MethodGet)
- // swagger:operation POST /volumes/create compat createVolume
+ // swagger:operation POST /volumes/create compat VolumeCreate
// ---
// tags:
// - volumes (compat)
@@ -191,7 +191,7 @@ func (s *APIServer) registerVolumeHandlers(r *mux.Router) error {
r.Handle(VersionedPath("/volumes/create"), s.APIHandler(compat.CreateVolume)).Methods(http.MethodPost)
r.Handle("/volumes/create", s.APIHandler(compat.CreateVolume)).Methods(http.MethodPost)
- // swagger:operation GET /volumes/{name} compat inspectVolume
+ // swagger:operation GET /volumes/{name} compat VolumeInspect
// ---
// tags:
// - volumes (compat)
@@ -214,7 +214,7 @@ func (s *APIServer) registerVolumeHandlers(r *mux.Router) error {
r.Handle(VersionedPath("/volumes/{name}"), s.APIHandler(compat.InspectVolume)).Methods(http.MethodGet)
r.Handle("/volumes/{name}", s.APIHandler(compat.InspectVolume)).Methods(http.MethodGet)
- // swagger:operation DELETE /volumes/{name} compat removeVolume
+ // swagger:operation DELETE /volumes/{name} compat VolumeDelete
// ---
// tags:
// - volumes (compat)
@@ -246,7 +246,7 @@ func (s *APIServer) registerVolumeHandlers(r *mux.Router) error {
r.Handle(VersionedPath("/volumes/{name}"), s.APIHandler(compat.RemoveVolume)).Methods(http.MethodDelete)
r.Handle("/volumes/{name}", s.APIHandler(compat.RemoveVolume)).Methods(http.MethodDelete)
- // swagger:operation POST /volumes/prune compat pruneVolumes
+ // swagger:operation POST /volumes/prune compat VolumePrune
// ---
// tags:
// - volumes (compat)
diff --git a/pkg/api/tags.yaml b/pkg/api/tags.yaml
index bb56098eb..ae29c39a6 100644
--- a/pkg/api/tags.yaml
+++ b/pkg/api/tags.yaml
@@ -24,7 +24,7 @@ tags:
- name: images (compat)
description: Actions related to images for the compatibility endpoints
- name: networks (compat)
- description: Actions related to compatibility networks
+ description: Actions related to networks for the compatibility endpoints
- name: volumes (compat)
description: Actions related to volumes for the compatibility endpoints
- name: secrets (compat)
diff --git a/pkg/bindings/test/networks_test.go b/pkg/bindings/test/networks_test.go
new file mode 100644
index 000000000..ef20235ae
--- /dev/null
+++ b/pkg/bindings/test/networks_test.go
@@ -0,0 +1,72 @@
+package test_bindings
+
+import (
+ "context"
+ "net/http"
+ "time"
+
+ "github.com/containers/podman/v3/pkg/bindings"
+ "github.com/containers/podman/v3/pkg/bindings/network"
+ . "github.com/onsi/ginkgo"
+ . "github.com/onsi/gomega"
+ "github.com/onsi/gomega/gexec"
+)
+
+var _ = Describe("Podman networks", func() {
+ var (
+ bt *bindingTest
+ s *gexec.Session
+ connText context.Context
+ err error
+ )
+
+ BeforeEach(func() {
+
+ bt = newBindingTest()
+ bt.RestoreImagesFromCache()
+ s = bt.startAPIService()
+ time.Sleep(1 * time.Second)
+ connText, err = bindings.NewConnection(context.Background(), bt.sock)
+ Expect(err).To(BeNil())
+ _, err = network.Prune(connText, &network.PruneOptions{})
+ Expect(err).To(BeNil())
+ })
+
+ AfterEach(func() {
+ s.Kill()
+ bt.cleanup()
+ })
+
+ It("create network", func() {
+ // create a network with blank config should work
+ _, err = network.Create(connText, &network.CreateOptions{})
+ Expect(err).To(BeNil())
+
+ name := "foobar"
+ opts := network.CreateOptions{
+ Name: &name,
+ }
+
+ report, err := network.Create(connText, &opts)
+ Expect(err).To(BeNil())
+ Expect(report.Filename).To(ContainSubstring(name))
+
+ // create network with same name should 500
+ _, err = network.Create(connText, &opts)
+ Expect(err).ToNot(BeNil())
+ code, _ := bindings.CheckResponseCode(err)
+ Expect(code).To(BeNumerically("==", http.StatusInternalServerError))
+ })
+
+ It("inspect network", func() {
+ name := "foobar"
+ opts := network.CreateOptions{
+ Name: &name,
+ }
+ _, err = network.Create(connText, &opts)
+ Expect(err).To(BeNil())
+ data, err := network.Inspect(connText, name, nil)
+ Expect(err).To(BeNil())
+ Expect(data[0]["name"]).To(Equal(name))
+ })
+})
diff --git a/pkg/domain/infra/runtime_libpod.go b/pkg/domain/infra/runtime_libpod.go
index b0d9dc797..a98c9168a 100644
--- a/pkg/domain/infra/runtime_libpod.go
+++ b/pkg/domain/infra/runtime_libpod.go
@@ -146,7 +146,11 @@ func getRuntime(ctx context.Context, fs *flag.FlagSet, opts *engineOpts) (*libpo
// This should always be checked after storage-driver is checked
if len(cfg.StorageOpts) > 0 {
storageSet = true
- storageOpts.GraphDriverOptions = cfg.StorageOpts
+ if len(cfg.StorageOpts) == 1 && cfg.StorageOpts[0] == "" {
+ storageOpts.GraphDriverOptions = []string{}
+ } else {
+ storageOpts.GraphDriverOptions = cfg.StorageOpts
+ }
}
if opts.migrate {
options = append(options, libpod.WithMigrate())
diff --git a/pkg/specgen/generate/namespaces.go b/pkg/specgen/generate/namespaces.go
index 845dfdad7..b52e8d100 100644
--- a/pkg/specgen/generate/namespaces.go
+++ b/pkg/specgen/generate/namespaces.go
@@ -157,6 +157,16 @@ func namespaceOptions(ctx context.Context, s *specgen.SpecGenerator, rt *libpod.
case specgen.KeepID:
if rootless.IsRootless() {
toReturn = append(toReturn, libpod.WithAddCurrentUserPasswdEntry())
+
+ // If user is not overridden, set user in the container
+ // to user running Podman.
+ if s.User == "" {
+ _, uid, gid, err := util.GetKeepIDMapping()
+ if err != nil {
+ return nil, err
+ }
+ toReturn = append(toReturn, libpod.WithUser(fmt.Sprintf("%d:%d", uid, gid)))
+ }
} else {
// keep-id as root doesn't need a user namespace
s.UserNS.NSMode = specgen.Host
diff --git a/test/apiv2/35-networks.at b/test/apiv2/35-networks.at
index 21840a42d..59947faac 100644
--- a/test/apiv2/35-networks.at
+++ b/test/apiv2/35-networks.at
@@ -106,7 +106,7 @@ t POST libpod/networks/prune?filters='{"label":["tes' 500 \
# prune networks using filter - compat api
t POST networks/prune?filters='{"label":["xyz"]}' 200
-t GET networks/json?filters='{"label":["xyz"]}' 404
+t GET networks?filters='{"label":["xyz"]}' 200 length=0
# prune networks using filter - libpod api
t POST libpod/networks/prune?filters='{"label":["zaq=val"]}' 200
@@ -120,5 +120,26 @@ t DELETE libpod/networks/network2 200 \
.[0].Name~network2 \
.[0].Err=null
+# test until filter - libpod api
+podman network create network5 --label xyz
+
+# with date way back in the past, network should not be deleted
+t POST libpod/networks/prune?filters='{"until":["500000"]}' 200
+t GET libpod/networks/json?filters='{"label":["xyz"]}' 200 length=1
+
+# with date far in the future, network should be deleted
+t POST libpod/networks/prune?filters='{"until":["5000000000"]}' 200
+t GET libpod/networks/json?filters='{"label":["xyz"]}' 200 length=0
+
+# test until filter - compat api
+podman network create network6 --label zaq
+
+# with date way back in the past, network should not be deleted
+t POST networks/prune?filters='{"until":["500000"]}' 200
+t GET networks?filters='{"label":["zaq"]}' 200 length=1
+
+# with date far in the future, network should be deleted
+t POST networks/prune?filters='{"until":["5000000000"]}' 200
+t GET networks?filters='{"label":["zaq"]}' 200 length=0
# vim: filetype=sh
diff --git a/test/e2e/exec_test.go b/test/e2e/exec_test.go
index df86eab15..e6f63a391 100644
--- a/test/e2e/exec_test.go
+++ b/test/e2e/exec_test.go
@@ -119,6 +119,19 @@ var _ = Describe("Podman exec", func() {
Expect(session.ExitCode()).To(Equal(100))
})
+ It("podman exec in keep-id container drops privileges", func() {
+ SkipIfNotRootless("This function is not enabled for rootful podman")
+ ctrName := "testctr1"
+ testCtr := podmanTest.Podman([]string{"run", "-d", "--name", ctrName, "--userns=keep-id", ALPINE, "top"})
+ testCtr.WaitWithDefaultTimeout()
+ Expect(testCtr.ExitCode()).To(Equal(0))
+
+ session := podmanTest.Podman([]string{"exec", ctrName, "grep", "CapEff", "/proc/self/status"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(session.OutputToString()).To(ContainSubstring("0000000000000000"))
+ })
+
It("podman exec --privileged", func() {
session := podmanTest.Podman([]string{"run", "--privileged", "--rm", ALPINE, "sh", "-c", "grep ^CapBnd /proc/self/status | cut -f 2"})
session.WaitWithDefaultTimeout()
@@ -143,7 +156,6 @@ var _ = Describe("Podman exec", func() {
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
Expect(session.OutputToString()).To(ContainSubstring(bndPerms))
-
})
It("podman exec --privileged", func() {
diff --git a/test/system/001-basic.bats b/test/system/001-basic.bats
index d276cfda1..081bb1171 100644
--- a/test/system/001-basic.bats
+++ b/test/system/001-basic.bats
@@ -10,6 +10,13 @@ function setup() {
:
}
+@test "podman --context emits reasonable output" {
+ run_podman 125 --context=swarm version
+ is "$output" "Error: Podman does not support swarm, the only --context value allowed is \"default\"" "--context=default or fail"
+
+ run_podman --context=default version
+}
+
@test "podman version emits reasonable output" {
run_podman version
diff --git a/test/system/005-info.bats b/test/system/005-info.bats
index 7452c1901..c0af2e937 100644
--- a/test/system/005-info.bats
+++ b/test/system/005-info.bats
@@ -53,4 +53,13 @@ store.imageStore.number | 1
}
+@test "podman info --storage-opt='' " {
+ skip_if_remote "--storage-opt flag is not supported for remote"
+ skip_if_rootless "storage opts are required for rootless running"
+ run_podman --storage-opt='' info
+ # Note this will not work in rootless mode, unless you specify
+ # storage-driver=vfs, until we have kernels that support rootless overlay
+ # mounts.
+ is "$output" ".*graphOptions: {}" "output includes graphOptions: {}"
+}
# vim: filetype=sh
diff --git a/test/system/070-build.bats b/test/system/070-build.bats
index 2e97c93e0..5a887c71e 100644
--- a/test/system/070-build.bats
+++ b/test/system/070-build.bats
@@ -752,6 +752,11 @@ EOF
run_podman rmi -f build_test
}
+@test "podman build --authfile bogus test" {
+ run_podman 125 build --authfile=/tmp/bogus - <<< "from scratch"
+ is "$output" ".*/tmp/bogus: no such file or directory"
+}
+
function teardown() {
# A timeout or other error in 'build' can leave behind stale images
# that podman can't even see and which will cascade into subsequent
diff --git a/test/system/410-selinux.bats b/test/system/410-selinux.bats
index 4a2c7b7a4..8a690fb48 100644
--- a/test/system/410-selinux.bats
+++ b/test/system/410-selinux.bats
@@ -191,5 +191,33 @@ function check_label() {
is "$output" "Error.*: \`/proc/thread-self/attr/exec\`: OCI runtime error: unable to assign security attribute" "useful diagnostic"
}
+@test "podman selinux: check relabel" {
+ skip_if_no_selinux
+
+ LABEL="system_u:object_r:tmp_t:s0"
+ tmpdir=$PODMAN_TMPDIR/vol
+ touch $tmpdir
+ chcon -vR ${LABEL} $tmpdir
+ ls -Z $tmpdir
+
+ run_podman run -v $tmpdir:/test $IMAGE cat /proc/self/attr/current
+ level=$(secon -l $output)
+ run ls -dZ ${tmpdir}
+ is "$output" ${LABEL} "No Relabel Correctly"
+
+ run_podman run -v $tmpdir:/test:Z --security-opt label=disable $IMAGE cat /proc/self/attr/current
+ level=$(secon -l $output)
+ run ls -dZ $tmpdir
+ is "$output" ${LABEL} "No Privileged Relabel Correctly"
+
+ run_podman run -v $tmpdir:/test:Z $IMAGE cat /proc/self/attr/current
+ level=$(secon -l $output)
+ run ls -dZ $tmpdir
+ is "$output" "system_u:object_r:container_file_t:$level" "Confined Relabel Correctly"
+
+ run_podman run -v $tmpdir:/test:z $IMAGE cat /proc/self/attr/current
+ run ls -dZ $tmpdir
+ is "$output" "system_u:object_r:container_file_t:s0" "Shared Relabel Correctly"
+}
# vim: filetype=sh