From f19ef20a4414a6f63da8fb2493e6010359652ad1 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sat, 5 Mar 2022 19:57:43 +0100 Subject: [PATCH] api: move types.Volume to volume.Volume Signed-off-by: Sebastiaan van Stijn --- api/types/deprecated.go | 14 ++++++++++++++ api/types/{ => volume}/volume.go | 2 +- hack/generate-swagger-api.sh | 10 +++++++--- 3 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 api/types/deprecated.go rename api/types/{ => volume}/volume.go (99%) diff --git a/api/types/deprecated.go b/api/types/deprecated.go new file mode 100644 index 0000000000..7666a7173a --- /dev/null +++ b/api/types/deprecated.go @@ -0,0 +1,14 @@ +package types // import "github.com/docker/docker/api/types" + +import "github.com/docker/docker/api/types/volume" + +// Volume volume +// +// Deprecated: use github.com/docker/docker/api/types/volume.Volume +type Volume = volume.Volume + +// VolumeUsageData Usage details about the volume. This information is used by the +// `GET /system/df` endpoint, and omitted in other endpoints. +// +// Deprecated: use github.com/docker/docker/api/types/volume.VolumeUsageData +type VolumeUsageData = volume.VolumeUsageData diff --git a/api/types/volume.go b/api/types/volume/volume.go similarity index 99% rename from api/types/volume.go rename to api/types/volume/volume.go index c69b08448d..047b54c598 100644 --- a/api/types/volume.go +++ b/api/types/volume/volume.go @@ -1,4 +1,4 @@ -package types +package volume // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command diff --git a/hack/generate-swagger-api.sh b/hack/generate-swagger-api.sh index e300212e35..d9be64c264 100755 --- a/hack/generate-swagger-api.sh +++ b/hack/generate-swagger-api.sh @@ -8,10 +8,13 @@ swagger generate model -f api/swagger.yaml \ -n IdResponse \ -n ImageDeleteResponseItem \ -n ImageSummary \ - -n Plugin -n PluginDevice -n PluginMount -n PluginEnv -n PluginInterfaceType \ + -n Plugin \ + -n PluginDevice \ + -n PluginMount \ + -n PluginEnv \ + -n PluginInterfaceType \ -n Port \ - -n ServiceUpdateResponse \ - -n Volume + -n ServiceUpdateResponse swagger generate model -f api/swagger.yaml \ -t api -m types/container --skip-validator -C api/swagger-gen.yaml \ @@ -20,6 +23,7 @@ swagger generate model -f api/swagger.yaml \ swagger generate model -f api/swagger.yaml \ -t api -m types/volume --skip-validator -C api/swagger-gen.yaml \ + -n Volume \ -n VolumeCreateOptions swagger generate operation -f api/swagger.yaml \