mirror of
https://github.com/containers/podman.git
synced 2025-10-16 10:43:52 +08:00
lint: reenable revive unused-parameter check
Signed-off-by: Matt Souza <medsouz99@gmail.com>
This commit is contained in:
@ -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)))
|
||||
|
@ -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)))
|
||||
|
@ -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
|
||||
|
@ -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,
|
||||
|
@ -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 {
|
||||
|
@ -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()
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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")
|
||||
|
@ -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 {
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -4,5 +4,5 @@ import (
|
||||
"go.podman.io/common/pkg/config"
|
||||
)
|
||||
|
||||
func (s *SpecGenerator) InitResourceLimits(rtc *config.Config) {
|
||||
func (s *SpecGenerator) InitResourceLimits(_ *config.Config) {
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -17,6 +17,6 @@ func resolveRelativeOnWindows(path string) string {
|
||||
return path
|
||||
}
|
||||
|
||||
func winPathExists(path string) bool {
|
||||
func winPathExists(_ string) bool {
|
||||
return false
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ import (
|
||||
"go.podman.io/storage/pkg/fileutils"
|
||||
)
|
||||
|
||||
func shouldResolveUnixWinVariant(path string) bool {
|
||||
func shouldResolveUnixWinVariant(_ string) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user