linters: enable dupword

Mostly monkey work to fix comments but there was also an error message.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
This commit is contained in:
Valentin Rothberg 2023-09-01 11:51:25 +02:00
parent 56a700b5d4
commit de32d5a9f7
13 changed files with 14 additions and 15 deletions

View File

@ -36,7 +36,6 @@ linters:
- contextcheck
- cyclop
- depguard
- dupword
- errchkjson
- errname
- errorlint

View File

@ -243,7 +243,7 @@ func (r *Runtime) until(value string) (time.Time, error) {
func (r *Runtime) time(key, value string) (*Image, error) {
img, _, err := r.LookupImage(value, nil)
if err != nil {
return nil, fmt.Errorf("could not find local image for filter filter %q=%q: %w", key, value, err)
return nil, fmt.Errorf("could not find local image for filter %q=%q: %w", key, value, err)
}
return img, nil
}

View File

@ -88,7 +88,7 @@ func ImageConfigFromChanges(changes []string) (*ImageConfig, error) { // nolint:
case "ENV":
// Format is either:
// ENV key=value
// ENV key=value key=value ...
// ENV key-1=value key-2=value ...
// ENV key value
// Both keys and values can be surrounded by quotes to group them.
// For now: we only support key=value

View File

@ -633,7 +633,7 @@ var _ = Describe("Config", func() {
// reload configs from disk
libpodNet, err = getNetworkInterface(cniConfDir)
Expect(err).To(BeNil())
// check the the networks are identical
// check the etworks are identical
network2, err := libpodNet.NetworkInspect(network1.Name)
Expect(err).To(BeNil())
Expect(network1).To(Equal(network2))

View File

@ -279,7 +279,7 @@ var _ = Describe("Config", func() {
// reload configs from disk
libpodNet, err = getNetworkInterface(networkConfDir)
Expect(err).To(BeNil())
// check the the networks are identical
// check the networks are identical
network2, err := libpodNet.NetworkInspect(network1.Name)
Expect(err).To(BeNil())
EqualNetwork(network2, network1)

View File

@ -23,7 +23,7 @@ type netavarkError struct {
func (e *netavarkError) Error() string {
ec := ""
// only add the exit code the the error message if we have at least info log level
// only add the exit code the error message if we have at least info log level
// the normal user does not need to care about the number
if e.exitCode > 0 && logrus.IsLevelEnabled(logrus.InfoLevel) {
ec = " (exit code " + strconv.Itoa(e.exitCode) + ")"

View File

@ -65,7 +65,7 @@ func (n *netavarkNetwork) openDB() (*bbolt.DB, error) {
return db, nil
}
// allocIPs will allocate ips for the the container. It will change the
// allocIPs will allocate ips for the container. It will change the
// NetworkOptions in place. When static ips are given it will validate
// that these are free to use and will allocate them to the container.
func (n *netavarkNetwork) allocIPs(opts *types.NetworkOptions) error {

View File

@ -44,7 +44,7 @@ type netavarkNetwork struct {
// defaultsubnetPools contains the subnets which must be used to allocate a free subnet by network create
defaultsubnetPools []config.SubnetPool
// dnsBindPort is set the the port to pass to netavark for aardvark
// dnsBindPort is set the port to pass to netavark for aardvark
dnsBindPort uint16
// pluginDirs list of directories were netavark plugins are located
@ -87,7 +87,7 @@ type InitConfig struct {
// DefaultsubnetPools contains the subnets which must be used to allocate a free subnet by network create
DefaultsubnetPools []config.SubnetPool
// DNSBindPort is set the the port to pass to netavark for aardvark
// DNSBindPort is set the port to pass to netavark for aardvark
DNSBindPort uint16
// PluginDirs list of directories were netavark plugins are located

View File

@ -35,7 +35,7 @@ const (
// NetworkBackend returns the network backend name and interface
// It returns either the CNI or netavark backend depending on what is set in the config.
// If the the backend is set to "" we will automatically assign the backend on the following conditions:
// If the backend is set to "" we will automatically assign the backend on the following conditions:
// 1. read ${graphroot}/defaultNetworkBackend
// 2. find netavark binary (if not installed use CNI)
// 3. check containers, images and CNI networks and if there are some we have an existing install and should continue to use CNI

View File

@ -43,7 +43,7 @@ profile {{.Name}} flags=(attach_disconnected,mediate_deleted) {
deny /sys/kernel/security/** rwklx,
{{if ge .Version 208095}}
# suppress ptrace denials when using using 'ps' inside a container
# suppress ptrace denials when using 'ps' inside a container
ptrace (trace,read) peer={{.Name}},
{{end}}
}

View File

@ -259,7 +259,7 @@ func getUserAndPass(opts *LoginOptions, password, userFromAuthFile string) (user
if err != nil {
return "", "", fmt.Errorf("reading username: %w", err)
}
// If the user just hit enter, use the displayed user from the
// If the user just hit enter, use the displayed user from
// the authentication file. This allows to do a lazy
// `$ buildah login -p $NEW_PASSWORD` without specifying the
// user.

View File

@ -169,7 +169,7 @@ type ContainersConfig struct {
// InitPath is the path for init to run if the Init bool is enabled
InitPath string `toml:"init_path,omitempty"`
// IPCNS way to to create a ipc namespace for the container
// IPCNS way to create a ipc namespace for the container
IPCNS string `toml:"ipcns,omitempty"`
// LogDriver for the container. For example: k8s-file and journald
@ -321,7 +321,7 @@ type EngineConfig struct {
// helper binaries.
HelperBinariesDir []string `toml:"helper_binaries_dir"`
// configuration files. When the same filename is present in in
// configuration files. When the same filename is present in
// multiple directories, the file in the directory listed last in
// this slice takes precedence.
HooksDir []string `toml:"hooks_dir,omitempty"`

View File

@ -229,7 +229,7 @@ func GetUserInfo(uri *url.URL) (*url.Userinfo, error) {
}
// ValidateAndConfigure will take a ssh url and an identity key (rsa and the like) and ensure the information given is valid
// iden iden can be blank to mean no identity key
// iden can be blank to mean no identity key
// once the function validates the information it creates and returns an ssh.ClientConfig.
func ValidateAndConfigure(uri *url.URL, iden string, insecureIsMachineConnection bool) (*ssh.ClientConfig, error) {
var signers []ssh.Signer