summaryrefslogtreecommitdiff
path: root/pkg/api/handlers/compat
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/api/handlers/compat')
-rw-r--r--pkg/api/handlers/compat/containers.go12
-rw-r--r--pkg/api/handlers/compat/networks.go6
-rw-r--r--pkg/api/handlers/compat/volumes.go5
3 files changed, 14 insertions, 9 deletions
diff --git a/pkg/api/handlers/compat/containers.go b/pkg/api/handlers/compat/containers.go
index 18005e24a..4f101ce84 100644
--- a/pkg/api/handlers/compat/containers.go
+++ b/pkg/api/handlers/compat/containers.go
@@ -34,11 +34,12 @@ import (
func RemoveContainer(w http.ResponseWriter, r *http.Request) {
decoder := r.Context().Value(api.DecoderKey).(*schema.Decoder)
query := struct {
- Force bool `schema:"force"`
- Ignore bool `schema:"ignore"`
- Link bool `schema:"link"`
- DockerVolumes bool `schema:"v"`
- LibpodVolumes bool `schema:"volumes"`
+ Force bool `schema:"force"`
+ Ignore bool `schema:"ignore"`
+ Link bool `schema:"link"`
+ Timeout *uint `schema:"timeout"`
+ DockerVolumes bool `schema:"v"`
+ LibpodVolumes bool `schema:"volumes"`
}{
// override any golang type defaults
}
@@ -55,6 +56,7 @@ func RemoveContainer(w http.ResponseWriter, r *http.Request) {
}
if utils.IsLibpodRequest(r) {
options.Volumes = query.LibpodVolumes
+ options.Timeout = query.Timeout
} else {
if query.Link {
utils.Error(w, http.StatusText(http.StatusBadRequest), http.StatusBadRequest,
diff --git a/pkg/api/handlers/compat/networks.go b/pkg/api/handlers/compat/networks.go
index b1456ed9e..dd28f6deb 100644
--- a/pkg/api/handlers/compat/networks.go
+++ b/pkg/api/handlers/compat/networks.go
@@ -245,7 +245,8 @@ func RemoveNetwork(w http.ResponseWriter, r *http.Request) {
ic := abi.ContainerEngine{Libpod: runtime}
query := struct {
- Force bool `schema:"force"`
+ Force bool `schema:"force"`
+ Timeout *uint `schema:"timeout"`
}{
// This is where you can override the golang default value for one of fields
}
@@ -257,7 +258,8 @@ func RemoveNetwork(w http.ResponseWriter, r *http.Request) {
}
options := entities.NetworkRmOptions{
- Force: query.Force,
+ Force: query.Force,
+ Timeout: query.Timeout,
}
name := utils.GetName(r)
diff --git a/pkg/api/handlers/compat/volumes.go b/pkg/api/handlers/compat/volumes.go
index 0f9b66888..e779aa185 100644
--- a/pkg/api/handlers/compat/volumes.go
+++ b/pkg/api/handlers/compat/volumes.go
@@ -213,7 +213,8 @@ func RemoveVolume(w http.ResponseWriter, r *http.Request) {
decoder = r.Context().Value(api.DecoderKey).(*schema.Decoder)
)
query := struct {
- Force bool `schema:"force"`
+ Force bool `schema:"force"`
+ Timeout *uint `schema:"timeout"`
}{
// override any golang type defaults
}
@@ -239,7 +240,7 @@ func RemoveVolume(w http.ResponseWriter, r *http.Request) {
vol, err := runtime.LookupVolume(name)
if err == nil {
// As above, we do not pass `force` from the query parameters here
- if err := runtime.RemoveVolume(r.Context(), vol, false); err != nil {
+ if err := runtime.RemoveVolume(r.Context(), vol, false, query.Timeout); err != nil {
if errors.Cause(err) == define.ErrVolumeBeingUsed {
utils.Error(w, "volumes being used", http.StatusConflict, err)
} else {