diff --git a/common/libimage/image.go b/common/libimage/image.go index 9090f035a2..9fdf0df2a3 100644 --- a/common/libimage/image.go +++ b/common/libimage/image.go @@ -737,7 +737,7 @@ func (i *Image) RepoDigests() ([]string, error) { // Mount the image with the specified mount options and label, both of which // are directly passed down to the containers storage. Returns the fully // evaluated path to the mount point. -func (i *Image) Mount(ctx context.Context, mountOptions []string, mountLabel string) (string, error) { +func (i *Image) Mount(_ context.Context, mountOptions []string, mountLabel string) (string, error) { if i.runtime.eventChannel != nil { defer i.runtime.writeEvent(&Event{ID: i.ID(), Name: "", Time: time.Now(), Type: EventTypeImageMount}) } diff --git a/common/libnetwork/cni/config.go b/common/libnetwork/cni/config.go index 5c4e4a7337..a1eeceb72b 100644 --- a/common/libnetwork/cni/config.go +++ b/common/libnetwork/cni/config.go @@ -15,7 +15,7 @@ import ( "github.com/sirupsen/logrus" ) -func (n *cniNetwork) NetworkUpdate(name string, options types.NetworkUpdateOptions) error { +func (n *cniNetwork) NetworkUpdate(_ string, _ types.NetworkUpdateOptions) error { return fmt.Errorf("NetworkUpdate is not supported for backend CNI: %w", types.ErrInvalidArg) } diff --git a/common/pkg/cgroups/cpuset_linux.go b/common/pkg/cgroups/cpuset_linux.go index a4cc2acaf6..c55c76864a 100644 --- a/common/pkg/cgroups/cpuset_linux.go +++ b/common/pkg/cgroups/cpuset_linux.go @@ -52,6 +52,6 @@ func (c *linuxCpusetHandler) Destroy(ctr *CgroupControl) error { } // Stat fills a metrics structure with usage stats for the controller -func (c *linuxCpusetHandler) Stat(ctr *CgroupControl, m *cgroups.Stats) error { +func (c *linuxCpusetHandler) Stat(_ *CgroupControl, _ *cgroups.Stats) error { return nil } diff --git a/common/pkg/completion/completion.go b/common/pkg/completion/completion.go index b5e6d6d306..908d568fff 100644 --- a/common/pkg/completion/completion.go +++ b/common/pkg/completion/completion.go @@ -23,19 +23,19 @@ func CompleteCommandFlags(cmd *cobra.Command, flags FlagCompletions) { /* Autocomplete Functions for cobra ValidArgsFunction */ // AutocompleteNone - Block the default shell completion (no paths) -func AutocompleteNone(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { +func AutocompleteNone(_ *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDirective) { return nil, cobra.ShellCompDirectiveNoFileComp } // AutocompleteDefault - Use the default shell completion, // allows path completion. -func AutocompleteDefault(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { +func AutocompleteDefault(_ *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDirective) { return nil, cobra.ShellCompDirectiveDefault } // AutocompleteCapabilities - Autocomplete linux capabilities options. // Used by --cap-add and --cap-drop. -func AutocompleteCapabilities(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { +func AutocompleteCapabilities(_ *cobra.Command, _ []string, toComplete string) ([]string, cobra.ShellCompDirective) { caps := capabilities.AllCapabilities() // convertCase will convert a string to lowercase only if the user input is lowercase @@ -83,17 +83,17 @@ func autocompleteSubIDName(filename string) ([]string, cobra.ShellCompDirective) } // AutocompleteSubgidName - Autocomplete subgidname based on the names in the /etc/subgid file. -func AutocompleteSubgidName(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { +func AutocompleteSubgidName(_ *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDirective) { return autocompleteSubIDName("/etc/subgid") } // AutocompleteSubuidName - Autocomplete subuidname based on the names in the /etc/subuid file. -func AutocompleteSubuidName(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { +func AutocompleteSubuidName(_ *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDirective) { return autocompleteSubIDName("/etc/subuid") } // AutocompleteArch - Autocomplete platform supported by container engines -func AutocompletePlatform(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { +func AutocompletePlatform(_ *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDirective) { completions := []string{ "linux/386", "linux/amd64", @@ -115,7 +115,7 @@ func AutocompletePlatform(cmd *cobra.Command, args []string, toComplete string) } // AutocompleteArch - Autocomplete architectures supported by container engines -func AutocompleteArch(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { +func AutocompleteArch(_ *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDirective) { completions := []string{ "386", "amd64", @@ -135,19 +135,19 @@ func AutocompleteArch(cmd *cobra.Command, args []string, toComplete string) ([]s } // AutocompleteOS - Autocomplete OS supported by container engines -func AutocompleteOS(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { +func AutocompleteOS(_ *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDirective) { completions := []string{"linux", "windows"} return completions, cobra.ShellCompDirectiveNoFileComp } // AutocompleteJSONFormat - Autocomplete format flag option. // -> "json" -func AutocompleteJSONFormat(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { +func AutocompleteJSONFormat(_ *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDirective) { return []string{"json"}, cobra.ShellCompDirectiveNoFileComp } // AutocompleteOneArg - Autocomplete one random arg -func AutocompleteOneArg(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { +func AutocompleteOneArg(_ *cobra.Command, args []string, _ string) ([]string, cobra.ShellCompDirective) { if len(args) == 1 { return nil, cobra.ShellCompDirectiveDefault } diff --git a/common/pkg/hooks/hooks.go b/common/pkg/hooks/hooks.go index 2c47f440bc..2758d122d1 100644 --- a/common/pkg/hooks/hooks.go +++ b/common/pkg/hooks/hooks.go @@ -48,7 +48,7 @@ type namedHook struct { // those specified in the OCI Runtime Specification and to control // OCI-defined stages instead of delegating to the OCI runtime. See // Hooks() for more information. -func New(ctx context.Context, directories []string, extensionStages []string) (manager *Manager, err error) { +func New(_ context.Context, directories []string, extensionStages []string) (manager *Manager, err error) { manager = &Manager{ hooks: map[string]*current.Hook{}, directories: directories, diff --git a/common/pkg/manifests/manifests.go b/common/pkg/manifests/manifests.go index d351bdf17f..8296faa820 100644 --- a/common/pkg/manifests/manifests.go +++ b/common/pkg/manifests/manifests.go @@ -73,7 +73,8 @@ func Create() List { // AddInstance adds an entry for the specified manifest digest, with assorted // additional information specified in parameters, to the list or index. -func (l *list) AddInstance(manifestDigest digest.Digest, manifestSize int64, manifestType, osName, architecture, osVersion string, osFeatures []string, variant string, features, annotations []string) error { +func (l *list) AddInstance(manifestDigest digest.Digest, manifestSize int64, manifestType, osName, architecture, osVersion string, osFeatures []string, variant string, features, annotations []string) error { // nolint:revive + // FIXME: the annotations argument is currently ignored if err := l.Remove(manifestDigest); err != nil && !errors.Is(err, os.ErrNotExist) { return err } diff --git a/common/pkg/supplemented/supplemented.go b/common/pkg/supplemented/supplemented.go index 58c9af6541..6ae9a41604 100644 --- a/common/pkg/supplemented/supplemented.go +++ b/common/pkg/supplemented/supplemented.go @@ -280,7 +280,7 @@ func (s *supplementedImageReference) NewImageSource(ctx context.Context, sys *ty return iss, nil } -func (s *supplementedImageReference) DeleteImage(ctx context.Context, sys *types.SystemContext) error { +func (s *supplementedImageReference) DeleteImage(_ context.Context, _ *types.SystemContext) error { return fmt.Errorf("deletion of images not implemented") }