From 05929acd90d9e8b933ec09680bb33f97ff9f2f01 Mon Sep 17 00:00:00 2001 From: Satwik Sai Prakash Sahoo Date: Sat, 25 Jul 2026 22:41:36 +0530 Subject: [PATCH] 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 --- libpod/define/container.go | 2 ++ libpod/define/container_inspect.go | 2 ++ libpod/define/version.go | 2 ++ pkg/domain/entities/reports/prune.go | 1 + pkg/domain/entities/types/images.go | 4 ++-- pkg/inspect/inspect.go | 2 ++ pkg/specgen/specgen.go | 1 + 7 files changed, 12 insertions(+), 2 deletions(-) diff --git a/libpod/define/container.go b/libpod/define/container.go index 56cd225adb..c7a5b3abe0 100644 --- a/libpod/define/container.go +++ b/libpod/define/container.go @@ -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 diff --git a/libpod/define/container_inspect.go b/libpod/define/container_inspect.go index e93eb70742..186d974f92 100644 --- a/libpod/define/container_inspect.go +++ b/libpod/define/container_inspect.go @@ -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"` diff --git a/libpod/define/version.go b/libpod/define/version.go index 972b445db8..c38c260619 100644 --- a/libpod/define/version.go +++ b/libpod/define/version.go @@ -22,6 +22,8 @@ var ( ) // Version is an output struct for API +// +// swagger:model LibpodVersion type Version struct { APIVersion string Version string diff --git a/pkg/domain/entities/reports/prune.go b/pkg/domain/entities/reports/prune.go index dfe51f7454..1f4b5a970f 100644 --- a/pkg/domain/entities/reports/prune.go +++ b/pkg/domain/entities/reports/prune.go @@ -5,6 +5,7 @@ import ( "errors" ) +// swagger:model ReportsPruneReport type PruneReport struct { Id string `json:"Id"` Err error `json:"Err,omitempty"` diff --git a/pkg/domain/entities/types/images.go b/pkg/domain/entities/types/images.go index 21af3b6a4a..0929cf3df7 100644 --- a/pkg/domain/entities/types/images.go +++ b/pkg/domain/entities/types/images.go @@ -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 ( diff --git a/pkg/inspect/inspect.go b/pkg/inspect/inspect.go index 4142325c71..07cd6f98ec 100644 --- a/pkg/inspect/inspect.go +++ b/pkg/inspect/inspect.go @@ -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"` diff --git a/pkg/specgen/specgen.go b/pkg/specgen/specgen.go index 6082f1b5a9..71427c1931 100644 --- a/pkg/specgen/specgen.go +++ b/pkg/specgen/specgen.go @@ -649,6 +649,7 @@ func (s *SpecGenerator) IsInitContainer() bool { return len(s.InitContainerType) != 0 } +// swagger:model SpecgenSecret type Secret struct { Source string Target string