summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--RELEASE_NOTES.md6
-rw-r--r--changelog.txt53
-rw-r--r--contrib/podmanimage/README.md8
-rw-r--r--contrib/podmanimage/stable/manual/Containerfile39
-rw-r--r--contrib/podmanimage/upstream/Dockerfile4
-rw-r--r--pkg/api/handlers/generic/containers.go16
-rw-r--r--pkg/api/handlers/generic/images.go2
-rw-r--r--pkg/api/handlers/types.go23
-rw-r--r--pkg/api/server/register_auth.go2
-rw-r--r--pkg/api/server/register_containers.go36
-rw-r--r--pkg/api/server/register_distribution.go2
-rw-r--r--pkg/api/server/register_events.go2
-rw-r--r--pkg/api/server/register_exec.go8
-rw-r--r--pkg/api/server/register_images.go26
-rw-r--r--pkg/api/server/register_info.go2
-rw-r--r--pkg/api/server/register_monitor.go2
-rw-r--r--pkg/api/server/register_plugins.go2
-rw-r--r--pkg/api/server/register_swarm.go8
-rw-r--r--pkg/api/server/register_system.go2
19 files changed, 225 insertions, 18 deletions
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md
index f813b494f..513a3eeca 100644
--- a/RELEASE_NOTES.md
+++ b/RELEASE_NOTES.md
@@ -4,9 +4,11 @@
### Features
- Many networking-related flags have been added to `podman pod create` to enable customization of pod networks, including `--add-host`, `--dns`, `--dns-opt`, `--dns-search`, `--ip`, `--mac-address`, `--network`, and `--no-hosts`
- The `podman ps --format=json` command now includes the ID of the image containers were created with
+- The `podman run` and `podman create` commands now feature an `--rmi` flag to remove the image the container was using after it exits (if no other containers are using said image) ([#4628](https://github.com/containers/libpod/issues/4628))
- The `podman create` and `podman run` commands now support the `--device-cgroup-rule` flag ([#4876](https://github.com/containers/libpod/issues/4876))
- While the HTTP API remains in alpha, many fixes and additions have landed. These are documented in a separate subsection below
- The `podman create` and `podman run` commands now feature a `--no-healthcheck` flag to disable healthchecks for a container ([#5299](https://github.com/containers/libpod/issues/5299))
+- Containers now recognize the `io.containers.capabilities` label, which specifies a list of capabilities required by the image to run. These capabilities will be used as long as they are more restrictive than the default capabilities used
### Bugfixes
- Fixed CVE-2020-1726, a security issue where volumes manually populated before first being mounted into a container could have those contents overwritten on first being mounted into a container
@@ -33,6 +35,8 @@
- Fixed a bug where the `--uts` flag to `podman create` and `podman run` would only allow specifying containers by full ID ([#5289](https://github.com/containers/libpod/issues/5289))
- Fixed a bug where rootless Podman could segfault when passed a large number of file descriptors
- Fixed a bug where the `podman port` command was incorrectly interpreting additional arguments as container names, instead of port numbers
+- Fixed a bug where units created by `podman generate systemd` did not depend on network targets, and so could start before the system network was ready ([#4130](https://github.com/containers/libpod/issues/4130))
+- Fixed a bug where exec sessions in containers which did not specify a user would not inherit supplemental groups added to the container via `--group-add`
### HTTP API
- Initial support for secure connections to servers via SSH tunneling has been added
@@ -47,7 +51,7 @@
- Many fixes have been made to API documentation to ensure it matches the code
### Misc
-- Updated vendored Buildah to v1.14.1
+- Updated vendored Buildah to v1.14.2
- Updated vendored containers/storage to v1.16.0
- The `Created` field to `podman images --format=json` has been renamed to `CreatedSince` as part of the fix for ([#5110](https://github.com/containers/libpod/issues/5110)). Go templates using the old name should still work
- The `CreatedTime` field to `podman images --format=json` has been renamed to `CreatedAt` as part of the fix for ([#5110](https://github.com/containers/libpod/issues/5110)). Go templates using the old name should still work
diff --git a/changelog.txt b/changelog.txt
index 84d6dcea0..9b0968265 100644
--- a/changelog.txt
+++ b/changelog.txt
@@ -1,3 +1,56 @@
+- Changelog for v1.8.1-rc3 (2020-03-06)
+ * Update release notes for v1.8.1-RC3
+ * Part 2: try to clean up the long image instance names
+ * WIP: Try renaming long cirrus job names
+ * vendor: update github.com/containernetworking/cni to v0.7.2-0.20200304161608-4fae32b84921
+ * Removed extraneous comments and defaults plus amended variable declaration
+ * Removed the unnecessary code
+ * Implemented size parameter on GetContainer
+ * Implement size parameter on ListContainers
+ * Map configured status to created to match docker API states
+ * Fix to remove null entry from end of images json
+ * Register handlers without version to align with docker API
+ * golangci: enable goimports
+ * generate systemd: remove leading slashes
+ * exec: fix error code when conmon fails
+ * Vendor buildah 1.14.2
+ * env: don't set "container" env
+ * Fix podman image sign help output
+ * avoid adding to nil map
+ * Exec: use ErrorConmonRead
+ * exec: get the exit code from sync pipe instead of file
+ * generate systemd: add network dependencies
+ * Bump to Buildah v1.14.1
+ * APIv2 tests: add tests for stop
+ * Add the rmi flag to podman-run to delete container image
+ * consolidate env handling into pkg/env
+ * CI: format cirrus logs
+ * Update docs/source/markdown/podman-build.1.md
+ * Allow devs to set labels in container images for default capabilities.
+ * CI: add API v2 tests
+ * more swagger fixes
+ * Bump github.com/opencontainers/selinux from 1.3.2 to 1.3.3
+ * Add validate() for containers
+ * Cirrus: Fix gate image & false-positive exits
+ * Update pod bindings and Add test to validate prune pod apiv2 binding.
+ * Fix wrong condition in bindings test
+ * Ensure that exec sessions inherit supplemental groups
+ * Cirrus: Update VM images
+ * Cirrus: Force runc use in F30
+ * rework apiv2 wait endpoint|binding
+ * build: specify input fd to buildah
+ * Cirrus: Remove unnecessary handle_crun workaround
+ * Cirrus: Print env. vars at end of setup.
+ * Cirrus: Fix not growing Fedora root
+ * network create should use firewall plugin
+ * add firewall plugin (no backend) to default cni config
+ * binding tests for volumes
+ * Bump to v1.8.1-dev
+ * container Exists: fix URL
+ * CI: package_versions: include hostinfo, kernel
+ * Review comments
+ * [WIP] Add cmd flag to show container name in log
+
- Changelog for v1.8.1-rc2 (2020-02-27)
* Update release notes for v1.8.1-rc2
* Vendor in latest containers/buildah
diff --git a/contrib/podmanimage/README.md b/contrib/podmanimage/README.md
index ab55f3189..9d841cdba 100644
--- a/contrib/podmanimage/README.md
+++ b/contrib/podmanimage/README.md
@@ -10,10 +10,10 @@ the images live are public and can be pulled without credentials. These contain
resulting containers can run safely with privileges within the container. The container images are built
using the latest Fedora and then Podman is installed into them:
- * quay.io/podman/stable - This image is built using the latest stable version of Podman in a Fedora based container. Built with podman/stable/Dockerfile.
- * quay.io/podman/upstream - This image is built using the latest code found in this GitHub repository. When someone creates a commit and pushes it, the image is created. Due to that the image changes frequently and is not guaranteed to be stable. Built with podmanimage/upstream/Dockerfile.
- * quay.io/podman/testing - This image is built using the latest version of Podman that is or was in updates testing for Fedora. At times this may be the same as the stable image. This container image will primarily be used by the development teams for verification testing when a new package is created. Built with podmanimage/testing/Dockerfile.
-
+ * quay.io/podman/stable - This image is built using the latest stable version of Podman in a Fedora based container. Built with [podmanimage/stable/Dockerfile](stable/Dockerfile).
+ * quay.io/podman/upstream - This image is built using the latest code found in this GitHub repository. When someone creates a commit and pushes it, the image is created. Due to that the image changes frequently and is not guaranteed to be stable. Built with [podmanimage/upstream/Dockerfile](upstream/Dockerfile).
+ * quay.io/podman/testing - This image is built using the latest version of Podman that is or was in updates testing for Fedora. At times this may be the same as the stable image. This container image will primarily be used by the development teams for verification testing when a new package is created. Built with [podmanimage/testing/Dockerfile](testing/Dockerfile).
+ * quay.io/podman/stable:version - This image is built manually using a Fedora based container. An RPM is first pulled from the [Fedora Updates System](https://bodhi.fedoraproject.org/) and the image is built from there. For more details, see the Containerfile used to build it, [podmanimage/stable/manual/Containerfile](stable/manual/Containerfile).
## Sample Usage
diff --git a/contrib/podmanimage/stable/manual/Containerfile b/contrib/podmanimage/stable/manual/Containerfile
new file mode 100644
index 000000000..d76d6d9b4
--- /dev/null
+++ b/contrib/podmanimage/stable/manual/Containerfile
@@ -0,0 +1,39 @@
+# stable/manual/Containerfile
+#
+# Build a Podman container image from the latest
+# stable version of Podman on the Fedora Updates System.
+# https://bodhi.fedoraproject.org/updates/?search=podman
+# This image can be used to create a secured container
+# that runs safely with privileges within the container.
+# This Containerfile builds version 1.7.0, the version and
+# the RPM name would need to be adjusted before a run as
+# appropriate.
+#
+# To use, first copy an rpm file from bohdi to `/root/tmp`
+# and then run:
+# 'podman build -f ./Containerfile -t quay.io/podman/stable:v1.7.0 .'
+#
+# Once complete run:
+# `podman push quay.io/stable:v1.7.0 docker://quay.io/podman/stable:v1.7.0`
+#
+# Start Build Process using the latest Fedora
+FROM fedora:latest
+
+# Don't include container-selinux and remove
+# directories used by dnf that are just taking
+# up space.
+#
+COPY /tmp/podman-1.7.0-3.fc30.x86_64.rpm /tmp
+RUN yum -y install /tmp/podman-1.7.0-3.fc30.x86_64.rpm fuse-overlayfs --exclude container-selinux; rm -rf /var/cache /var/log/dnf* /var/log/yum.* /tmp/podman*.rpm
+
+# Adjust storage.conf to enable Fuse storage.
+RUN sed -i -e 's|^#mount_program|mount_program|g' -e '/additionalimage.*/a "/var/lib/shared",' /etc/containers/storage.conf
+RUN mkdir -p /var/lib/shared/overlay-images /var/lib/shared/overlay-layers; touch /var/lib/shared/overlay-images/images.lock; touch /var/lib/shared/overlay-layers/layers.lock
+
+# Adjust libpod.conf to write logging to a file
+RUN sed -i 's/events_logger = "journald"/events_logger = "file"/g' /usr/share/containers/libpod.conf; mkdir -p /run/systemd/journal
+
+# Set up environment variables to note that this is
+# not starting with usernamespace and default to
+# isolate the filesystem with chroot.
+ENV _BUILDAH_STARTED_IN_USERNS="" BUILDAH_ISOLATION=chroot
diff --git a/contrib/podmanimage/upstream/Dockerfile b/contrib/podmanimage/upstream/Dockerfile
index 7c9434fa6..847097920 100644
--- a/contrib/podmanimage/upstream/Dockerfile
+++ b/contrib/podmanimage/upstream/Dockerfile
@@ -19,16 +19,16 @@ ENV GOPATH=/root/podman
# that are needed for building but not running Podman
RUN useradd build; yum -y update; yum -y reinstall shadow-utils; yum -y install --exclude container-selinux \
--enablerepo=updates-testing \
- atomic-registries \
btrfs-progs-devel \
containernetworking-cni \
+ conmon \
device-mapper-devel \
git \
glib2-devel \
glibc-devel \
glibc-static \
go \
- golang-github-cpuguy83-go-md2man \
+ golang-github-cpuguy83-md2man \
gpgme-devel \
iptables \
libassuan-devel \
diff --git a/pkg/api/handlers/generic/containers.go b/pkg/api/handlers/generic/containers.go
index ab587ded4..b8460702c 100644
--- a/pkg/api/handlers/generic/containers.go
+++ b/pkg/api/handlers/generic/containers.go
@@ -57,6 +57,7 @@ func ListContainers(w http.ResponseWriter, r *http.Request) {
}{
// override any golang type defaults
}
+
if err := decoder.Decode(&query, r.URL.Query()); err != nil {
utils.Error(w, "Something went wrong.", http.StatusBadRequest, errors.Wrapf(err, "Failed to parse parameters for %s", r.URL.String()))
return
@@ -85,7 +86,7 @@ func ListContainers(w http.ResponseWriter, r *http.Request) {
var list = make([]*handlers.Container, len(containers))
for i, ctnr := range containers {
- api, err := handlers.LibpodToContainer(ctnr, infoData)
+ api, err := handlers.LibpodToContainer(ctnr, infoData, query.Size)
if err != nil {
utils.InternalServerError(w, err)
return
@@ -97,6 +98,17 @@ func ListContainers(w http.ResponseWriter, r *http.Request) {
func GetContainer(w http.ResponseWriter, r *http.Request) {
runtime := r.Context().Value("runtime").(*libpod.Runtime)
+ decoder := r.Context().Value("decoder").(*schema.Decoder)
+ query := struct {
+ Size bool `schema:"size"`
+ }{
+ // override any golang type defaults
+ }
+
+ if err := decoder.Decode(&query, r.URL.Query()); err != nil {
+ utils.Error(w, "Something went wrong.", http.StatusBadRequest, errors.Wrapf(err, "Failed to parse parameters for %s", r.URL.String()))
+ return
+ }
name := utils.GetName(r)
ctnr, err := runtime.LookupContainer(name)
@@ -104,7 +116,7 @@ func GetContainer(w http.ResponseWriter, r *http.Request) {
utils.ContainerNotFound(w, name, err)
return
}
- api, err := handlers.LibpodToContainerJSON(ctnr)
+ api, err := handlers.LibpodToContainerJSON(ctnr, query.Size)
if err != nil {
utils.InternalServerError(w, err)
return
diff --git a/pkg/api/handlers/generic/images.go b/pkg/api/handlers/generic/images.go
index 1ced499d9..3da5807ec 100644
--- a/pkg/api/handlers/generic/images.go
+++ b/pkg/api/handlers/generic/images.go
@@ -305,7 +305,7 @@ func GetImages(w http.ResponseWriter, r *http.Request) {
utils.Error(w, "Something went wrong.", http.StatusInternalServerError, errors.Wrap(err, "Failed get images"))
return
}
- var summaries = make([]*handlers.ImageSummary, len(images)+1)
+ var summaries = make([]*handlers.ImageSummary, len(images))
for j, img := range images {
is, err := handlers.ImageToImageSummary(img)
if err != nil {
diff --git a/pkg/api/handlers/types.go b/pkg/api/handlers/types.go
index 2930a9567..2e429dc58 100644
--- a/pkg/api/handlers/types.go
+++ b/pkg/api/handlers/types.go
@@ -347,7 +347,7 @@ func ImageDataToImageInspect(ctx context.Context, l *libpodImage.Image) (*ImageI
}
-func LibpodToContainer(l *libpod.Container, infoData []define.InfoData) (*Container, error) {
+func LibpodToContainer(l *libpod.Container, infoData []define.InfoData, sz bool) (*Container, error) {
imageId, imageName := l.Image()
var (
@@ -360,11 +360,18 @@ func LibpodToContainer(l *libpod.Container, infoData []define.InfoData) (*Contai
if state, err = l.State(); err != nil {
return nil, err
}
- if sizeRW, err = l.RWSize(); err != nil {
- return nil, err
+ stateStr := state.String()
+ if stateStr == "configured" {
+ stateStr = "created"
}
- if sizeRootFs, err = l.RootFsSize(); err != nil {
- return nil, err
+
+ if sz {
+ if sizeRW, err = l.RWSize(); err != nil {
+ return nil, err
+ }
+ if sizeRootFs, err = l.RootFsSize(); err != nil {
+ return nil, err
+ }
}
return &Container{docker.Container{
@@ -378,7 +385,7 @@ func LibpodToContainer(l *libpod.Container, infoData []define.InfoData) (*Contai
SizeRw: sizeRW,
SizeRootFs: sizeRootFs,
Labels: l.Labels(),
- State: string(state),
+ State: stateStr,
Status: "",
HostConfig: struct {
NetworkMode string `json:",omitempty"`
@@ -391,9 +398,9 @@ func LibpodToContainer(l *libpod.Container, infoData []define.InfoData) (*Contai
}, nil
}
-func LibpodToContainerJSON(l *libpod.Container) (*docker.ContainerJSON, error) {
+func LibpodToContainerJSON(l *libpod.Container, sz bool) (*docker.ContainerJSON, error) {
_, imageName := l.Image()
- inspect, err := l.Inspect(true)
+ inspect, err := l.Inspect(sz)
if err != nil {
return nil, err
}
diff --git a/pkg/api/server/register_auth.go b/pkg/api/server/register_auth.go
index 8db131153..7e51c2b63 100644
--- a/pkg/api/server/register_auth.go
+++ b/pkg/api/server/register_auth.go
@@ -7,5 +7,7 @@ import (
func (s *APIServer) registerAuthHandlers(r *mux.Router) error {
r.Handle(VersionedPath("/auth"), s.APIHandler(handlers.UnsupportedHandler))
+ // Added non version path to URI to support docker non versioned paths
+ r.Handle("/auth", s.APIHandler(handlers.UnsupportedHandler))
return nil
}
diff --git a/pkg/api/server/register_containers.go b/pkg/api/server/register_containers.go
index 6aad7ff88..a87e8eaee 100644
--- a/pkg/api/server/register_containers.go
+++ b/pkg/api/server/register_containers.go
@@ -34,6 +34,8 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/containers/create"), s.APIHandler(generic.CreateContainer)).Methods(http.MethodPost)
+ // Added non version path to URI to support docker non versioned paths
+ r.HandleFunc("/containers/create", s.APIHandler(generic.CreateContainer)).Methods(http.MethodPost)
// swagger:operation GET /containers/json compat listContainers
// ---
// tags:
@@ -84,6 +86,8 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/containers/json"), s.APIHandler(generic.ListContainers)).Methods(http.MethodGet)
+ // Added non version path to URI to support docker non versioned paths
+ r.HandleFunc("/containers/json", s.APIHandler(generic.ListContainers)).Methods(http.MethodGet)
// swagger:operation POST /containers/prune compat pruneContainers
// ---
// tags:
@@ -106,6 +110,8 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/containers/prune"), s.APIHandler(handlers.PruneContainers)).Methods(http.MethodPost)
+ // Added non version path to URI to support docker non versioned paths
+ r.HandleFunc("/containers/prune", s.APIHandler(handlers.PruneContainers)).Methods(http.MethodPost)
// swagger:operation DELETE /containers/{name} compat removeContainer
// ---
// tags:
@@ -145,6 +151,8 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/containers/{name}"), s.APIHandler(generic.RemoveContainer)).Methods(http.MethodDelete)
+ // Added non version path to URI to support docker non versioned paths
+ r.HandleFunc("/containers/{name}", s.APIHandler(generic.RemoveContainer)).Methods(http.MethodDelete)
// swagger:operation GET /containers/{name}/json compat getContainer
// ---
// tags:
@@ -172,6 +180,8 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/containers/{name}/json"), s.APIHandler(generic.GetContainer)).Methods(http.MethodGet)
+ // Added non version path to URI to support docker non versioned paths
+ r.HandleFunc("/containers/{name}/json", s.APIHandler(generic.GetContainer)).Methods(http.MethodGet)
// swagger:operation POST /containers/{name}/kill compat killContainer
// ---
// tags:
@@ -202,6 +212,8 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/containers/{name}/kill"), s.APIHandler(generic.KillContainer)).Methods(http.MethodPost)
+ // Added non version path to URI to support docker non versioned paths
+ r.HandleFunc("/containers/{name}/kill", s.APIHandler(generic.KillContainer)).Methods(http.MethodPost)
// swagger:operation GET /containers/{name}/logs compat logsFromContainer
// ---
// tags:
@@ -254,6 +266,8 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/containers/{name}/logs"), s.APIHandler(generic.LogsFromContainer)).Methods(http.MethodGet)
+ // Added non version path to URI to support docker non versioned paths
+ r.HandleFunc("/containers/{name}/logs", s.APIHandler(generic.LogsFromContainer)).Methods(http.MethodGet)
// swagger:operation POST /containers/{name}/pause compat pauseContainer
// ---
// tags:
@@ -276,7 +290,11 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/containers/{name}/pause"), s.APIHandler(handlers.PauseContainer)).Methods(http.MethodPost)
+ // Added non version path to URI to support docker non versioned paths
+ r.HandleFunc("/containers/{name}/pause", s.APIHandler(handlers.PauseContainer)).Methods(http.MethodPost)
r.HandleFunc(VersionedPath("/containers/{name}/rename"), s.APIHandler(handlers.UnsupportedHandler)).Methods(http.MethodPost)
+ // Added non version path to URI to support docker non versioned paths
+ r.HandleFunc("/containers/{name}/rename", s.APIHandler(handlers.UnsupportedHandler)).Methods(http.MethodPost)
// swagger:operation POST /containers/{name}/restart compat restartContainer
// ---
// tags:
@@ -302,6 +320,8 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/containers/{name}/restart"), s.APIHandler(handlers.RestartContainer)).Methods(http.MethodPost)
+ // Added non version path to URI to support docker non versioned paths
+ r.HandleFunc("/containers/{name}/restart", s.APIHandler(handlers.RestartContainer)).Methods(http.MethodPost)
// swagger:operation POST /containers/{name}/start compat startContainer
// ---
// tags:
@@ -330,6 +350,8 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/containers/{name}/start"), s.APIHandler(handlers.StartContainer)).Methods(http.MethodPost)
+ // Added non version path to URI to support docker non versioned paths
+ r.HandleFunc("/containers/{name}/start", s.APIHandler(handlers.StartContainer)).Methods(http.MethodPost)
// swagger:operation GET /containers/{name}/stats compat statsContainer
// ---
// tags:
@@ -357,6 +379,8 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/containers/{name}/stats"), s.APIHandler(generic.StatsContainer)).Methods(http.MethodGet)
+ // Added non version path to URI to support docker non versioned paths
+ r.HandleFunc("/containers/{name}/stats", s.APIHandler(generic.StatsContainer)).Methods(http.MethodGet)
// swagger:operation POST /containers/{name}/stop compat stopContainer
// ---
// tags:
@@ -385,6 +409,8 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/containers/{name}/stop"), s.APIHandler(handlers.StopContainer)).Methods(http.MethodPost)
+ // Added non version path to URI to support docker non versioned paths
+ r.HandleFunc("/containers/{name}/stop", s.APIHandler(handlers.StopContainer)).Methods(http.MethodPost)
// swagger:operation GET /containers/{name}/top compat topContainer
// ---
// tags:
@@ -410,6 +436,8 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/containers/{name}/top"), s.APIHandler(handlers.TopContainer)).Methods(http.MethodGet)
+ // Added non version path to URI to support docker non versioned paths
+ r.HandleFunc("/containers/{name}/top", s.APIHandler(handlers.TopContainer)).Methods(http.MethodGet)
// swagger:operation POST /containers/{name}/unpause compat unpauseContainer
// ---
// tags:
@@ -432,6 +460,8 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/containers/{name}/unpause"), s.APIHandler(handlers.UnpauseContainer)).Methods(http.MethodPost)
+ // Added non version path to URI to support docker non versioned paths
+ r.HandleFunc("/containers/{name}/unpause", s.APIHandler(handlers.UnpauseContainer)).Methods(http.MethodPost)
// swagger:operation POST /containers/{name}/wait compat waitContainer
// ---
// tags:
@@ -465,6 +495,8 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/containers/{name}/wait"), s.APIHandler(generic.WaitContainer)).Methods(http.MethodPost)
+ // Added non version path to URI to support docker non versioned paths
+ r.HandleFunc("/containers/{name}/wait", s.APIHandler(generic.WaitContainer)).Methods(http.MethodPost)
// swagger:operation POST /containers/{name}/attach compat attachContainer
// ---
// tags:
@@ -520,6 +552,8 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/containers/{name}/attach"), s.APIHandler(handlers.AttachContainer)).Methods(http.MethodPost)
+ // Added non version path to URI to support docker non versioned paths
+ r.HandleFunc("/containers/{name}/attach", s.APIHandler(handlers.AttachContainer)).Methods(http.MethodPost)
// swagger:operation POST /containers/{name}/resize compat resizeContainer
// ---
// tags:
@@ -552,6 +586,8 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/containers/{name}/resize"), s.APIHandler(handlers.ResizeContainer)).Methods(http.MethodPost)
+ // Added non version path to URI to support docker non versioned paths
+ r.HandleFunc("/containers/{name}/resize", s.APIHandler(handlers.ResizeContainer)).Methods(http.MethodPost)
/*
libpod endpoints
diff --git a/pkg/api/server/register_distribution.go b/pkg/api/server/register_distribution.go
index f03662224..730129d5d 100644
--- a/pkg/api/server/register_distribution.go
+++ b/pkg/api/server/register_distribution.go
@@ -7,5 +7,7 @@ import (
func (s *APIServer) registerDistributionHandlers(r *mux.Router) error {
r.HandleFunc(VersionedPath("/distribution/{name}/json"), handlers.UnsupportedHandler)
+ // Added non version path to URI to support docker non versioned paths
+ r.HandleFunc("/distribution/{name}/json", handlers.UnsupportedHandler)
return nil
}
diff --git a/pkg/api/server/register_events.go b/pkg/api/server/register_events.go
index bc3b62662..ea5d21882 100644
--- a/pkg/api/server/register_events.go
+++ b/pkg/api/server/register_events.go
@@ -35,5 +35,7 @@ func (s *APIServer) registerEventsHandlers(r *mux.Router) error {
// 500:
// "$ref": "#/responses/InternalError"
r.Handle(VersionedPath("/events"), s.APIHandler(handlers.GetEvents)).Methods(http.MethodGet)
+ // Added non version path to URI to support docker non versioned paths
+ r.Handle("/events", s.APIHandler(handlers.GetEvents)).Methods(http.MethodGet)
return nil
}
diff --git a/pkg/api/server/register_exec.go b/pkg/api/server/register_exec.go
index ad62de3f5..76033a9ca 100644
--- a/pkg/api/server/register_exec.go
+++ b/pkg/api/server/register_exec.go
@@ -75,6 +75,8 @@ func (s *APIServer) registerExecHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.Handle(VersionedPath("/containers/{name}/create"), s.APIHandler(handlers.CreateExec)).Methods(http.MethodPost)
+ // Added non version path to URI to support docker non versioned paths
+ r.Handle("/containers/{name}/create", s.APIHandler(handlers.CreateExec)).Methods(http.MethodPost)
// swagger:operation POST /exec/{id}/start compat startExec
// ---
// tags:
@@ -111,6 +113,8 @@ func (s *APIServer) registerExecHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.Handle(VersionedPath("/exec/{id}/start"), s.APIHandler(handlers.StartExec)).Methods(http.MethodPost)
+ // Added non version path to URI to support docker non versioned paths
+ r.Handle("/exec/{id}/start", s.APIHandler(handlers.StartExec)).Methods(http.MethodPost)
// swagger:operation POST /exec/{id}/resize compat resizeExec
// ---
// tags:
@@ -142,6 +146,8 @@ func (s *APIServer) registerExecHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.Handle(VersionedPath("/exec/{id}/resize"), s.APIHandler(handlers.ResizeExec)).Methods(http.MethodPost)
+ // Added non version path to URI to support docker non versioned paths
+ r.Handle("/exec/{id}/resize", s.APIHandler(handlers.ResizeExec)).Methods(http.MethodPost)
// swagger:operation GET /exec/{id}/json compat inspectExec
// ---
// tags:
@@ -164,6 +170,8 @@ func (s *APIServer) registerExecHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.Handle(VersionedPath("/exec/{id}/json"), s.APIHandler(handlers.InspectExec)).Methods(http.MethodGet)
+ // Added non version path to URI to support docker non versioned paths
+ r.Handle("/exec/{id}/json", s.APIHandler(handlers.InspectExec)).Methods(http.MethodGet)
/*
libpod api follows
diff --git a/pkg/api/server/register_images.go b/pkg/api/server/register_images.go
index 2b164a7a7..8c75c4d04 100644
--- a/pkg/api/server/register_images.go
+++ b/pkg/api/server/register_images.go
@@ -48,7 +48,11 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.Handle(VersionedPath("/images/create"), s.APIHandler(generic.CreateImageFromImage)).Methods(http.MethodPost).Queries("fromImage", "{fromImage}")
+ // Added non version path to URI to support docker non versioned paths
+ r.Handle("/images/create", s.APIHandler(generic.CreateImageFromImage)).Methods(http.MethodPost).Queries("fromImage", "{fromImage}")
r.Handle(VersionedPath("/images/create"), s.APIHandler(generic.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(generic.CreateImageFromSrc)).Methods(http.MethodPost).Queries("fromSrc", "{fromSrc}")
// swagger:operation GET /images/json compat listImages
// ---
// tags:
@@ -84,6 +88,8 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// 500:
// $ref: '#/responses/InternalError'
r.Handle(VersionedPath("/images/json"), s.APIHandler(generic.GetImages)).Methods(http.MethodGet)
+ // Added non version path to URI to support docker non versioned paths
+ r.Handle("/images/json", s.APIHandler(generic.GetImages)).Methods(http.MethodGet)
// swagger:operation POST /images/load compat importImage
// ---
// tags:
@@ -108,6 +114,8 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// 500:
// $ref: '#/responses/InternalError'
r.Handle(VersionedPath("/images/load"), s.APIHandler(generic.LoadImages)).Methods(http.MethodPost)
+ // Added non version path to URI to support docker non versioned paths
+ r.Handle("/images/load", s.APIHandler(generic.LoadImages)).Methods(http.MethodPost)
// swagger:operation POST /images/prune compat pruneImages
// ---
// tags:
@@ -133,6 +141,8 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// 500:
// $ref: '#/responses/InternalError'
r.Handle(VersionedPath("/images/prune"), s.APIHandler(generic.PruneImages)).Methods(http.MethodPost)
+ // Added non version path to URI to support docker non versioned paths
+ r.Handle("/images/prune", s.APIHandler(generic.PruneImages)).Methods(http.MethodPost)
// swagger:operation GET /images/search compat searchImages
// ---
// tags:
@@ -166,6 +176,8 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// 500:
// $ref: '#/responses/InternalError'
r.Handle(VersionedPath("/images/search"), s.APIHandler(handlers.SearchImages)).Methods(http.MethodGet)
+ // Added non version path to URI to support docker non versioned paths
+ r.Handle("/images/search", s.APIHandler(handlers.SearchImages)).Methods(http.MethodGet)
// swagger:operation DELETE /images/{name:.*} compat removeImage
// ---
// tags:
@@ -198,6 +210,8 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// 500:
// $ref: '#/responses/InternalError'
r.Handle(VersionedPath("/images/{name:.*}"), s.APIHandler(handlers.RemoveImage)).Methods(http.MethodDelete)
+ // Added non version path to URI to support docker non versioned paths
+ r.Handle("/images/{name:.*}", s.APIHandler(handlers.RemoveImage)).Methods(http.MethodDelete)
// swagger:operation GET /images/{name:.*}/get compat exportImage
// ---
// tags:
@@ -221,6 +235,8 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// 500:
// $ref: '#/responses/InternalError'
r.Handle(VersionedPath("/images/{name:.*}/get"), s.APIHandler(generic.ExportImage)).Methods(http.MethodGet)
+ // Added non version path to URI to support docker non versioned paths
+ r.Handle("/images/{name:.*}/get", s.APIHandler(generic.ExportImage)).Methods(http.MethodGet)
// swagger:operation GET /images/{name:.*}/history compat imageHistory
// ---
// tags:
@@ -243,6 +259,8 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.Handle(VersionedPath("/images/{name:.*}/history"), s.APIHandler(handlers.HistoryImage)).Methods(http.MethodGet)
+ // Added non version path to URI to support docker non versioned paths
+ r.Handle("/images/{name:.*}/history", s.APIHandler(handlers.HistoryImage)).Methods(http.MethodGet)
// swagger:operation GET /images/{name:.*}/json compat inspectImage
// ---
// tags:
@@ -265,6 +283,8 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.Handle(VersionedPath("/images/{name:.*}/json"), s.APIHandler(generic.GetImage)).Methods(http.MethodGet)
+ // Added non version path to URI to support docker non versioned paths
+ r.Handle("/images/{name:.*}/json", s.APIHandler(generic.GetImage)).Methods(http.MethodGet)
// swagger:operation POST /images/{name:.*}/tag compat tagImage
// ---
// tags:
@@ -299,6 +319,8 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// 500:
// $ref: '#/responses/InternalError'
r.Handle(VersionedPath("/images/{name:.*}/tag"), s.APIHandler(handlers.TagImage)).Methods(http.MethodPost)
+ // Added non version path to URI to support docker non versioned paths
+ r.Handle("/images/{name:.*}/tag", s.APIHandler(handlers.TagImage)).Methods(http.MethodPost)
// swagger:operation POST /commit compat commitContainer
// ---
// tags:
@@ -344,6 +366,8 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// 500:
// $ref: '#/responses/InternalError'
r.Handle(VersionedPath("/commit"), s.APIHandler(generic.CommitContainer)).Methods(http.MethodPost)
+ // Added non version path to URI to support docker non versioned paths
+ r.Handle("/commit", s.APIHandler(generic.CommitContainer)).Methods(http.MethodPost)
// swagger:operation POST /build compat buildImage
// ---
@@ -554,6 +578,8 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.Handle(VersionedPath("/build"), s.APIHandler(handlers.BuildImage)).Methods(http.MethodPost)
+ // Added non version path to URI to support docker non versioned paths
+ r.Handle("/build", s.APIHandler(handlers.BuildImage)).Methods(http.MethodPost)
/*
libpod endpoints
*/
diff --git a/pkg/api/server/register_info.go b/pkg/api/server/register_info.go
index 36c467cc3..975a19fef 100644
--- a/pkg/api/server/register_info.go
+++ b/pkg/api/server/register_info.go
@@ -22,5 +22,7 @@ func (s *APIServer) registerInfoHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.Handle(VersionedPath("/info"), s.APIHandler(generic.GetInfo)).Methods(http.MethodGet)
+ // Added non version path to URI to support docker non versioned paths
+ r.Handle("/info", s.APIHandler(generic.GetInfo)).Methods(http.MethodGet)
return nil
}
diff --git a/pkg/api/server/register_monitor.go b/pkg/api/server/register_monitor.go
index dbe0d27ce..b821efbaa 100644
--- a/pkg/api/server/register_monitor.go
+++ b/pkg/api/server/register_monitor.go
@@ -7,5 +7,7 @@ import (
func (s *APIServer) registerMonitorHandlers(r *mux.Router) error {
r.Handle(VersionedPath("/monitor"), s.APIHandler(handlers.UnsupportedHandler))
+ // Added non version path to URI to support docker non versioned paths
+ r.Handle("/monitor", s.APIHandler(handlers.UnsupportedHandler))
return nil
}
diff --git a/pkg/api/server/register_plugins.go b/pkg/api/server/register_plugins.go
index 479a79d1f..50026f6ad 100644
--- a/pkg/api/server/register_plugins.go
+++ b/pkg/api/server/register_plugins.go
@@ -7,5 +7,7 @@ import (
func (s *APIServer) registerPluginsHandlers(r *mux.Router) error {
r.Handle(VersionedPath("/plugins"), s.APIHandler(handlers.UnsupportedHandler))
+ // Added non version path to URI to support docker non versioned paths
+ r.Handle("/plugins", s.APIHandler(handlers.UnsupportedHandler))
return nil
}
diff --git a/pkg/api/server/register_swarm.go b/pkg/api/server/register_swarm.go
index e37ac4e41..8a5588268 100644
--- a/pkg/api/server/register_swarm.go
+++ b/pkg/api/server/register_swarm.go
@@ -16,6 +16,14 @@ func (s *APIServer) registerSwarmHandlers(r *mux.Router) error {
r.PathPrefix("/v{version:[0-9.]+}/services/").HandlerFunc(noSwarm)
r.PathPrefix("/v{version:[0-9.]+}/swarm/").HandlerFunc(noSwarm)
r.PathPrefix("/v{version:[0-9.]+}/tasks/").HandlerFunc(noSwarm)
+
+ // Added non version path to URI to support docker non versioned paths
+ r.PathPrefix("/configs/").HandlerFunc(noSwarm)
+ r.PathPrefix("/nodes/").HandlerFunc(noSwarm)
+ r.PathPrefix("/secrets/").HandlerFunc(noSwarm)
+ r.PathPrefix("/services/").HandlerFunc(noSwarm)
+ r.PathPrefix("/swarm/").HandlerFunc(noSwarm)
+ r.PathPrefix("/tasks/").HandlerFunc(noSwarm)
return nil
}
diff --git a/pkg/api/server/register_system.go b/pkg/api/server/register_system.go
index 188c1cdac..4776692f5 100644
--- a/pkg/api/server/register_system.go
+++ b/pkg/api/server/register_system.go
@@ -9,5 +9,7 @@ import (
func (s *APIServer) registerSystemHandlers(r *mux.Router) error {
r.Handle(VersionedPath("/system/df"), s.APIHandler(generic.GetDiskUsage)).Methods(http.MethodGet)
+ // Added non version path to URI to support docker non versioned paths
+ r.Handle("/system/df", s.APIHandler(generic.GetDiskUsage)).Methods(http.MethodGet)
return nil
}