mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-08-19 06:47:51 +00:00
swagger: fix deprecated alias annotations and model name collisions
Replace deprecated swagger:alias with swagger:model for ImagePullStatus and ArtifactPullStatus. Add explicit swagger:model annotations with unique names to Podman types that collide with vendor types (DriverData, PruneReport, RootFS, Secret, ThrottleDevice, WeightDevice, Version) to resolve colliding model name warnings from go-swagger. The types from libpod/define use a Libpod prefix, matching LibpodInfo which already does that. Apart from the prefix the names are the ones go-swagger derives on its own, so the annotations mostly just make the naming explicit so the tool stops warning about it. This does not close #29199 entirely. The two remaining name collisions (Mount and Summary) are each between two vendored types, so they cannot be controlled from the Podman side, and the dropped-ref-sibling warnings are a separate problem. Related: #29199 Signed-off-by: Satwik Sai Prakash Sahoo <sahoospsatwik@gmail.com>
This commit is contained in:
parent
612143733e
commit
05929acd90
7 changed files with 12 additions and 2 deletions
|
|
@ -67,11 +67,13 @@ const (
|
|||
K8sKindJob = "job"
|
||||
)
|
||||
|
||||
// swagger:model LibpodWeightDevice
|
||||
type WeightDevice struct {
|
||||
Path string
|
||||
Weight uint16
|
||||
}
|
||||
|
||||
// swagger:model LibpodThrottleDevice
|
||||
type ThrottleDevice struct {
|
||||
Path string
|
||||
Rate uint64
|
||||
|
|
|
|||
|
|
@ -870,6 +870,8 @@ type InspectExecProcess struct {
|
|||
}
|
||||
|
||||
// DriverData handles the data for a storage driver
|
||||
//
|
||||
// swagger:model LibpodDriverData
|
||||
type DriverData struct {
|
||||
Name string `json:"Name"`
|
||||
Data map[string]string `json:"Data"`
|
||||
|
|
|
|||
|
|
@ -22,6 +22,8 @@ var (
|
|||
)
|
||||
|
||||
// Version is an output struct for API
|
||||
//
|
||||
// swagger:model LibpodVersion
|
||||
type Version struct {
|
||||
APIVersion string
|
||||
Version string
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import (
|
|||
"errors"
|
||||
)
|
||||
|
||||
// swagger:model ReportsPruneReport
|
||||
type PruneReport struct {
|
||||
Id string `json:"Id"`
|
||||
Err error `json:"Err,omitempty"`
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ type ImageHistoryReport struct {
|
|||
Layers []ImageHistoryLayer
|
||||
}
|
||||
|
||||
// swagger:alias
|
||||
// swagger:model ImagePullStatus
|
||||
type ImagePullStatus string
|
||||
|
||||
const (
|
||||
|
|
@ -179,7 +179,7 @@ type ImagePullReport struct {
|
|||
Progress *ArtifactPullProgress `json:"pullProgress,omitempty"`
|
||||
}
|
||||
|
||||
// swagger:alias
|
||||
// swagger:model ArtifactPullStatus
|
||||
type ArtifactPullStatus string
|
||||
|
||||
const (
|
||||
|
|
|
|||
|
|
@ -37,6 +37,8 @@ type ImageData struct {
|
|||
}
|
||||
|
||||
// RootFS holds the root fs information of an image.
|
||||
//
|
||||
// swagger:model InspectRootFS
|
||||
type RootFS struct {
|
||||
Type string `json:"Type"`
|
||||
Layers []digest.Digest `json:"Layers"`
|
||||
|
|
|
|||
|
|
@ -649,6 +649,7 @@ func (s *SpecGenerator) IsInitContainer() bool {
|
|||
return len(s.InitContainerType) != 0
|
||||
}
|
||||
|
||||
// swagger:model SpecgenSecret
|
||||
type Secret struct {
|
||||
Source string
|
||||
Target string
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue