From 3222b4bc25f8235d9f8dd4ea53a5684b4dcf547f Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Fri, 4 Sep 2026 16:40:03 +0200 Subject: [PATCH] fix new golangci-lint staticcheck warnings Looks like it picked up new deprecated matches so we need some more nolint to silence them where we still need them for backwards compat in the API. Signed-off-by: Paul Holzinger --- libpod/container_internal_common.go | 6 ------ pkg/api/handlers/compat/images_search.go | 2 +- pkg/api/handlers/compat/system.go | 10 +++++----- pkg/domain/entities/events.go | 6 +++--- 4 files changed, 9 insertions(+), 15 deletions(-) diff --git a/libpod/container_internal_common.go b/libpod/container_internal_common.go index f3747b5c44..ed5d4dd240 100644 --- a/libpod/container_internal_common.go +++ b/libpod/container_internal_common.go @@ -361,8 +361,6 @@ func (c *Container) generateSpec(ctx context.Context) (s *spec.Spec, cleanupFunc } overlayOpts = &overlay.Options{ - RootUID: backingUID, - RootGID: backingGID, UpperDirOptionFragment: upperDir, WorkDirOptionFragment: workDir, GraphOpts: c.runtime.store.GraphOptions(), @@ -517,8 +515,6 @@ func (c *Container) generateSpec(ctx context.Context) (s *spec.Spec, cleanupFunc workDir = filepath.Join(contentDir, "work") } overlayOpts := &overlay.Options{ - RootUID: backingUID, - RootGID: backingGID, UpperDirOptionFragment: upperDir, WorkDirOptionFragment: workDir, GraphOpts: c.runtime.store.GraphOptions(), @@ -588,8 +584,6 @@ func (c *Container) generateSpec(ctx context.Context) (s *spec.Spec, cleanupFunc var overlayMount spec.Mount overlayOpts := &overlay.Options{ - RootUID: c.RootUID(), - RootGID: c.RootGID(), GraphOpts: c.runtime.store.GraphOptions(), ReadOnly: !volume.ReadWrite, ForceMount: forceOverlayMount, diff --git a/pkg/api/handlers/compat/images_search.go b/pkg/api/handlers/compat/images_search.go index 55570cd68e..d0891ef2ab 100644 --- a/pkg/api/handlers/compat/images_search.go +++ b/pkg/api/handlers/compat/images_search.go @@ -102,7 +102,7 @@ func SearchImages(w http.ResponseWriter, r *http.Request) { Description: report.Description, StarCount: report.Stars, IsOfficial: toBool(report.Official), - IsAutomated: toBool(report.Automated), + IsAutomated: toBool(report.Automated), //nolint:staticcheck // we still have to support older API versions which set this } if isAutomatedDeprecated { //nolint:staticcheck diff --git a/pkg/api/handlers/compat/system.go b/pkg/api/handlers/compat/system.go index 27fd9fd2ab..93d021d482 100644 --- a/pkg/api/handlers/compat/system.go +++ b/pkg/api/handlers/compat/system.go @@ -106,11 +106,11 @@ func GetDiskUsage(w http.ResponseWriter, r *http.Request) { } utils.WriteResponse(w, http.StatusOK, handlers.LegacyDiskUsage{ //nolint:staticcheck // LegacyDiskUsage is deprecated but kept for Docker API compat < v1.52 - LayersSize: df.ImagesSize, - Images: legacy, - Containers: ctnrs, - Volumes: vols, - BuildCache: []build.CacheRecord{}, + LayersSize: df.ImagesSize, //nolint:staticcheck // we still have to support older API versions which set this + Images: legacy, //nolint:staticcheck // we still have to support older API versions which set this + Containers: ctnrs, //nolint:staticcheck // we still have to support older API versions which set this + Volumes: vols, //nolint:staticcheck // we still have to support older API versions which set this + BuildCache: []build.CacheRecord{}, //nolint:staticcheck // we still have to support older API versions which set this }) return } diff --git a/pkg/domain/entities/events.go b/pkg/domain/entities/events.go index 1541e3189e..e2f6da8543 100644 --- a/pkg/domain/entities/events.go +++ b/pkg/domain/entities/events.go @@ -111,8 +111,8 @@ func ConvertToEntitiesEvent(e libpodEvents.Event) *types.Event { return &types.Event{ Message: message, HealthStatus: e.HealthStatus, - Status: e.Status.String(), - ID: e.ID, - From: e.Image, + Status: e.Status.String(), //nolint:staticcheck // we still have to support older API versions which set this + ID: e.ID, //nolint:staticcheck // we still have to support older API versions which set this + From: e.Image, //nolint:staticcheck // we still have to support older API versions which set this } }