mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
api/types: move GraphDriverData to api/types/storage
The `GraphDriverData` type is shared between images and containers, and putting it in either package would result in a circular import, so adding a new package for this type. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -19,6 +19,7 @@ import (
|
||||
"github.com/docker/docker/api/types/filters"
|
||||
imagetypes "github.com/docker/docker/api/types/image"
|
||||
"github.com/docker/docker/api/types/registry"
|
||||
"github.com/docker/docker/api/types/storage"
|
||||
"github.com/docker/docker/api/types/versions"
|
||||
"github.com/docker/docker/builder/remotecontext"
|
||||
"github.com/docker/docker/dockerversion"
|
||||
@@ -376,7 +377,7 @@ func (ir *imageRouter) toImageInspect(img *image.Image) (*types.ImageInspect, er
|
||||
Os: img.OperatingSystem(),
|
||||
OsVersion: img.OSVersion,
|
||||
Size: img.Details.Size,
|
||||
GraphDriver: types.GraphDriverData{
|
||||
GraphDriver: storage.DriverData{
|
||||
Name: img.Details.Driver,
|
||||
Data: img.Details.Metadata,
|
||||
},
|
||||
|
||||
@@ -1917,7 +1917,7 @@ definitions:
|
||||
type: "string"
|
||||
example: "4443"
|
||||
|
||||
GraphDriverData:
|
||||
DriverData:
|
||||
description: |
|
||||
Information about the storage driver used to store the container's and
|
||||
image's filesystem.
|
||||
@@ -2107,7 +2107,7 @@ definitions:
|
||||
format: "int64"
|
||||
example: 1239828
|
||||
GraphDriver:
|
||||
$ref: "#/definitions/GraphDriverData"
|
||||
$ref: "#/definitions/DriverData"
|
||||
RootFS:
|
||||
description: |
|
||||
Information about the image's RootFS, including the layer IDs.
|
||||
@@ -7123,7 +7123,7 @@ paths:
|
||||
HostConfig:
|
||||
$ref: "#/definitions/HostConfig"
|
||||
GraphDriver:
|
||||
$ref: "#/definitions/GraphDriverData"
|
||||
$ref: "#/definitions/DriverData"
|
||||
SizeRw:
|
||||
description: |
|
||||
The size of files that have been created or changed by this
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package types
|
||||
package storage
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
// GraphDriverData Information about the storage driver used to store the container's and
|
||||
// DriverData Information about the storage driver used to store the container's and
|
||||
// image's filesystem.
|
||||
//
|
||||
// swagger:model GraphDriverData
|
||||
type GraphDriverData struct {
|
||||
// swagger:model DriverData
|
||||
type DriverData struct {
|
||||
|
||||
// Low-level storage metadata, provided as key/value pairs.
|
||||
//
|
||||
@@ -6,6 +6,7 @@ import (
|
||||
"github.com/docker/docker/api/types/container"
|
||||
"github.com/docker/docker/api/types/filters"
|
||||
"github.com/docker/docker/api/types/image"
|
||||
"github.com/docker/docker/api/types/storage"
|
||||
"github.com/docker/docker/api/types/swarm"
|
||||
"github.com/docker/docker/api/types/volume"
|
||||
)
|
||||
@@ -122,7 +123,7 @@ type ImageInspect struct {
|
||||
|
||||
// GraphDriver holds information about the storage driver used to store the
|
||||
// container's and image's filesystem.
|
||||
GraphDriver GraphDriverData
|
||||
GraphDriver storage.DriverData
|
||||
|
||||
// RootFS contains information about the image's RootFS, including the
|
||||
// layer IDs.
|
||||
@@ -242,7 +243,7 @@ type ContainerJSONBase struct {
|
||||
AppArmorProfile string
|
||||
ExecIDs []string
|
||||
HostConfig *container.HostConfig
|
||||
GraphDriver GraphDriverData
|
||||
GraphDriver storage.DriverData
|
||||
SizeRw *int64 `json:",omitempty"`
|
||||
SizeRootFs *int64 `json:",omitempty"`
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import (
|
||||
"github.com/docker/docker/api/types/image"
|
||||
"github.com/docker/docker/api/types/network"
|
||||
"github.com/docker/docker/api/types/registry"
|
||||
"github.com/docker/docker/api/types/storage"
|
||||
"github.com/docker/docker/api/types/volume"
|
||||
)
|
||||
|
||||
@@ -260,3 +261,9 @@ type MountPoint = container.MountPoint
|
||||
//
|
||||
// Deprecated: use [container.Port].
|
||||
type Port = container.Port
|
||||
|
||||
// GraphDriverData Information about the storage driver used to store the container's and
|
||||
// image's filesystem.
|
||||
//
|
||||
// Deprecated: use [storage.DriverData].
|
||||
type GraphDriverData = storage.DriverData
|
||||
|
||||
@@ -4,7 +4,6 @@ set -eu
|
||||
swagger generate model -f api/swagger.yaml \
|
||||
-t api -m types --skip-validator -C api/swagger-gen.yaml \
|
||||
-n ErrorResponse \
|
||||
-n GraphDriverData \
|
||||
-n IdResponse \
|
||||
-n Plugin \
|
||||
-n PluginDevice \
|
||||
@@ -12,6 +11,10 @@ swagger generate model -f api/swagger.yaml \
|
||||
-n PluginEnv \
|
||||
-n PluginInterfaceType
|
||||
|
||||
swagger generate model -f api/swagger.yaml \
|
||||
-t api -m types/storage --skip-validator -C api/swagger-gen.yaml \
|
||||
-n DriverData
|
||||
|
||||
swagger generate model -f api/swagger.yaml \
|
||||
-t api -m types/container --skip-validator -C api/swagger-gen.yaml \
|
||||
-n ContainerCreateResponse \
|
||||
|
||||
Reference in New Issue
Block a user