Просмотр исходного кода

api/types: rename volume.VolumeUsageData to volume.UsageData

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn 3 лет назад
Родитель
Сommit
4caf68f4f6
4 измененных файлов с 8 добавлено и 7 удалено
  1. 1 0
      api/swagger.yaml
  2. 2 2
      api/types/deprecated.go
  3. 4 4
      api/types/volume/volume.go
  4. 1 1
      volume/service/convert.go

+ 1 - 0
api/swagger.yaml

@@ -2009,6 +2009,7 @@ definitions:
       UsageData:
         type: "object"
         x-nullable: true
+        x-go-name: "UsageData"
         required: [Size, RefCount]
         description: |
           Usage details about the volume. This information is used by the

+ 2 - 2
api/types/deprecated.go

@@ -10,5 +10,5 @@ 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
+// Deprecated: use github.com/docker/docker/api/types/volume.UsageData
+type VolumeUsageData = volume.UsageData

+ 4 - 4
api/types/volume/volume.go

@@ -47,14 +47,14 @@ type Volume struct {
 	Status map[string]interface{} `json:"Status,omitempty"`
 
 	// usage data
-	UsageData *VolumeUsageData `json:"UsageData,omitempty"`
+	UsageData *UsageData `json:"UsageData,omitempty"`
 }
 
-// VolumeUsageData Usage details about the volume. This information is used by the
+// UsageData Usage details about the volume. This information is used by the
 // `GET /system/df` endpoint, and omitted in other endpoints.
 //
-// swagger:model VolumeUsageData
-type VolumeUsageData struct {
+// swagger:model UsageData
+type UsageData struct {
 
 	// The number of containers referencing this volume. This field
 	// is set to `-1` if the reference-count is not available.

+ 1 - 1
volume/service/convert.go

@@ -69,7 +69,7 @@ func (s *VolumesService) volumesToAPI(ctx context.Context, volumes []volume.Volu
 				logrus.WithError(err).WithField("volume", v.Name()).Warnf("Failed to determine size of volume")
 				sz = -1
 			}
-			apiV.UsageData = &volumetypes.VolumeUsageData{Size: sz, RefCount: int64(s.vs.CountReferences(v))}
+			apiV.UsageData = &volumetypes.UsageData{Size: sz, RefCount: int64(s.vs.CountReferences(v))}
 		}
 
 		out = append(out, &apiV)