lint: reenable revive unused-parameter check

Signed-off-by: Matt Souza <medsouz99@gmail.com>
This commit is contained in:
Matt Souza
2025-09-28 19:29:42 -04:00
parent 3747e3db3f
commit 090304a054
263 changed files with 723 additions and 724 deletions

View File

@ -71,7 +71,7 @@ func DevicesFromPath(g *generate.Generator, devicePath string, config *config.Co
}
// mount the internal devices recursively
if err := filepath.WalkDir(resolvedDevicePath, func(dpath string, d fs.DirEntry, e error) error {
if err := filepath.WalkDir(resolvedDevicePath, func(dpath string, d fs.DirEntry, _ error) error {
if d.Type()&os.ModeDevice == os.ModeDevice {
found = true
device := fmt.Sprintf("%s:%s", dpath, filepath.Join(dest, strings.TrimPrefix(dpath, src)))

View File

@ -73,7 +73,7 @@ func DevicesFromPath(g *generate.Generator, devicePath string, config *config.Co
}
// mount the internal devices recursively
if err := filepath.WalkDir(resolvedDevicePath, func(dpath string, d fs.DirEntry, e error) error {
if err := filepath.WalkDir(resolvedDevicePath, func(dpath string, d fs.DirEntry, _ error) error {
if d.Type()&os.ModeDevice == os.ModeDevice {
found = true
device := fmt.Sprintf("%s:%s", dpath, filepath.Join(dest, strings.TrimPrefix(dpath, src)))

View File

@ -43,7 +43,7 @@ import (
cdiparser "tags.cncf.io/container-device-interface/pkg/parser"
)
func ToPodOpt(ctx context.Context, podName string, p entities.PodCreateOptions, publishAllPorts bool, podYAML *v1.PodTemplateSpec) (entities.PodCreateOptions, error) {
func ToPodOpt(_ context.Context, podName string, p entities.PodCreateOptions, publishAllPorts bool, podYAML *v1.PodTemplateSpec) (entities.PodCreateOptions, error) {
p.Net = &entities.NetOptions{NoHosts: p.Net.NoHosts, NoHostname: p.Net.NoHostname}
p.Name = podName

View File

@ -276,7 +276,7 @@ func VolumeFromEmptyDir(emptyDirVolumeSource *v1.EmptyDirVolumeSource, name stri
}
}
func VolumeFromImage(imageVolumeSource *v1.ImageVolumeSource, name string) (*KubeVolume, error) {
func VolumeFromImage(imageVolumeSource *v1.ImageVolumeSource, _ string) (*KubeVolume, error) {
return &KubeVolume{
Type: KubeVolumeTypeImage,
Source: imageVolumeSource.Reference,

View File

@ -394,7 +394,7 @@ func namespaceOptions(s *specgen.SpecGenerator, rt *libpod.Runtime, pod *libpod.
// GetNamespaceOptions transforms a slice of kernel namespaces
// into a slice of pod create options. Currently, not all
// kernel namespaces are supported, and they will be returned in an error
func GetNamespaceOptions(ns []string, netnsIsHost bool) ([]libpod.PodCreateOption, error) {
func GetNamespaceOptions(ns []string, _ bool) ([]libpod.PodCreateOption, error) {
var options []libpod.PodCreateOption
var erroredOptions []libpod.PodCreateOption
if ns == nil {

View File

@ -56,6 +56,6 @@ func specConfigureNamespaces(s *specgen.SpecGenerator, g *generate.Generator, rt
// On FreeBSD 13.3 and later, we can avoid creating a separate vnet jail but
// only if we can initialise the network after the OCI container is created -
// the OCI container will own the vnet in this case.
func needPostConfigureNetNS(s *specgen.SpecGenerator) bool {
func needPostConfigureNetNS(_ *specgen.SpecGenerator) bool {
return !jail.NeedVnetJail()
}

View File

@ -169,7 +169,7 @@ func SpecGenToOCI(ctx context.Context, s *specgen.SpecGenerator, rt *libpod.Runt
return configSpec, nil
}
func WeightDevices(wtDevices map[string]spec.LinuxWeightDevice) ([]spec.LinuxWeightDevice, error) {
func WeightDevices(_ map[string]spec.LinuxWeightDevice) ([]spec.LinuxWeightDevice, error) {
devs := []spec.LinuxWeightDevice{}
return devs, nil
}

View File

@ -83,7 +83,7 @@ func getCgroupPermissions(unmask []string) string {
}
// SpecGenToOCI returns the base configuration for the container.
func SpecGenToOCI(ctx context.Context, s *specgen.SpecGenerator, rt *libpod.Runtime, rtc *config.Config, newImage *libimage.Image, mounts []spec.Mount, pod *libpod.Pod, finalCmd []string, compatibleOptions *libpod.InfraInherit) (*spec.Spec, error) {
func SpecGenToOCI(_ context.Context, s *specgen.SpecGenerator, rt *libpod.Runtime, rtc *config.Config, newImage *libimage.Image, mounts []spec.Mount, pod *libpod.Pod, finalCmd []string, compatibleOptions *libpod.InfraInherit) (*spec.Spec, error) {
cgroupPerm := getCgroupPermissions(s.Unmask)
g, err := generate.New("linux")

View File

@ -12,11 +12,11 @@ import (
// setLabelOpts sets the label options of the SecurityConfig according to the
// input.
func setLabelOpts(s *specgen.SpecGenerator, runtime *libpod.Runtime, pidConfig specgen.Namespace, ipcConfig specgen.Namespace) error {
func setLabelOpts(_ *specgen.SpecGenerator, _ *libpod.Runtime, _ specgen.Namespace, _ specgen.Namespace) error {
return nil
}
func securityConfigureGenerator(s *specgen.SpecGenerator, g *generate.Generator, newImage *libimage.Image, rtc *config.Config) error {
func securityConfigureGenerator(s *specgen.SpecGenerator, g *generate.Generator, _ *libimage.Image, _ *config.Config) error {
// If this is a privileged container, change the devfs ruleset to expose all devices.
if s.IsPrivileged() {
for k, m := range g.Config.Mounts {

View File

@ -8,6 +8,6 @@ import (
"go.podman.io/common/libimage"
)
func imageRunPath(ctx context.Context, img *libimage.Image) (string, error) {
func imageRunPath(_ context.Context, _ *libimage.Image) (string, error) {
return "/run", nil
}

View File

@ -5,6 +5,6 @@ package generate
import "github.com/containers/podman/v5/pkg/specgen"
// verifyContainerResources does nothing on freebsd as it has no cgroups
func verifyContainerResources(s *specgen.SpecGenerator) ([]string, error) {
func verifyContainerResources(_ *specgen.SpecGenerator) ([]string, error) {
return nil, nil
}

View File

@ -4,5 +4,5 @@ import (
"go.podman.io/common/pkg/config"
)
func (s *SpecGenerator) InitResourceLimits(rtc *config.Config) {
func (s *SpecGenerator) InitResourceLimits(_ *config.Config) {
}

View File

@ -3,11 +3,11 @@
package specgen
// FinishThrottleDevices cannot be called on non-linux OS' due to importing unix functions
func FinishThrottleDevices(s *SpecGenerator) error {
func FinishThrottleDevices(_ *SpecGenerator) error {
return nil
}
// WeightDevices cannot be called on non-linux OS' due to importing unix functions
func WeightDevices(s *SpecGenerator) error {
func WeightDevices(_ *SpecGenerator) error {
return nil
}

View File

@ -17,6 +17,6 @@ func resolveRelativeOnWindows(path string) string {
return path
}
func winPathExists(path string) bool {
func winPathExists(_ string) bool {
return false
}

View File

@ -6,7 +6,7 @@ func shouldResolveWinPaths() bool {
return false
}
func shouldResolveUnixWinVariant(path string) bool {
func shouldResolveUnixWinVariant(_ string) bool {
return false
}
@ -14,6 +14,6 @@ func resolveRelativeOnWindows(path string) string {
return path
}
func winPathExists(path string) bool {
func winPathExists(_ string) bool {
return false
}

View File

@ -7,7 +7,7 @@ import (
"go.podman.io/storage/pkg/fileutils"
)
func shouldResolveUnixWinVariant(path string) bool {
func shouldResolveUnixWinVariant(_ string) bool {
return true
}