Address new linter complaints

This commit is contained in:
Katrina Verey
2022-03-29 18:18:23 -04:00
parent b368b347d1
commit 14947e449b
77 changed files with 220 additions and 210 deletions

View File

@@ -273,9 +273,9 @@ type resultsChecker interface {
shouldUpdateFixtures() bool
// updateFixtures modifies the test fixture files to match the given content
updateFixtures(t *testing.T, actualOutput string, actualError string)
// assertOutputMatches compares the expected output to the output recieved.
// assertOutputMatches compares the expected output to the output received.
assertOutputMatches(t *testing.T, expected string, actual string)
// assertErrorMatches compares teh expected error to the error received.
// assertErrorMatches compares the expected error to the error received.
assertErrorMatches(t *testing.T, expected string, actual string)
}

View File

@@ -75,14 +75,16 @@ spec:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
internal value, and may reject unrecognized values. More info:
https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
color:
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
submits requests to. Cannot be updated. In CamelCase. More info:
https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
@@ -141,7 +143,7 @@ func TestSchemaFromFunctionDefinition(t *testing.T) {
} else {
require.NoError(t, err)
var gotProps []string
for prop, _ := range got.Properties {
for prop := range got.Properties {
gotProps = append(gotProps, prop)
}
sort.Strings(tt.wantProps)

View File

@@ -189,7 +189,7 @@ func (c *Filter) getCommand() (string, []string) {
}
args = append(args, runtimeutil.NewContainerEnvFromStringSlice(c.Env).GetDockerFlags()...)
a := append(args, c.Image)
a := append(args, c.Image) //nolint:gocritic
return "docker", a
}

View File

@@ -6,11 +6,11 @@ package container
import (
"bytes"
"fmt"
"github.com/stretchr/testify/require"
"os"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"sigs.k8s.io/kustomize/kyaml/fn/runtime/runtimeutil"
"sigs.k8s.io/kustomize/kyaml/kio"
"sigs.k8s.io/kustomize/kyaml/yaml"

View File

@@ -34,7 +34,7 @@ func (c *Filter) Filter(nodes []*yaml.RNode) ([]*yaml.RNode, error) {
}
func (c *Filter) Run(reader io.Reader, writer io.Writer) error {
cmd := exec.Command(c.Path, c.Args...)
cmd := exec.Command(c.Path, c.Args...) // nolint:gosec
cmd.Stdin = reader
cmd.Stdout = writer
cmd.Stderr = os.Stderr