diff options
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/api/server/register_images.go | 2 | ||||
-rw-r--r-- | pkg/api/server/register_volumes.go | 38 | ||||
-rw-r--r-- | pkg/api/tags.yaml | 2 | ||||
-rw-r--r-- | pkg/domain/infra/abi/system.go | 3 | ||||
-rw-r--r-- | pkg/spec/config_linux_cgo.go | 2 | ||||
-rw-r--r-- | pkg/specgen/generate/config_linux.go | 2 | ||||
-rw-r--r-- | pkg/specgen/generate/config_linux_cgo.go | 2 |
7 files changed, 37 insertions, 14 deletions
diff --git a/pkg/api/server/register_images.go b/pkg/api/server/register_images.go index cb4ce4fe7..748e3fb11 100644 --- a/pkg/api/server/register_images.go +++ b/pkg/api/server/register_images.go @@ -625,7 +625,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error { // swagger:operation POST /libpod/images/{name:.*}/push libpod libpodPushImage // --- // tags: - // - images (libpod) + // - images // summary: Push Image // description: Push an image to a container registry // parameters: diff --git a/pkg/api/server/register_volumes.go b/pkg/api/server/register_volumes.go index 8f7848ed4..22488b158 100644 --- a/pkg/api/server/register_volumes.go +++ b/pkg/api/server/register_volumes.go @@ -9,8 +9,10 @@ import ( ) func (s *APIServer) registerVolumeHandlers(r *mux.Router) error { - // swagger:operation POST /libpod/volumes/create volumes libpodCreateVolume + // swagger:operation POST /libpod/volumes/create libpod libpodCreateVolume // --- + // tags: + // - volumes // summary: Create a volume // parameters: // - in: body @@ -26,8 +28,10 @@ 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/json volumes libpodListVolumes + // swagger:operation GET /libpod/volumes/json libpod libpodListVolumes // --- + // tags: + // - volumes // summary: List volumes // description: Returns a list of volumes // produces: @@ -48,8 +52,10 @@ 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 volumes libpodPruneVolumes + // swagger:operation POST /libpod/volumes/prune libpod libpodPruneVolumes // --- + // tags: + // - volumes // summary: Prune volumes // produces: // - application/json @@ -59,8 +65,10 @@ 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 volumes libpodInspectVolume + // swagger:operation GET /libpod/volumes/{name}/json libpod libpodInspectVolume // --- + // tags: + // - volumes // summary: Inspect volume // parameters: // - in: path @@ -78,8 +86,10 @@ 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} volumes libpodRemoveVolume + // swagger:operation DELETE /libpod/volumes/{name} libpod libpodRemoveVolume // --- + // tags: + // - volumes // summary: Remove volume // parameters: // - in: path @@ -110,6 +120,8 @@ func (s *APIServer) registerVolumeHandlers(r *mux.Router) error { // swagger:operation GET /volumes compat listVolumes // --- + // tags: + // - volumes (compat) // summary: List volumes // description: Returns a list of volume // produces: @@ -134,8 +146,10 @@ 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 volumes createVolume + // swagger:operation POST /volumes/create compat createVolume // --- + // tags: + // - volumes (compat) // summary: Create a volume // parameters: // - in: body @@ -153,8 +167,10 @@ 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} volumes inspectVolume + // swagger:operation GET /volumes/{name} compat inspectVolume // --- + // tags: + // - volumes (compat) // summary: Inspect volume // parameters: // - in: path @@ -174,8 +190,10 @@ 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} volumes removeVolume + // swagger:operation DELETE /volumes/{name} compat removeVolume // --- + // tags: + // - volumes (compat) // summary: Remove volume // parameters: // - in: path @@ -204,8 +222,10 @@ 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 volumes pruneVolumes + // swagger:operation POST /volumes/prune compat pruneVolumes // --- + // tags: + // - volumes (compat) // summary: Prune volumes // produces: // - application/json diff --git a/pkg/api/tags.yaml b/pkg/api/tags.yaml index f86f8dbea..0cfb3f440 100644 --- a/pkg/api/tags.yaml +++ b/pkg/api/tags.yaml @@ -23,5 +23,7 @@ tags: description: Actions related to images for the compatibility endpoints - name: networks (compat) description: Actions related to compatibility networks + - name: volumes (compat) + description: Actions related to volumes for the compatibility endpoints - name: system (compat) description: Actions related to Podman and compatibility engines diff --git a/pkg/domain/infra/abi/system.go b/pkg/domain/infra/abi/system.go index 478fac1d5..ff1052d86 100644 --- a/pkg/domain/infra/abi/system.go +++ b/pkg/domain/infra/abi/system.go @@ -8,6 +8,7 @@ import ( "os/exec" "path/filepath" "strconv" + "strings" "github.com/containers/common/pkg/config" "github.com/containers/podman/v2/libpod/define" @@ -73,7 +74,7 @@ func (ic *ContainerEngine) SetupRootless(_ context.Context, cmd *cobra.Command) initCommand, err := ioutil.ReadFile("/proc/1/comm") // On errors, default to systemd - runsUnderSystemd := err != nil || string(initCommand) == "systemd" + runsUnderSystemd := err != nil || strings.TrimRight(string(initCommand), "\n") == "systemd" unitName := fmt.Sprintf("podman-%d.scope", os.Getpid()) if runsUnderSystemd || conf.Engine.CgroupManager == config.SystemdCgroupsManager { diff --git a/pkg/spec/config_linux_cgo.go b/pkg/spec/config_linux_cgo.go index 186a3a788..da92f511f 100644 --- a/pkg/spec/config_linux_cgo.go +++ b/pkg/spec/config_linux_cgo.go @@ -5,10 +5,10 @@ package createconfig import ( "io/ioutil" + goSeccomp "github.com/containers/common/pkg/seccomp" "github.com/containers/podman/v2/pkg/seccomp" spec "github.com/opencontainers/runtime-spec/specs-go" "github.com/pkg/errors" - goSeccomp "github.com/seccomp/containers-golang" "github.com/sirupsen/logrus" ) diff --git a/pkg/specgen/generate/config_linux.go b/pkg/specgen/generate/config_linux.go index 35508c023..1d5dcd8e7 100644 --- a/pkg/specgen/generate/config_linux.go +++ b/pkg/specgen/generate/config_linux.go @@ -90,7 +90,7 @@ func DevicesFromPath(g *generate.Generator, devicePath string) error { } st, err := os.Stat(resolvedDevicePath) if err != nil { - return errors.Wrapf(err, "cannot stat %s", devicePath) + return errors.Wrapf(err, "cannot stat device path %s", devicePath) } if st.IsDir() { found := false diff --git a/pkg/specgen/generate/config_linux_cgo.go b/pkg/specgen/generate/config_linux_cgo.go index f35d56750..21a1c910d 100644 --- a/pkg/specgen/generate/config_linux_cgo.go +++ b/pkg/specgen/generate/config_linux_cgo.go @@ -6,12 +6,12 @@ import ( "context" "io/ioutil" + goSeccomp "github.com/containers/common/pkg/seccomp" "github.com/containers/podman/v2/libpod/image" "github.com/containers/podman/v2/pkg/seccomp" "github.com/containers/podman/v2/pkg/specgen" spec "github.com/opencontainers/runtime-spec/specs-go" "github.com/pkg/errors" - goSeccomp "github.com/seccomp/containers-golang" "github.com/sirupsen/logrus" ) |