Skip to content

Instantly share code, notes, and snippets.

@pohly
Created April 13, 2023 14:09
Show Gist options
  • Save pohly/8a6e8b30865ddb13e0b81d7e6f4925e5 to your computer and use it in GitHub Desktop.
Save pohly/8a6e8b30865ddb13e0b81d7e6f4925e5 to your computer and use it in GitHub Desktop.
go version go1.20.3 linux/amd64
installing golangci-lint and logcheck plugin from hack/tools into /nvme/gopath/src/k8s.io/kubernetes/_output/local/bin
running env LOGCHECK_CONFIG=/nvme/gopath/src/k8s.io/kubernetes/hack/logcheck.conf /nvme/gopath/src/k8s.io/kubernetes/_output/local/bin/golangci-lint run --config=/nvme/gopath/src/k8s.io/kubernetes/hack/golangci-strict.yaml ./...
build/pause/windows/wincat/wincat.go:55:18: Error return value of `conn.CloseRead` is not checked (errcheck)
conn.CloseRead()
^
build/pause/windows/wincat/wincat.go:67:19: Error return value of `conn.CloseWrite` is not checked (errcheck)
conn.CloseWrite()
^
test/e2e_node/environment/conformance.go:44:10: Error return value of `flag.Set` is not checked (errcheck)
flag.Set("logtostderr", "false")
^
test/images/pets/peer-finder/peer-finder.go:75:11: Error return value of `cmd.Start` is not checked (errcheck)
cmd.Start()
^
test/images/pets/peer-finder/peer-finder.go:77:13: Error return value of `stdin.Write` is not checked (errcheck)
stdin.Write([]byte(sendStdin))
^
test/images/agnhost/net/nat/closewait.go:170:23: Error return value of `conn.SetReadDeadline` is not checked (errcheck)
conn.SetReadDeadline(time.Now().Add(delay))
^
pkg/util/tail/tail_test.go:40:12: Error return value of `file.Write` is not checked (errcheck)
file.Write(testBytes)
^
pkg/kubelet/cm/topologymanager/bitmask/bitmask_test.go:101:11: Error return value of `mask.Add` is not checked (errcheck)
mask.Add(tc.bits...)
^
pkg/kubelet/cm/topologymanager/bitmask/bitmask_test.go:142:14: Error return value of `mask.Remove` is not checked (errcheck)
mask.Remove(tc.bitsRemove...)
^
test/conformance/image/go-runner/main.go:56:19: Error return value is not checked (errcheck)
defer saveResults(resultsDir)
^
pkg/volume/util/subpath/subpath_linux.go:578:15: Error return value of `unix.Fstatat` is not checked (errcheck)
unix.Fstatat(parentFD, seg+"/", &deviceStat, unix.AT_SYMLINK_NOFOLLOW)
^
pkg/volume/util/subpath/subpath_linux_test.go:265:16: Error return value is not checked (errcheck)
test.prepare(base)
^
pkg/volume/util/subpath/subpath_linux_test.go:1226:15: Error return value is not checked (errcheck)
test.prepare(base)
^
pkg/volume/util/subpath/subpath_linux_test.go:1257:11: Error return value of `os.Chdir` is not checked (errcheck)
os.Chdir(oldDir)
^
pkg/volume/util/subpath/subpath_linux_test.go:1372:15: Error return value is not checked (errcheck)
test.prepare(base)
^
test/images/agnhost/port-forward-tester/portforwardtester.go:152:16: Error return value of `conn.SetLinger` is not checked (errcheck)
conn.SetLinger(-1)
^
test/images/agnhost/port-forward-tester/portforwardtester.go:158:17: Error return value of `conn.CloseWrite` is not checked (errcheck)
conn.CloseWrite()
^
hack/conformance/check_conformance_test_requirements.go:135:13: Error return value of `cmd.Help` is not checked (errcheck)
cmd.Help()
^
cmd/kubeadm/app/cmd/phases/workflow/doc_test.go:110:22: Error return value of `myWorkflowRunner.Run` is not checked (errcheck)
myWorkflowRunner.Run([]string{})
^
cmd/kubeadm/app/cmd/phases/workflow/runner.go:121:12: Error return value of `e.visitAll` is not checked (errcheck)
e.visitAll(func(p *phaseRunner) error {
^
cmd/kubeadm/app/cmd/phases/workflow/runner.go:276:12: Error return value of `e.visitAll` is not checked (errcheck)
e.visitAll(func(p *phaseRunner) error {
^
cmd/kubeadm/app/cmd/phases/workflow/runner.go:291:12: Error return value of `e.visitAll` is not checked (errcheck)
e.visitAll(func(p *phaseRunner) error {
^
cmd/kubeadm/app/cmd/phases/workflow/runner.go:342:12: Error return value of `e.visitAll` is not checked (errcheck)
e.visitAll(func(p *phaseRunner) error {
^
cmd/kubeadm/test/cmd/join_test.go:51:16: Error return value is not checked (errcheck)
kubeadmReset()
^
cmd/kubeadm/test/cmd/join_test.go:79:16: Error return value is not checked (errcheck)
kubeadmReset()
^
cmd/kubeadm/test/cmd/join_test.go:107:16: Error return value is not checked (errcheck)
kubeadmReset()
^
cmd/kubeadm/test/cmd/join_test.go:134:16: Error return value is not checked (errcheck)
kubeadmReset()
^
cmd/kubeadm/test/cmd/join_test.go:162:16: Error return value is not checked (errcheck)
kubeadmReset()
^
cmd/kubeadm/test/cmd/join_test.go:190:16: Error return value is not checked (errcheck)
kubeadmReset()
^
cmd/kubeadm/test/cmd/join_test.go:218:16: Error return value is not checked (errcheck)
kubeadmReset()
^
cmd/kubeadm/test/cmd/join_test.go:245:16: Error return value is not checked (errcheck)
kubeadmReset()
^
cmd/kubeadm/test/cmd/token_test.go:83:16: Error return value is not checked (errcheck)
kubeadmReset()
^
test/conformance/walk.go:162:16: Error return value of `templ.Execute` is not checked (errcheck)
templ.Execute(os.Stdout, data)
^
test/typecheck/main.go:183:17: Error return value is not checked (errcheck)
serialFprintf(os.Stdout, "pkg %q has %d GoFiles\n", pkg.PkgPath, len(pkg.GoFiles))
^
test/typecheck/main.go:189:19: Error return value is not checked (errcheck)
serialFprintf(os.Stdout, "pkg %q imports %q\n", pkg.PkgPath, imp.PkgPath)
^
test/typecheck/main.go:213:18: Error return value is not checked (errcheck)
serialFprintf(os.Stdout, "%s: %q defines %v\n",
^
test/typecheck/main.go:217:18: Error return value is not checked (errcheck)
serialFprintf(os.Stdout, "%s: %q uses %v\n",
^
test/typecheck/main.go:223:16: Error return value is not checked (errcheck)
serialFprintf(os.Stdout, "%s took %.1fs\n", plat, time.Since(start).Seconds())
^
test/typecheck/main.go:297:17: Error return value is not checked (errcheck)
serialFprintf(os.Stdout, "type-checking %s\n", plat)
^
test/typecheck/main.go:300:18: Error return value is not checked (errcheck)
serialFprintf(os.Stderr, "ERROR(%s): failed to verify: %v\n", plat, err)
^
test/typecheck/main.go:308:20: Error return value is not checked (errcheck)
serialFprintf(os.Stderr, "ERROR(%s): %s\n", plat, e)
^
test/images/agnhost/serve-hostname/serve_hostname.go:81:15: Error return value of `conn.Write` is not checked (errcheck)
conn.Write([]byte(hostname))
^
test/images/agnhost/serve-hostname/serve_hostname.go:103:17: Error return value of `sock.WriteTo` is not checked (errcheck)
sock.WriteTo([]byte(hostname), cliAddr)
^
test/images/agnhost/fakegitserver/gitserver.go:37:16: Error return value of `io.WriteString` is not checked (errcheck)
io.WriteString(w, "I am a fake git server")
^
test/images/agnhost/fakegitserver/gitserver.go:45:21: Error return value of `http.ListenAndServe` is not checked (errcheck)
http.ListenAndServe(":8000", nil)
^
test/images/agnhost/liveness/server.go:46:10: Error return value of `w.Write` is not checked (errcheck)
w.Write([]byte(data))
^
test/images/agnhost/liveness/server.go:52:11: Error return value of `w.Write` is not checked (errcheck)
w.Write([]byte(fmt.Sprintf("error: %v", duration.Seconds())))
^
test/images/agnhost/liveness/server.go:55:11: Error return value of `w.Write` is not checked (errcheck)
w.Write([]byte("ok"))
^
pkg/util/config/config.go:85:17: Error return value of `m.merger.Merge` is not checked (errcheck)
m.merger.Merge(source, update)
^
pkg/util/goroutinemap/goroutinemap.go:116:3: Error return value is not checked (errcheck)
}()
^
cmd/dependencyverifier/dependencyverifier.go:161:2: ifElseChain: rewrite if-else to switch statement (gocritic)
if len(os.Args) == 2 {
^
test/e2e_node/environment/conformance.go:181:23: regexpMust: for const patterns like iptablesForwardRegexStr, use regexp.MustCompile (gocritic)
forwardRegex, err := regexp.Compile(iptablesForwardRegexStr)
^
test/e2e_node/environment/conformance.go:167:21: regexpMust: for const patterns like iptablesInputRegexStr, use regexp.MustCompile (gocritic)
inputRegex, err := regexp.Compile(iptablesInputRegexStr)
^
test/e2e_node/environment/conformance.go:90:19: regexpMust: for const patterns like kubeletClusterDNSRegexStr, use regexp.MustCompile (gocritic)
dnsRegex, err := regexp.Compile(kubeletClusterDNSRegexStr)
^
test/e2e_node/environment/conformance.go:95:22: regexpMust: for const patterns like kubeletClusterDomainRegexStr, use regexp.MustCompile (gocritic)
domainRegex, err := regexp.Compile(kubeletClusterDomainRegexStr)
^
test/images/pets/peer-finder/peer-finder.go:116:14: regexpMust: for const patterns like `\A(.*\n)*search\s{1,}(.*\s{1,})*(?P<goal>[a-zA<...>}.svc.([a-zA-Z0-9-]{1,63}\.)*[a-zA-Z0-9]{2,63})`, use regexp.MustCompile (gocritic)
re, err = regexp.Compile(`\A(.*\n)*search\s{1,}(.*\s{1,})*(?P<goal>[a-zA-Z0-9-]{1,63}.svc.([a-zA-Z0-9-]{1,63}\.)*[a-zA-Z0-9]{2,63})`)
^
test/images/pets/peer-finder/peer-finder.go:119:14: regexpMust: for const patterns like `\A(.*\n)*search\s{1,}(.*\s{1,})*(?P<goal>svc.([a-zA-Z0-9-]{1,63}\.)*[a-zA-Z0-9]{2,63})`, use regexp.MustCompile (gocritic)
re, err = regexp.Compile(`\A(.*\n)*search\s{1,}(.*\s{1,})*(?P<goal>svc.([a-zA-Z0-9-]{1,63}\.)*[a-zA-Z0-9]{2,63})`)
^
cmd/genutils/genutils.go:41:2: assignOp: replace `outDir = outDir + "/"` with `outDir += "/"` (gocritic)
outDir = outDir + "/"
^
pkg/registry/core/service/allocator/bitmap.go:155:5: assignOp: replace `word = word &^ 1` with `word &^= 1` (gocritic)
word = word &^ 1
^
pkg/registry/core/service/allocator/bitmap.go:158:4: assignOp: replace `word = word >> 1` with `word >>= 1` (gocritic)
word = word >> 1
^
pkg/kubelet/cm/cpuset/cpuset.go:127:18: unlambda: replace `func(cpu int) bool { return s2.Contains(cpu) }` with `s2.Contains` (gocritic)
return s.filter(func(cpu int) bool { return s2.Contains(cpu) })
^
test/conformance/image/go-runner/tar.go:67:36: wrapperFunc: use strings.ReplaceAll method in `strings.Replace(file, dir, "", -1)` (gocritic)
header.Name = strings.TrimPrefix(strings.Replace(file, dir, "", -1), string(filepath.Separator))
^
test/images/regression-issue-74839/main.go:127:61: unslice: could simplify data[:] to data (gocritic)
_, err := conn.WriteTo(badPkt.encode(localIP, remoteIP, data[:]), addr)
^
pkg/volume/util/subpath/subpath_linux_test.go:925:2: commentFormatting: put a space between `//` and comment text (gocritic)
//complete code
^
pkg/kubelet/kubeletconfig/util/files/files_test.go:44:2: ifElseChain: rewrite if-else to switch statement (gocritic)
if f.mode.IsDir() {
^
pkg/kubelet/kubeletconfig/util/files/files_test.go:75:2: ifElseChain: rewrite if-else to switch statement (gocritic)
if f.mode.IsDir() {
^
hack/conformance/check_conformance_test_requirements.go:33:2: commentFormatting: put a space between `//` and comment text (gocritic)
//e.g. framework.ConformanceIt("should provide secure master service ", func(ctx context.Context) {
^
test/images/agnhost/connect/connect.go:177:2: ifElseChain: rewrite if-else to switch statement (gocritic)
if ok && neterr.Timeout() {
^
pkg/util/ipset/ipset.go:173:3: commentFormatting: put a space between `//` and comment text (gocritic)
//check if IP of Entry is valid.
^
pkg/util/ipset/ipset.go:178:3: commentFormatting: put a space between `//` and comment text (gocritic)
//check if IP and Protocol of Entry is valid.
^
pkg/util/ipset/ipset.go:183:3: commentFormatting: put a space between `//` and comment text (gocritic)
//check if IP and Protocol of Entry is valid.
^
pkg/util/ipset/ipset.go:194:3: commentFormatting: put a space between `//` and comment text (gocritic)
//check if IP and Protocol of Entry is valid.
^
pkg/util/ipset/ipset.go:343:3: ifElseChain: rewrite if-else to switch statement (gocritic)
if e == nil && reg.MatchString(string(out)) {
^
pkg/util/ipset/ipset.go:398:48: unslice: could simplify out[:] to out (gocritic)
list := memberMatcher.ReplaceAllString(string(out[:]), "")
^
cmd/kubeadm/app/cmd/phases/workflow/runner_test.go:459:29: commentFormatting: put a space between `//` and comment text (gocritic)
"phase foo": {"flag1"}, //not "flag2"
^
cmd/kubeadm/app/cmd/phases/workflow/runner_test.go:468:47: commentFormatting: put a space between `//` and comment text (gocritic)
phaseBuilder4("baz", []string{"flag1"}), //test if additional flags are filtered too
^
cmd/kubeadm/app/cmd/phases/workflow/runner_test.go:496:48: commentFormatting: put a space between `//` and comment text (gocritic)
phaseBuilder4("baz", []string{"flag1"}), //test if additional flags are filtered too
^
pkg/kubelet/cm/devicemanager/checkpoint/checkpointv1.go:60:11: wrapperFunc: use strings.ReplaceAll method in `strings.Replace(object, "PodDevicesEntryV1", "PodDevicesEntry", -1)` (gocritic)
object = strings.Replace(object, "PodDevicesEntryV1", "PodDevicesEntry", -1)
^
test/conformance/walk.go:101:4: exitAfterDefer: log.Fatal will exit, and `defer f.Close()` will not run (gocritic)
log.Fatal(err)
^
test/list/main.go:140:8: wrapperFunc: use strings.ReplaceAll method in `strings.Replace(v, "%d", "*", -1)` (gocritic)
v = strings.Replace(v, "%d", "*", -1)
^
test/list/main.go:142:8: wrapperFunc: use strings.ReplaceAll method in `strings.Replace(v, "%s", "*", -1)` (gocritic)
v = strings.Replace(v, "%s", "*", -1)
^
test/list/main.go:141:8: wrapperFunc: use strings.ReplaceAll method in `strings.Replace(v, "%v", "*", -1)` (gocritic)
v = strings.Replace(v, "%v", "*", -1)
^
cmd/preferredimports/preferredimports.go:92:19: wrapperFunc: use strings.ReplaceAll method in `strings.Replace(imp.Path.Value, "\"", "", -1)` (gocritic)
importPath := strings.Replace(imp.Path.Value, "\"", "", -1)
^
test/typecheck/main.go:85:3: assignOp: replace `mode = mode | packages.NeedTypesInfo` with `mode |= packages.NeedTypesInfo` (gocritic)
mode = mode | packages.NeedTypesInfo
^
test/typecheck/main.go:268:11: unslice: could simplify crossPlatforms[:] to crossPlatforms (gocritic)
plats := crossPlatforms[:]
^
test/images/agnhost/porter/porter.go:169:4: exitAfterDefer: log.Fatal will exit, and `defer func(){...}(...)` will not run (gocritic)
log.Fatal("Failed to accept SCTP. error:", err)
^
test/images/agnhost/resource-consumer-controller/controller.go:59:10: regexpMust: for const patterns like "^svc.", use regexp.MustCompile (gocritic)
r, _ := regexp.Compile("^svc.")
^
cmd/genswaggertypedocs/swagger_type_docs.go:62:3: exitAfterDefer: os.Exit will exit, and `defer file.Close()` will not run (gocritic)
os.Exit(rc)
^
pkg/util/procfs/procfs_linux_test.go:37:2: ifElseChain: rewrite if-else to switch statement (gocritic)
if expectedErr && err == nil {
^
pkg/util/oom/oom_linux.go:94:3: ifElseChain: rewrite if-else to switch statement (gocritic)
if err != nil {
^
pkg/util/oom/oom_linux_test.go:62:2: ifElseChain: rewrite if-else to switch statement (gocritic)
if expectedError && err == nil {
^
pkg/util/iptables/iptables.go:421:14: appendAssign: append result not assigned to the same slice (gocritic)
fullArgs := append(runner.restoreWaitFlag, args...)
^
pkg/util/iptables/iptables.go:465:14: appendAssign: append result not assigned to the same slice (gocritic)
fullArgs := append(runner.waitFlag, string(op))
^
pkg/volume/util/hostutil/hostutil.go:98:2: ifElseChain: rewrite if-else to switch statement (gocritic)
if mode.IsDir() {
^
test/images/agnhost/netexec/netexec.go:654:3: ifElseChain: rewrite if-else to switch statement (gocritic)
if receivedText == "hostname" {
^
test/images/agnhost/netexec/netexec.go:700:3: ifElseChain: rewrite if-else to switch statement (gocritic)
if receivedText == "hostname" {
^
test/instrumentation/decode_metric.go:62:3: singleCaseSwitch: should rewrite switch statement to if statement (gocritic)
switch v := fc.Fun.(type) {
^
test/instrumentation/decode_metric.go:180:4: singleCaseSwitch: should rewrite switch statement to if statement (gocritic)
switch functionName {
^
test/instrumentation/decode_metric.go:303:3: singleCaseSwitch: should rewrite switch statement to if statement (gocritic)
switch e := expr.(type) {
^
test/instrumentation/decode_metric.go:662:2: singleCaseSwitch: should rewrite switch statement to if statement (gocritic)
switch y := v.Y.(type) {
^
test/e2e/framework/metrics/e2e_metrics.go:105:9: S1030: should use formatted.String() instead of string(formatted.Bytes()) (gosimple)
return string(formatted.Bytes())
^
cmd/prune-junit-xml/prunexml_test.go:66:29: S1030: should use output.String() instead of string(output.Bytes()) (gosimple)
assert.Equal(t, outputXML, string(output.Bytes()), "xml was not pruned correctly")
^
cmd/yamlfmt/yamlfmt_test.go:51:30: S1030: should use output.String() instead of string(output.Bytes()) (gosimple)
assert.Equal(t, outputYaml, string(output.Bytes()), "yaml was not formatted correctly")
^
pkg/controller/garbagecollector/dump_test.go:429:35: S1030: should use b.String() instead of string(b.Bytes()) (gosimple)
if e, a := string(goldenData), string(b.Bytes()); cmp.Diff(e, a) != "" {
^
pkg/proxy/ipvs/proxier_test.go:1704:29: S1030: should use buf.String() instead of string(buf.Bytes()) (gosimple)
natRules := strings.Split(string(buf.Bytes()), "\n")
^
pkg/proxy/ipvs/proxier_test.go:3896:25: S1030: should use buf.String() instead of string(buf.Bytes()) (gosimple)
lines := strings.Split(string(buf.Bytes()), "\n")
^
pkg/util/iptables/testing/fake_test.go:52:5: S1030: should use buf.String() instead of string(buf.Bytes()) (gosimple)
if string(buf.Bytes()) != expected {
^
pkg/util/iptables/testing/fake_test.go:146:5: S1030: should use buf.String() instead of string(buf.Bytes()) (gosimple)
if string(buf.Bytes()) != expected {
^
pkg/util/iptables/testing/fake_test.go:217:5: S1030: should use buf.String() instead of string(buf.Bytes()) (gosimple)
if string(buf.Bytes()) != expected {
^
pkg/util/iptables/testing/fake_test.go:285:5: S1030: should use buf.String() instead of string(buf.Bytes()) (gosimple)
if string(buf.Bytes()) != expected {
^
pkg/util/iptables/testing/fake_test.go:342:5: S1030: should use buf.String() instead of string(buf.Bytes()) (gosimple)
if string(buf.Bytes()) != expected {
^
pkg/controller/testutil/test_utils.go:94:2: S1001: should use copy(to, from) instead of a loop (gosimple)
for i, ptr := range m.UpdatedNodes {
^
test/e2e/kubectl/portforward.go:62:22: S1007: should use raw string (`...`) with regexp.MustCompile to avoid having to escape twice (gosimple)
portForwardRegexp = regexp.MustCompile("Forwarding from (127.0.0.1|\\[::1\\]):([0-9]+) -> 80")
^
test/e2e/storage/vsphere/vsphere_utils.go:530:15: S1007: should use raw string (`...`) with regexp.MustCompile to avoid having to escape twice (gosimple)
datastore := regexp.MustCompile("\\[(.*?)\\]").FindStringSubmatch(vDiskPath)[1]
^
test/e2e_node/remote/remote.go:197:8: S1007: should use raw string (`...`) with regexp.MustCompile to avoid having to escape twice (gosimple)
re := regexp.MustCompile("^\\d{8}T\\d{6}$")
^
pkg/volume/util/device_util_linux_test.go:34:17: S1007: should use raw string (`...`) with regexp.MustCompile to avoid having to escape twice (gosimple)
portPattern := regexp.MustCompile("^/sys/class/iscsi_host/(host\\d)/device/session\\d/connection\\d:0/iscsi_connection/connection\\d:0/(?:persistent_)?port$")
^
pkg/volume/util/device_util_linux_test.go:38:20: S1007: should use raw string (`...`) with regexp.MustCompile to avoid having to escape twice (gosimple)
addressPattern := regexp.MustCompile("^/sys/class/iscsi_host/(host\\d)/device/session\\d/connection\\d:0/iscsi_connection/connection\\d:0/(?:persistent_)?address$")
^
pkg/volume/util/device_util_linux_test.go:48:23: S1007: should use raw string (`...`) with regexp.MustCompile to avoid having to escape twice (gosimple)
targetNamePattern := regexp.MustCompile("^/sys/class/iscsi_host/(host\\d)/device/session\\d/iscsi_session/session\\d/targetname$")
^
test/conformance/walk.go:269:15: S1007: should use raw string (`...`) with regexp.MustCompile to avoid having to escape twice (gosimple)
if sline := regexp.MustCompile("^Testname\\s*:\\s*").Split(line, -1); len(sline) == 2 {
^
test/conformance/walk.go:274:15: S1007: should use raw string (`...`) with regexp.MustCompile to avoid having to escape twice (gosimple)
if sline := regexp.MustCompile("^Release\\s*:\\s*").Split(line, -1); len(sline) == 2 {
^
test/conformance/walk.go:279:15: S1007: should use raw string (`...`) with regexp.MustCompile to avoid having to escape twice (gosimple)
if sline := regexp.MustCompile("^Description\\s*:\\s*").Split(line, -1); len(sline) == 2 {
^
test/e2e_node/util.go:342:11: S1007: should use raw string (`...`) with regexp.MustCompile to avoid having to escape twice (gosimple)
regex := regexp.MustCompile("(kubelet-\\w+)")
^
pkg/registry/authentication/tokenreview/storage.go:80:39: S1039: unnecessary use of fmt.Sprintf (gosimple)
return nil, apierrors.NewBadRequest(fmt.Sprintf("token is required for TokenReview in authentication"))
^
test/e2e/common/node/downwardapi.go:136:4: S1039: unnecessary use of fmt.Sprintf (gosimple)
fmt.Sprintf("OK"),
^
test/e2e/common/storage/downwardapi_volume.go:199:4: S1039: unnecessary use of fmt.Sprintf (gosimple)
fmt.Sprintf("2\n"),
^
test/e2e/common/storage/downwardapi_volume.go:213:4: S1039: unnecessary use of fmt.Sprintf (gosimple)
fmt.Sprintf("67108864\n"),
^
test/e2e/common/storage/downwardapi_volume.go:227:4: S1039: unnecessary use of fmt.Sprintf (gosimple)
fmt.Sprintf("1\n"),
^
test/e2e/common/storage/downwardapi_volume.go:241:4: S1039: unnecessary use of fmt.Sprintf (gosimple)
fmt.Sprintf("33554432\n"),
^
test/e2e/common/storage/projected_downwardapi.go:199:4: S1039: unnecessary use of fmt.Sprintf (gosimple)
fmt.Sprintf("2\n"),
^
test/e2e/common/storage/projected_downwardapi.go:213:4: S1039: unnecessary use of fmt.Sprintf (gosimple)
fmt.Sprintf("67108864\n"),
^
test/e2e/common/storage/projected_downwardapi.go:227:4: S1039: unnecessary use of fmt.Sprintf (gosimple)
fmt.Sprintf("1\n"),
^
test/e2e/common/storage/projected_downwardapi.go:241:4: S1039: unnecessary use of fmt.Sprintf (gosimple)
fmt.Sprintf("33554432\n"),
^
test/e2e/framework/service/resource.go:136:9: S1039: unnecessary use of fmt.Sprintf (gosimple)
panic(fmt.Sprintf("no app name provided"))
^
test/e2e/framework/statefulset/rest.go:116:29: S1039: unnecessary use of fmt.Sprintf (gosimple)
errList = append(errList, fmt.Sprintf("Timeout waiting for pvc deletion."))
^
test/e2e/framework/statefulset/rest.go:138:29: S1039: unnecessary use of fmt.Sprintf (gosimple)
errList = append(errList, fmt.Sprintf("Timeout waiting for pv provisioner to delete pvs, this might mean the test leaked pvs."))
^
test/e2e/apimachinery/webhook.go:1585:9: S1039: unnecessary use of fmt.Sprint (gosimple)
return fmt.Sprint(`{"data":{"webhook-e2e-test":"webhook-disallow"}}`)
^
test/e2e/apimachinery/webhook.go:1925:18: S1039: unnecessary use of fmt.Sprint (gosimple)
crDummyPatch := fmt.Sprint(`[{ "op": "add", "path": "/dummy", "value": "test" }]`)
^
test/e2e/framework/autoscaling/autoscaling_utils.go:596:12: S1039: unnecessary use of fmt.Sprintf (gosimple)
ginkgo.By(fmt.Sprintf("Running controller for sidecar"))
^
test/e2e/framework/autoscaling/autoscaling_utils.go:679:12: S1039: unnecessary use of fmt.Sprintf (gosimple)
ginkgo.By(fmt.Sprintf("Running controller"))
^
test/e2e/autoscaling/cluster_autoscaler_scalability.go:118:13: S1039: unnecessary use of fmt.Sprintf (gosimple)
ginkgo.By(fmt.Sprintf("Restoring initial size of the cluster"))
^
test/e2e/autoscaling/cluster_autoscaler_scalability.go:469:12: S1039: unnecessary use of fmt.Sprintf (gosimple)
ginkgo.By(fmt.Sprintf("Running RC which reserves host port and memory"))
^
test/e2e/autoscaling/cluster_size_autoscaling.go:142:13: S1039: unnecessary use of fmt.Sprintf (gosimple)
ginkgo.By(fmt.Sprintf("Restoring initial size of the cluster"))
^
test/e2e/autoscaling/cluster_size_autoscaling.go:1502:9: S1039: unnecessary use of fmt.Sprintf (gosimple)
return fmt.Sprintf("CriticalAddonsOnly taint found on node")
^
test/e2e/upgrades/autoscaling/horizontal_pod_autoscalers.go:70:12: S1039: unnecessary use of fmt.Sprintf (gosimple)
ginkgo.By(fmt.Sprintf("Waiting for upgrade to finish before checking HPA"))
^
test/e2e/upgrades/autoscaling/horizontal_pod_autoscalers.go:86:12: S1039: unnecessary use of fmt.Sprintf (gosimple)
ginkgo.By(fmt.Sprintf("HPA scales to 1 replica: consume 10 millicores, target per pod 100 millicores, min pods 1."))
^
test/e2e/upgrades/autoscaling/horizontal_pod_autoscalers.go:88:12: S1039: unnecessary use of fmt.Sprintf (gosimple)
ginkgo.By(fmt.Sprintf("HPA waits for 1 replica"))
^
test/e2e/upgrades/autoscaling/horizontal_pod_autoscalers.go:91:12: S1039: unnecessary use of fmt.Sprintf (gosimple)
ginkgo.By(fmt.Sprintf("HPA scales to 3 replicas: consume 250 millicores, target per pod 100 millicores."))
^
test/e2e/upgrades/autoscaling/horizontal_pod_autoscalers.go:93:12: S1039: unnecessary use of fmt.Sprintf (gosimple)
ginkgo.By(fmt.Sprintf("HPA waits for 3 replicas"))
^
test/e2e/upgrades/autoscaling/horizontal_pod_autoscalers.go:96:12: S1039: unnecessary use of fmt.Sprintf (gosimple)
ginkgo.By(fmt.Sprintf("HPA scales to 5 replicas: consume 700 millicores, target per pod 100 millicores, max pods 5."))
^
test/e2e/upgrades/autoscaling/horizontal_pod_autoscalers.go:98:12: S1039: unnecessary use of fmt.Sprintf (gosimple)
ginkgo.By(fmt.Sprintf("HPA waits for 5 replicas"))
^
pkg/apis/certificates/helpers.go:65:63: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
func IsKubeletServingCSR(req *x509.CertificateRequest, usages sets.String) bool {
^
pkg/apis/certificates/helpers.go:68:69: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
func ValidateKubeletServingCSR(req *x509.CertificateRequest, usages sets.String) error {
^
pkg/apis/certificates/helpers.go:108:62: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
func IsKubeletClientCSR(req *x509.CertificateRequest, usages sets.String) bool {
^
pkg/apis/certificates/helpers.go:111:68: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
func ValidateKubeletClientCSR(req *x509.CertificateRequest, usages sets.String) error {
^
pkg/volume/util/fsquota/common/quota_common_linux_impl.go:25:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
pkg/registry/scheduling/rest/storage_scheduling.go:82:10: SA1019: wait.Poll is deprecated: This method does not return errors from context, use PollWithContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
err := wait.Poll(1*time.Second, 30*time.Second, func() (done bool, err error) {
^
pkg/kubelet/cm/devicemanager/checkpoint/checkpoint.go:66:37: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
func (dev DevicesPerNUMA) Devices() sets.String {
^
cmd/kubeadm/app/discovery/file/file.go:94:8: SA1019: wait.Poll is deprecated: This method does not return errors from context, use PollWithContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
err = wait.Poll(constants.DiscoveryRetryInterval, discoveryTimeout, func() (bool, error) {
^
cmd/kubeadm/app/discovery/file/file.go:109:12: SA1019: wait.ErrWaitTimeout is deprecated: This type will be made private in favor of Interrupted() for checking errors or ErrorInterrupted(err) for returning a wrapped error. (staticcheck)
if err == wait.ErrWaitTimeout {
^
test/utils/deployment.go:82:9: SA1019: wait.PollImmediate is deprecated: This method does not return errors from context, use PollWithContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
err := wait.PollImmediate(pollInterval, pollTimeout, func() (bool, error) {
^
test/utils/deployment.go:109:12: SA1019: wait.ErrWaitTimeout is deprecated: This type will be made private in favor of Interrupted() for checking errors or ErrorInterrupted(err) for returning a wrapped error. (staticcheck)
if err == wait.ErrWaitTimeout {
^
test/utils/deployment.go:210:9: SA1019: wait.PollImmediate is deprecated: This method does not return errors from context, use PollWithContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
err := wait.PollImmediate(pollInterval, pollTimeout, func() (bool, error) {
^
test/utils/deployment.go:228:12: SA1019: wait.ErrWaitTimeout is deprecated: This type will be made private in favor of Interrupted() for checking errors or ErrorInterrupted(err) for returning a wrapped error. (staticcheck)
if err == wait.ErrWaitTimeout {
^
test/utils/deployment.go:306:13: SA1019: wait.PollImmediate is deprecated: This method does not return errors from context, use PollWithContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
pollErr := wait.PollImmediate(pollInterval, pollTimeout, func() (bool, error) {
^
test/utils/deployment.go:320:16: SA1019: wait.ErrWaitTimeout is deprecated: This type will be made private in favor of Interrupted() for checking errors or ErrorInterrupted(err) for returning a wrapped error. (staticcheck)
if pollErr == wait.ErrWaitTimeout {
^
test/utils/deployment.go:334:9: SA1019: wait.PollImmediate is deprecated: This method does not return errors from context, use PollWithContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
err := wait.PollImmediate(pollInterval, pollTimeout, func() (bool, error) {
^
test/utils/deployment.go:354:9: SA1019: wait.PollImmediate is deprecated: This method does not return errors from context, use PollWithContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
err := wait.PollImmediate(pollInterval, pollTimeout, func() (bool, error) {
^
test/utils/deployment.go:370:13: SA1019: wait.PollImmediate is deprecated: This method does not return errors from context, use PollWithContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
pollErr := wait.PollImmediate(pollInterval, pollTimeout, func() (bool, error) {
^
test/utils/deployment.go:379:16: SA1019: wait.ErrWaitTimeout is deprecated: This type will be made private in favor of Interrupted() for checking errors or ErrorInterrupted(err) for returning a wrapped error. (staticcheck)
if pollErr == wait.ErrWaitTimeout {
^
test/utils/pod_store.go:59:12: SA1019: wait.PollImmediate is deprecated: This method does not return errors from context, use PollWithContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
if err := wait.PollImmediate(50*time.Millisecond, 2*time.Minute, func() (bool, error) {
^
test/utils/replicaset.go:36:13: SA1019: wait.PollImmediate is deprecated: This method does not return errors from context, use PollWithContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
pollErr := wait.PollImmediate(pollInterval, pollTimeout, func() (bool, error) {
^
test/utils/replicaset.go:50:16: SA1019: wait.ErrWaitTimeout is deprecated: This type will be made private in favor of Interrupted() for checking errors or ErrorInterrupted(err) for returning a wrapped error. (staticcheck)
if pollErr == wait.ErrWaitTimeout {
^
test/utils/replicaset.go:59:12: SA1019: wait.PollImmediate is deprecated: This method does not return errors from context, use PollWithContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
if err := wait.PollImmediate(pollInterval, pollTimeout, func() (bool, error) {
^
test/utils/replicaset.go:74:13: SA1019: wait.PollImmediate is deprecated: This method does not return errors from context, use PollWithContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
pollErr := wait.PollImmediate(pollInterval, pollTimeout, func() (bool, error) {
^
test/utils/replicaset.go:88:16: SA1019: wait.ErrWaitTimeout is deprecated: This type will be made private in favor of Interrupted() for checking errors or ErrorInterrupted(err) for returning a wrapped error. (staticcheck)
if pollErr == wait.ErrWaitTimeout {
^
test/utils/runners.go:221:38: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
func (p PodDiff) String(ignorePhases sets.String) string {
^
test/utils/runners.go:723:24: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
ContainerRestartNodes sets.String
^
test/utils/runners.go:1801:8: SA1019: wait.Poll is deprecated: This method does not return errors from context, use PollWithContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
err = wait.Poll(time.Second, timeout, func() (bool, error) {
^
test/utils/update_resources.go:53:9: SA1019: wait.PollImmediate is deprecated: This method does not return errors from context, use PollWithContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
err := wait.PollImmediate(updateRetryInterval, updateRetryTimeout, cond)
^
cmd/kube-apiserver/app/testing/testserver.go:273:8: SA1019: wait.Poll is deprecated: This method does not return errors from context, use PollWithContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
err = wait.Poll(100*time.Millisecond, time.Minute, func() (bool, error) {
^
cmd/kube-apiserver/app/testing/testserver.go:302:8: SA1019: wait.Poll is deprecated: This method does not return errors from context, use PollWithContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
err = wait.Poll(100*time.Millisecond, 30*time.Second, func() (bool, error) {
^
cmd/kube-controller-manager/app/testing/testserver.go:128:8: SA1019: wait.PollWithContext is deprecated: This method does not return errors from context, use PollWithContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
err = wait.PollWithContext(ctx, 100*time.Millisecond, 30*time.Second, func(ctx context.Context) (bool, error) {
^
cmd/kube-scheduler/app/testing/testserver.go:127:8: SA1019: wait.Poll is deprecated: This method does not return errors from context, use PollWithContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
err = wait.Poll(100*time.Millisecond, 30*time.Second, func() (bool, error) {
^
pkg/kubemark/hollow_proxy.go:135:22: SA1019: utilpointer.Int32Ptr is deprecated: Use Int32 instead. (staticcheck)
OOMScoreAdj: utilpointer.Int32Ptr(0),
^
pkg/api/service/testing/make.go:86:43: SA1019: utilpointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
svc.Spec.AllocateLoadBalancerNodePorts = utilpointer.BoolPtr(true)
^
pkg/api/service/testing/make.go:196:44: SA1019: utilpointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
svc.Spec.AllocateLoadBalancerNodePorts = utilpointer.BoolPtr(val)
^
pkg/controller/nodeipam/ipam/test/utils.go:60:9: SA1019: wait.Poll is deprecated: This method does not return errors from context, use PollWithContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
return wait.Poll(NodePollInterval, timeout, func() (bool, error) {
^
pkg/kubelet/pod/testing/fake_mirror_client.go:32:15: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
mirrorPods sets.String
^
pkg/volume/csi/fake/fake_client.go:23:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
pkg/volume/testing/testing.go:231:43: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
volume.VolumesAttached = make(map[string]sets.String)
^
pkg/volume/testing/testing.go:672:30: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
VolumesAttached map[string]sets.String
^
pkg/volume/testing/volume_host.go:252:9: SA1019: wait.PollImmediate is deprecated: This method does not return errors from context, use PollWithContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
return wait.PollImmediate(10*time.Millisecond, 10*time.Second, func() (bool, error) {
^
test/e2e/framework/ssh/ssh.go:244:9: SA1019: wait.PollWithContext is deprecated: This method does not return errors from context, use PollWithContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
err = wait.PollWithContext(ctx, 5*time.Second, 20*time.Second, func(ctx context.Context) (bool, error) {
^
test/e2e/framework/ssh/ssh.go:298:9: SA1019: wait.PollWithContext is deprecated: This method does not return errors from context, use PollWithContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
err = wait.PollWithContext(ctx, 5*time.Second, 20*time.Second, func(ctx context.Context) (bool, error) {
^
test/e2e/framework/ssh/ssh.go:425:5: SA1019: wait.PollImmediateWithContext is deprecated: This method does not return errors from context, use PollWithContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
if wait.PollImmediateWithContext(ctx, pollNodeInterval, singleCallTimeout, func(ctx context.Context) (bool, error) {
^
test/e2e/framework/network/utils.go:223:159: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
func (config *NetworkingTestConfig) DialFromEndpointContainer(ctx context.Context, protocol, targetIP string, targetPort, maxTries, minTries int, expectedEps sets.String) error {
^
test/e2e/framework/network/utils.go:228:155: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
func (config *NetworkingTestConfig) DialFromTestContainer(ctx context.Context, protocol, targetIP string, targetPort, maxTries, minTries int, expectedEps sets.String) error {
^
test/e2e/framework/network/utils.go:253:77: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
func (config *NetworkingTestConfig) diagnoseMissingEndpoints(foundEndpoints sets.String) {
^
test/e2e/framework/network/utils.go:266:57: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
func (config *NetworkingTestConfig) EndpointHostnames() sets.String {
^
test/e2e/framework/network/utils.go:310:202: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
func (config *NetworkingTestConfig) DialFromContainer(ctx context.Context, protocol, dialCommand, containerIP, targetIP string, containerHTTPPort, targetPort, maxTries, minTries int, expectedResponses sets.String) error {
^
test/e2e/scheduling/priorities.go:387:37: ST1023: should omit type float64 from declaration; it will be inferred from the right-hand side (stylecheck)
var maxCPUFraction, maxMemFraction float64 = ratio, ratio
^
test/e2e/node/pods.go:520:17: ST1023: should omit type *v1.Pod from declaration; it will be inferred from the right-hand side (stylecheck)
var lastPod *v1.Pod = pod
^
test/e2e/storage/testsuites/provisioning.go:687:17: ST1023: should omit type *e2epod.Config from declaration; it will be inferred from the right-hand side (stylecheck)
var podConfig *e2epod.Config = &e2epod.Config{
^
test/e2e/storage/subpath.go:38:33: ST1023: should omit type bool from declaration; it will be inferred from the right-hand side (stylecheck)
var privilegedSecurityContext bool = false
^
test/e2e/storage/csi_mock/csi_snapshot.go:179:29: ST1023: should omit type string from declaration; it will be inferred from the right-hand side (stylecheck)
CSISnapshotterSecretName string = "snapshot-secret"
^
test/e2e/storage/csi_mock/csi_snapshot.go:182:39: ST1023: should omit type string from declaration; it will be inferred from the right-hand side (stylecheck)
CSISnapshotterSecretNameAnnotation string = "csi.storage.k8s.io/snapshotter-secret-name"
^
test/e2e/storage/csi_mock/csi_snapshot.go:185:44: ST1023: should omit type string from declaration; it will be inferred from the right-hand side (stylecheck)
CSISnapshotterSecretNamespaceAnnotation string = "csi.storage.k8s.io/snapshotter-secret-namespace"
^
test/e2e/storage/csi_mock/csi_snapshot.go:398:44: ST1023: should omit type string from declaration; it will be inferred from the right-hand side (stylecheck)
CSISnapshotterDeleteSecretNameAnnotation string = "snapshot.storage.kubernetes.io/deletion-secret-name"
^
test/e2e/storage/csi_mock/csi_snapshot.go:401:49: ST1023: should omit type string from declaration; it will be inferred from the right-hand side (stylecheck)
CSISnapshotterDeleteSecretNamespaceAnnotation string = "snapshot.storage.kubernetes.io/deletion-secret-namespace"
^
pkg/controller/volume/attachdetach/attach_detach_controller_test.go:326:26: ST1023: should omit type int from declaration; it will be inferred from the right-hand side (stylecheck)
var attachedVolumesNum int = 0
^
pkg/controller/volume/attachdetach/attach_detach_controller_test.go:327:26: ST1023: should omit type int from declaration; it will be inferred from the right-hand side (stylecheck)
var detachedVolumesNum int = 0
^
pkg/registry/core/service/allocator/utils.go:26:12: ST1023: should omit type int from declaration; it will be inferred from the right-hand side (stylecheck)
var count int = 0
^
pkg/registry/core/service/storage/storage.go:111:22: ST1023: should omit type api.IPFamily from declaration; it will be inferred from the right-hand side (stylecheck)
var primaryIPFamily api.IPFamily = serviceIPFamily
^
test/e2e/framework/pod/utils.go:38:19: ST1023: should omit type *flag.Flag from declaration; it will be inferred from the right-hand side (stylecheck)
var nodeOsDistro *flag.Flag = flag.Lookup("node-os-distro")
^
test/e2e/instrumentation/logging/generic_soak.go:51:2: ST1011: var kbRateInSeconds is of type time.Duration; don't use unit-specific suffix "Seconds" (stylecheck)
kbRateInSeconds := 1 * time.Second
^
pkg/controller/nodelifecycle/scheduler/taint_manager_test.go:703:2: ST1011: var oneSec is of type time.Duration; don't use unit-specific suffix "Sec" (stylecheck)
oneSec := 1 * time.Second
^
pkg/kubelet/nodeshutdown/systemd/inhibit_linux_test.go:105:2: ST1011: var thirtySeconds is of type time.Duration; don't use unit-specific suffix "Seconds" (stylecheck)
thirtySeconds := time.Duration(30) * time.Second
^
test/integration/apimachinery/watch_timeout_test.go:257:79: ST1011: var timeoutSeconds is of type time.Duration; don't use unit-specific suffix "Seconds" (stylecheck)
func testWatchClientTimeout(t *testing.T, config *restclient.Config, timeout, timeoutSeconds time.Duration) {
^
pkg/controller/endpointslice/reconciler_test.go:868:13: ST1017: don't use Yoda conditions (stylecheck)
} else if "bar" != w {
^
pkg/scheduler/util/utils.go:123:5: ST1017: don't use Yoda conditions (stylecheck)
if "{}" == string(patchBytes) {
^
pkg/volume/iscsi/iscsi_util.go:255:12: ST1017: don't use Yoda conditions (stylecheck)
} else if 0 == written {
^
pkg/volume/iscsi/iscsi_util.go:264:5: ST1017: don't use Yoda conditions (stylecheck)
if 0 == len(devicePaths) {
^
pkg/volume/iscsi/iscsi_util.go:532:12: ST1017: don't use Yoda conditions (stylecheck)
} else if 0 == written {
^
test/integration/apiserver/flowcontrol/concurrency_test.go:92:5: ST1017: don't use Yoda conditions (stylecheck)
if 1 != nominalConcurrency[priorityLevelNoxu1.Name] {
^
test/integration/apiserver/flowcontrol/concurrency_test.go:95:5: ST1017: don't use Yoda conditions (stylecheck)
if 1 != nominalConcurrency[priorityLevelNoxu2.Name] {
^
pkg/controller/certificates/signer/config/v1alpha1/conversion.go:33:6: ST1003: should not use underscores in Go names; func Convert_v1alpha1_CSRSigningControllerConfiguration_To_config_CSRSigningControllerConfiguration should be ConvertV1alpha1CSRSigningControllerConfigurationToConfigCSRSigningControllerConfiguration (stylecheck)
func Convert_v1alpha1_CSRSigningControllerConfiguration_To_config_CSRSigningControllerConfiguration(in *v1alpha1.CSRSigningControllerConfiguration, out *csrsigningconfig.CSRSigningControllerConfiguration, s conversion.Scope) error {
^
pkg/controller/certificates/signer/config/v1alpha1/conversion.go:38:6: ST1003: should not use underscores in Go names; func Convert_config_CSRSigningControllerConfiguration_To_v1alpha1_CSRSigningControllerConfiguration should be ConvertConfigCSRSigningControllerConfigurationToV1alpha1CSRSigningControllerConfiguration (stylecheck)
func Convert_config_CSRSigningControllerConfiguration_To_v1alpha1_CSRSigningControllerConfiguration(in *csrsigningconfig.CSRSigningControllerConfiguration, out *v1alpha1.CSRSigningControllerConfiguration, s conversion.Scope) error {
^
pkg/controller/cronjob/config/v1alpha1/conversion.go:33:6: ST1003: should not use underscores in Go names; func Convert_v1alpha1_CronJobControllerConfiguration_To_config_CronJobControllerConfiguration should be ConvertV1alpha1CronJobControllerConfigurationToConfigCronJobControllerConfiguration (stylecheck)
func Convert_v1alpha1_CronJobControllerConfiguration_To_config_CronJobControllerConfiguration(in *v1alpha1.CronJobControllerConfiguration, out *config.CronJobControllerConfiguration, s conversion.Scope) error {
^
pkg/controller/cronjob/config/v1alpha1/conversion.go:38:6: ST1003: should not use underscores in Go names; func Convert_config_CronJobControllerConfiguration_To_v1alpha1_CronJobControllerConfiguration should be ConvertConfigCronJobControllerConfigurationToV1alpha1CronJobControllerConfiguration (stylecheck)
func Convert_config_CronJobControllerConfiguration_To_v1alpha1_CronJobControllerConfiguration(in *config.CronJobControllerConfiguration, out *v1alpha1.CronJobControllerConfiguration, s conversion.Scope) error {
^
pkg/controller/daemon/config/v1alpha1/conversion.go:33:6: ST1003: should not use underscores in Go names; func Convert_v1alpha1_DaemonSetControllerConfiguration_To_config_DaemonSetControllerConfiguration should be ConvertV1alpha1DaemonSetControllerConfigurationToConfigDaemonSetControllerConfiguration (stylecheck)
func Convert_v1alpha1_DaemonSetControllerConfiguration_To_config_DaemonSetControllerConfiguration(in *v1alpha1.DaemonSetControllerConfiguration, out *daemonconfig.DaemonSetControllerConfiguration, s conversion.Scope) error {
^
pkg/controller/daemon/config/v1alpha1/conversion.go:38:6: ST1003: should not use underscores in Go names; func Convert_config_DaemonSetControllerConfiguration_To_v1alpha1_DaemonSetControllerConfiguration should be ConvertConfigDaemonSetControllerConfigurationToV1alpha1DaemonSetControllerConfiguration (stylecheck)
func Convert_config_DaemonSetControllerConfiguration_To_v1alpha1_DaemonSetControllerConfiguration(in *daemonconfig.DaemonSetControllerConfiguration, out *v1alpha1.DaemonSetControllerConfiguration, s conversion.Scope) error {
^
pkg/controller/deployment/config/v1alpha1/conversion.go:33:6: ST1003: should not use underscores in Go names; func Convert_v1alpha1_DeploymentControllerConfiguration_To_config_DeploymentControllerConfiguration should be ConvertV1alpha1DeploymentControllerConfigurationToConfigDeploymentControllerConfiguration (stylecheck)
func Convert_v1alpha1_DeploymentControllerConfiguration_To_config_DeploymentControllerConfiguration(in *v1alpha1.DeploymentControllerConfiguration, out *deploymentconfig.DeploymentControllerConfiguration, s conversion.Scope) error {
^
pkg/controller/deployment/config/v1alpha1/conversion.go:38:6: ST1003: should not use underscores in Go names; func Convert_config_DeploymentControllerConfiguration_To_v1alpha1_DeploymentControllerConfiguration should be ConvertConfigDeploymentControllerConfigurationToV1alpha1DeploymentControllerConfiguration (stylecheck)
func Convert_config_DeploymentControllerConfiguration_To_v1alpha1_DeploymentControllerConfiguration(in *deploymentconfig.DeploymentControllerConfiguration, out *v1alpha1.DeploymentControllerConfiguration, s conversion.Scope) error {
^
pkg/controller/endpoint/config/v1alpha1/conversion.go:33:6: ST1003: should not use underscores in Go names; func Convert_v1alpha1_EndpointControllerConfiguration_To_config_EndpointControllerConfiguration should be ConvertV1alpha1EndpointControllerConfigurationToConfigEndpointControllerConfiguration (stylecheck)
func Convert_v1alpha1_EndpointControllerConfiguration_To_config_EndpointControllerConfiguration(in *v1alpha1.EndpointControllerConfiguration, out *endpointconfig.EndpointControllerConfiguration, s conversion.Scope) error {
^
pkg/controller/endpoint/config/v1alpha1/conversion.go:38:6: ST1003: should not use underscores in Go names; func Convert_config_EndpointControllerConfiguration_To_v1alpha1_EndpointControllerConfiguration should be ConvertConfigEndpointControllerConfigurationToV1alpha1EndpointControllerConfiguration (stylecheck)
func Convert_config_EndpointControllerConfiguration_To_v1alpha1_EndpointControllerConfiguration(in *endpointconfig.EndpointControllerConfiguration, out *v1alpha1.EndpointControllerConfiguration, s conversion.Scope) error {
^
pkg/controller/endpointslice/config/v1alpha1/conversion.go:33:6: ST1003: should not use underscores in Go names; func Convert_v1alpha1_EndpointSliceControllerConfiguration_To_config_EndpointSliceControllerConfiguration should be ConvertV1alpha1EndpointSliceControllerConfigurationToConfigEndpointSliceControllerConfiguration (stylecheck)
func Convert_v1alpha1_EndpointSliceControllerConfiguration_To_config_EndpointSliceControllerConfiguration(in *v1alpha1.EndpointSliceControllerConfiguration, out *endpointsliceconfig.EndpointSliceControllerConfiguration, s conversion.Scope) error {
^
pkg/controller/endpointslice/config/v1alpha1/conversion.go:38:6: ST1003: should not use underscores in Go names; func Convert_config_EndpointSliceControllerConfiguration_To_v1alpha1_EndpointSliceControllerConfiguration should be ConvertConfigEndpointSliceControllerConfigurationToV1alpha1EndpointSliceControllerConfiguration (stylecheck)
func Convert_config_EndpointSliceControllerConfiguration_To_v1alpha1_EndpointSliceControllerConfiguration(in *endpointsliceconfig.EndpointSliceControllerConfiguration, out *v1alpha1.EndpointSliceControllerConfiguration, s conversion.Scope) error {
^
pkg/controller/endpointslicemirroring/config/v1alpha1/conversion.go:33:6: ST1003: should not use underscores in Go names; func Convert_v1alpha1_EndpointSliceMirroringControllerConfiguration_To_config_EndpointSliceMirroringControllerConfiguration should be ConvertV1alpha1EndpointSliceMirroringControllerConfigurationToConfigEndpointSliceMirroringControllerConfiguration (stylecheck)
func Convert_v1alpha1_EndpointSliceMirroringControllerConfiguration_To_config_EndpointSliceMirroringControllerConfiguration(in *v1alpha1.EndpointSliceMirroringControllerConfiguration, out *endpointslicemirroringconfig.EndpointSliceMirroringControllerConfiguration, s conversion.Scope) error {
^
pkg/controller/endpointslicemirroring/config/v1alpha1/conversion.go:38:6: ST1003: should not use underscores in Go names; func Convert_config_EndpointSliceMirroringControllerConfiguration_To_v1alpha1_EndpointSliceMirroringControllerConfiguration should be ConvertConfigEndpointSliceMirroringControllerConfigurationToV1alpha1EndpointSliceMirroringControllerConfiguration (stylecheck)
func Convert_config_EndpointSliceMirroringControllerConfiguration_To_v1alpha1_EndpointSliceMirroringControllerConfiguration(in *endpointslicemirroringconfig.EndpointSliceMirroringControllerConfiguration, out *v1alpha1.EndpointSliceMirroringControllerConfiguration, s conversion.Scope) error {
^
pkg/controller/garbagecollector/config/v1alpha1/conversion.go:33:6: ST1003: should not use underscores in Go names; func Convert_v1alpha1_GarbageCollectorControllerConfiguration_To_config_GarbageCollectorControllerConfiguration should be ConvertV1alpha1GarbageCollectorControllerConfigurationToConfigGarbageCollectorControllerConfiguration (stylecheck)
func Convert_v1alpha1_GarbageCollectorControllerConfiguration_To_config_GarbageCollectorControllerConfiguration(in *v1alpha1.GarbageCollectorControllerConfiguration, out *config.GarbageCollectorControllerConfiguration, s conversion.Scope) error {
^
pkg/controller/garbagecollector/config/v1alpha1/conversion.go:38:6: ST1003: should not use underscores in Go names; func Convert_config_GarbageCollectorControllerConfiguration_To_v1alpha1_GarbageCollectorControllerConfiguration should be ConvertConfigGarbageCollectorControllerConfigurationToV1alpha1GarbageCollectorControllerConfiguration (stylecheck)
func Convert_config_GarbageCollectorControllerConfiguration_To_v1alpha1_GarbageCollectorControllerConfiguration(in *config.GarbageCollectorControllerConfiguration, out *v1alpha1.GarbageCollectorControllerConfiguration, s conversion.Scope) error {
^
pkg/controller/job/config/v1alpha1/conversion.go:33:6: ST1003: should not use underscores in Go names; func Convert_v1alpha1_JobControllerConfiguration_To_config_JobControllerConfiguration should be ConvertV1alpha1JobControllerConfigurationToConfigJobControllerConfiguration (stylecheck)
func Convert_v1alpha1_JobControllerConfiguration_To_config_JobControllerConfiguration(in *v1alpha1.JobControllerConfiguration, out *config.JobControllerConfiguration, s conversion.Scope) error {
^
pkg/controller/job/config/v1alpha1/conversion.go:38:6: ST1003: should not use underscores in Go names; func Convert_config_JobControllerConfiguration_To_v1alpha1_JobControllerConfiguration should be ConvertConfigJobControllerConfigurationToV1alpha1JobControllerConfiguration (stylecheck)
func Convert_config_JobControllerConfiguration_To_v1alpha1_JobControllerConfiguration(in *config.JobControllerConfiguration, out *v1alpha1.JobControllerConfiguration, s conversion.Scope) error {
^
pkg/controller/namespace/config/v1alpha1/conversion.go:33:6: ST1003: should not use underscores in Go names; func Convert_v1alpha1_NamespaceControllerConfiguration_To_config_NamespaceControllerConfiguration should be ConvertV1alpha1NamespaceControllerConfigurationToConfigNamespaceControllerConfiguration (stylecheck)
func Convert_v1alpha1_NamespaceControllerConfiguration_To_config_NamespaceControllerConfiguration(in *v1alpha1.NamespaceControllerConfiguration, out *config.NamespaceControllerConfiguration, s conversion.Scope) error {
^
pkg/controller/namespace/config/v1alpha1/conversion.go:38:6: ST1003: should not use underscores in Go names; func Convert_config_NamespaceControllerConfiguration_To_v1alpha1_NamespaceControllerConfiguration should be ConvertConfigNamespaceControllerConfigurationToV1alpha1NamespaceControllerConfiguration (stylecheck)
func Convert_config_NamespaceControllerConfiguration_To_v1alpha1_NamespaceControllerConfiguration(in *config.NamespaceControllerConfiguration, out *v1alpha1.NamespaceControllerConfiguration, s conversion.Scope) error {
^
pkg/controller/nodeipam/config/v1alpha1/conversion.go:33:6: ST1003: should not use underscores in Go names; func Convert_v1alpha1_NodeIPAMControllerConfiguration_To_config_NodeIPAMControllerConfiguration should be ConvertV1alpha1NodeIPAMControllerConfigurationToConfigNodeIPAMControllerConfiguration (stylecheck)
func Convert_v1alpha1_NodeIPAMControllerConfiguration_To_config_NodeIPAMControllerConfiguration(in *v1alpha1.NodeIPAMControllerConfiguration, out *config.NodeIPAMControllerConfiguration, s conversion.Scope) error {
^
pkg/controller/nodeipam/config/v1alpha1/conversion.go:38:6: ST1003: should not use underscores in Go names; func Convert_config_NodeIPAMControllerConfiguration_To_v1alpha1_NodeIPAMControllerConfiguration should be ConvertConfigNodeIPAMControllerConfigurationToV1alpha1NodeIPAMControllerConfiguration (stylecheck)
func Convert_config_NodeIPAMControllerConfiguration_To_v1alpha1_NodeIPAMControllerConfiguration(in *config.NodeIPAMControllerConfiguration, out *v1alpha1.NodeIPAMControllerConfiguration, s conversion.Scope) error {
^
pkg/controller/nodelifecycle/config/v1alpha1/conversion.go:33:6: ST1003: should not use underscores in Go names; func Convert_v1alpha1_NodeLifecycleControllerConfiguration_To_config_NodeLifecycleControllerConfiguration should be ConvertV1alpha1NodeLifecycleControllerConfigurationToConfigNodeLifecycleControllerConfiguration (stylecheck)
func Convert_v1alpha1_NodeLifecycleControllerConfiguration_To_config_NodeLifecycleControllerConfiguration(in *v1alpha1.NodeLifecycleControllerConfiguration, out *config.NodeLifecycleControllerConfiguration, s conversion.Scope) error {
^
pkg/controller/nodelifecycle/config/v1alpha1/conversion.go:38:6: ST1003: should not use underscores in Go names; func Convert_config_NodeLifecycleControllerConfiguration_To_v1alpha1_NodeLifecycleControllerConfiguration should be ConvertConfigNodeLifecycleControllerConfigurationToV1alpha1NodeLifecycleControllerConfiguration (stylecheck)
func Convert_config_NodeLifecycleControllerConfiguration_To_v1alpha1_NodeLifecycleControllerConfiguration(in *config.NodeLifecycleControllerConfiguration, out *v1alpha1.NodeLifecycleControllerConfiguration, s conversion.Scope) error {
^
pkg/controller/podautoscaler/config/v1alpha1/conversion.go:33:6: ST1003: should not use underscores in Go names; func Convert_config_HPAControllerConfiguration_To_v1alpha1_HPAControllerConfiguration should be ConvertConfigHPAControllerConfigurationToV1alpha1HPAControllerConfiguration (stylecheck)
func Convert_config_HPAControllerConfiguration_To_v1alpha1_HPAControllerConfiguration(in *config.HPAControllerConfiguration, out *v1alpha1.HPAControllerConfiguration, s conversion.Scope) error {
^
running ( cd /nvme/gopath/src/k8s.io/kubernetes/staging/src/k8s.io/api; env LOGCHECK_CONFIG=/nvme/gopath/src/k8s.io/kubernetes/hack/logcheck.conf /nvme/gopath/src/k8s.io/kubernetes/_output/local/bin/golangci-lint run --config=/nvme/gopath/src/k8s.io/kubernetes/hack/golangci-strict.yaml --path-prefix staging/src/k8s.io/api ./... )
staging/src/k8s.io/api/rbac/v1alpha1/types.go:105:1: deprecatedComment: the proper format is `Deprecated: <text>` (gocritic)
// Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 Role, and will no longer be served in v1.22.
^
staging/src/k8s.io/api/rbac/v1alpha1/types.go:123:1: deprecatedComment: the proper format is `Deprecated: <text>` (gocritic)
// Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 RoleBinding, and will no longer be served in v1.22.
^
staging/src/k8s.io/api/rbac/v1alpha1/types.go:142:1: deprecatedComment: the proper format is `Deprecated: <text>` (gocritic)
// Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 RoleBindingList, and will no longer be served in v1.22.
^
staging/src/k8s.io/api/rbac/v1alpha1/types.go:156:1: deprecatedComment: the proper format is `Deprecated: <text>` (gocritic)
// Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 RoleList, and will no longer be served in v1.22.
^
staging/src/k8s.io/api/rbac/v1alpha1/types.go:172:1: deprecatedComment: the proper format is `Deprecated: <text>` (gocritic)
// Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 ClusterRole, and will no longer be served in v1.22.
^
staging/src/k8s.io/api/rbac/v1alpha1/types.go:204:1: deprecatedComment: the proper format is `Deprecated: <text>` (gocritic)
// Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 ClusterRoleBinding, and will no longer be served in v1.22.
^
staging/src/k8s.io/api/rbac/v1alpha1/types.go:223:1: deprecatedComment: the proper format is `Deprecated: <text>` (gocritic)
// Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 ClusterRoleBindings, and will no longer be served in v1.22.
^
staging/src/k8s.io/api/rbac/v1alpha1/types.go:237:1: deprecatedComment: the proper format is `Deprecated: <text>` (gocritic)
// Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 ClusterRoles, and will no longer be served in v1.22.
^
staging/src/k8s.io/api/rbac/v1beta1/types.go:109:1: deprecatedComment: the proper format is `Deprecated: <text>` (gocritic)
// Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 Role, and will no longer be served in v1.22.
^
staging/src/k8s.io/api/rbac/v1beta1/types.go:131:1: deprecatedComment: the proper format is `Deprecated: <text>` (gocritic)
// Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 RoleBinding, and will no longer be served in v1.22.
^
staging/src/k8s.io/api/rbac/v1beta1/types.go:154:1: deprecatedComment: the proper format is `Deprecated: <text>` (gocritic)
// Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 RoleBindingList, and will no longer be served in v1.22.
^
staging/src/k8s.io/api/rbac/v1beta1/types.go:172:1: deprecatedComment: the proper format is `Deprecated: <text>` (gocritic)
// Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 RoleList, and will no longer be served in v1.22.
^
staging/src/k8s.io/api/rbac/v1beta1/types.go:192:1: deprecatedComment: the proper format is `Deprecated: <text>` (gocritic)
// Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 ClusterRole, and will no longer be served in v1.22.
^
staging/src/k8s.io/api/rbac/v1beta1/types.go:227:1: deprecatedComment: the proper format is `Deprecated: <text>` (gocritic)
// Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 ClusterRoleBinding, and will no longer be served in v1.22.
^
staging/src/k8s.io/api/rbac/v1beta1/types.go:250:1: deprecatedComment: the proper format is `Deprecated: <text>` (gocritic)
// Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 ClusterRoleBindingList, and will no longer be served in v1.22.
^
staging/src/k8s.io/api/rbac/v1beta1/types.go:268:1: deprecatedComment: the proper format is `Deprecated: <text>` (gocritic)
// Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 ClusterRoles, and will no longer be served in v1.22.
^
staging/src/k8s.io/api/admissionregistration/v1beta1/types.go:87:1: deprecatedComment: the proper format is `Deprecated: <text>` (gocritic)
// Deprecated in v1.16, planned for removal in v1.19. Use admissionregistration.k8s.io/v1 ValidatingWebhookConfiguration instead.
^
staging/src/k8s.io/api/admissionregistration/v1beta1/types.go:126:1: deprecatedComment: the proper format is `Deprecated: <text>` (gocritic)
// Deprecated in v1.16, planned for removal in v1.19. Use admissionregistration.k8s.io/v1 MutatingWebhookConfiguration instead.
^
staging/src/k8s.io/api/core/v1/types.go:75:2: deprecatedComment: use `Deprecated: ` (note the casing) instead of `DEPRECATED: ` (gocritic)
// DEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an
^
staging/src/k8s.io/api/core/v1/types.go:1175:1: deprecatedComment: use `Deprecated: ` (note the casing) instead of `DEPRECATED: ` (gocritic)
// DEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an
^
staging/src/k8s.io/api/core/v1/types.go:5712:1: deprecatedComment: the proper format is `Deprecated: <text>` (gocritic)
// Deprecated in 1.7, please use the bindings subresource of pods instead.
^
staging/src/k8s.io/api/policy/v1beta1/types.go:241:1: deprecatedComment: the proper format is `Deprecated: <text>` (gocritic)
// Deprecated in 1.21.
^
staging/src/k8s.io/api/extensions/v1beta1/types.go:549:2: deprecatedComment: use `Deprecated: ` (note the casing) instead of `DEPRECATED: ` (gocritic)
// DEPRECATED: DefaultDaemonSetUniqueLabelKey is used instead.
^
staging/src/k8s.io/api/batch/v1/types.go:47:2: ST1003: const ControllerUidLabel should be ControllerUIDLabel (stylecheck)
ControllerUidLabel = labelPrefix + "controller-uid"
^
staging/src/k8s.io/api/core/v1/resource.go:29:25: ST1003: method Cpu should be CPU (stylecheck)
func (rl *ResourceList) Cpu() *resource.Quantity {
^
staging/src/k8s.io/api/core/v1/types.go:6450:2: ST1003: const SecretTypeDockerConfigJson should be SecretTypeDockerConfigJSON (stylecheck)
SecretTypeDockerConfigJson SecretType = "kubernetes.io/dockerconfigjson"
^
staging/src/k8s.io/api/core/v1/types.go:6453:2: ST1003: const DockerConfigJsonKey should be DockerConfigJSONKey (stylecheck)
DockerConfigJsonKey = ".dockerconfigjson"
^
running ( cd /nvme/gopath/src/k8s.io/kubernetes/staging/src/k8s.io/apiextensions-apiserver; env LOGCHECK_CONFIG=/nvme/gopath/src/k8s.io/kubernetes/hack/logcheck.conf /nvme/gopath/src/k8s.io/kubernetes/_output/local/bin/golangci-lint run --config=/nvme/gopath/src/k8s.io/kubernetes/hack/golangci-strict.yaml --path-prefix staging/src/k8s.io/apiextensions-apiserver ./... )
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/defaults_test.go:31:13: Error return value is not checked (errcheck)
AddToScheme(scheme)
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/defaults_test.go:31:13: Error return value is not checked (errcheck)
AddToScheme(scheme)
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/objectmeta/coerce.go:128:24: Error return value of `utiljson.Unmarshal` is not checked (errcheck)
utiljson.Unmarshal(singleFieldBytes, accumulatedObjectMeta)
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/objectmeta/coerce_test.go:134:21: Error return value is not checked (errcheck)
DeleteJSONPath(truncatedMetaMap, pth[:1], 0)
^
staging/src/k8s.io/apiextensions-apiserver/pkg/features/kube_features.go:33:43: Error return value of `utilfeature.DefaultMutableFeatureGate.Add` is not checked (errcheck)
utilfeature.DefaultMutableFeatureGate.Add(defaultKubernetesFeatureGates)
^
staging/src/k8s.io/apiextensions-apiserver/pkg/controller/finalizer/crd_finalizer.go:99:40: Error return value of `(k8s.io/client-go/tools/cache.SharedInformer).AddEventHandler` is not checked (errcheck)
crdInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{
^
staging/src/k8s.io/apiextensions-apiserver/pkg/controller/nonstructuralschema/nonstructuralschema_controller.go:74:40: Error return value of `(k8s.io/client-go/tools/cache.SharedInformer).AddEventHandler` is not checked (errcheck)
crdInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{
^
staging/src/k8s.io/apiextensions-apiserver/pkg/controller/status/naming_controller.go:78:40: Error return value of `(k8s.io/client-go/tools/cache.SharedInformer).AddEventHandler` is not checked (errcheck)
crdInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{
^
staging/src/k8s.io/apiextensions-apiserver/pkg/controller/status/naming_controller_test.go:326:18: Error return value of `crdIndexer.Add` is not checked (errcheck)
crdIndexer.Add(obj)
^
staging/src/k8s.io/apiextensions-apiserver/pkg/controller/apiapproval/apiapproval_controller.go:70:40: Error return value of `(k8s.io/client-go/tools/cache.SharedInformer).AddEventHandler` is not checked (errcheck)
crdInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{
^
staging/src/k8s.io/apiextensions-apiserver/pkg/controller/openapi/builder/builder.go:352:28: Error return value of `endpoints.AddObjectParams` is not checked (errcheck)
endpoints.AddObjectParams(b.ws, route, &metav1.GetOptions{})
^
staging/src/k8s.io/apiextensions-apiserver/pkg/controller/openapi/builder/builder.go:354:28: Error return value of `endpoints.AddObjectParams` is not checked (errcheck)
endpoints.AddObjectParams(b.ws, route, &metav1.ListOptions{})
^
staging/src/k8s.io/apiextensions-apiserver/pkg/controller/openapi/builder/builder.go:356:28: Error return value of `endpoints.AddObjectParams` is not checked (errcheck)
endpoints.AddObjectParams(b.ws, route, &metav1.UpdateOptions{})
^
staging/src/k8s.io/apiextensions-apiserver/pkg/controller/openapi/builder/builder.go:358:28: Error return value of `endpoints.AddObjectParams` is not checked (errcheck)
endpoints.AddObjectParams(b.ws, route, &metav1.PatchOptions{})
^
staging/src/k8s.io/apiextensions-apiserver/pkg/controller/openapi/builder/builder.go:360:28: Error return value of `endpoints.AddObjectParams` is not checked (errcheck)
endpoints.AddObjectParams(b.ws, route, &metav1.CreateOptions{})
^
staging/src/k8s.io/apiextensions-apiserver/pkg/controller/openapi/builder/builder.go:362:28: Error return value of `endpoints.AddObjectParams` is not checked (errcheck)
endpoints.AddObjectParams(b.ws, route, &metav1.DeleteOptions{})
^
staging/src/k8s.io/apiextensions-apiserver/pkg/controller/openapi/builder/builder_test.go:366:80: Error return value of `apiextensionsv1.Convert_v1_JSONSchemaProps_To_apiextensions_JSONSchemaProps` is not checked (errcheck)
apiextensionsv1.Convert_v1_JSONSchemaProps_To_apiextensions_JSONSchemaProps(v1beta1Schema, internalSchema, nil)
^
staging/src/k8s.io/apiextensions-apiserver/pkg/controller/openapiv3/controller.go:69:40: Error return value of `(k8s.io/client-go/tools/cache.SharedInformer).AddEventHandler` is not checked (errcheck)
crdInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{
^
staging/src/k8s.io/apiextensions-apiserver/pkg/controller/openapiv3/controller.go:107:17: Error return value of `c.buildV3Spec` is not checked (errcheck)
c.buildV3Spec(crd, crd.Name, v.Name)
^
staging/src/k8s.io/apiextensions-apiserver/pkg/controller/openapiv3/controller.go:167:16: Error return value of `c.buildV3Spec` is not checked (errcheck)
c.buildV3Spec(crd, name, v.Name)
^
staging/src/k8s.io/apiextensions-apiserver/pkg/controller/openapiv3/controller.go:182:24: Error return value of `c.updateGroupVersion` is not checked (errcheck)
c.updateGroupVersion(gv)
^
staging/src/k8s.io/apiextensions-apiserver/pkg/controller/openapiv3/controller.go:239:17: Error return value of `c.updateCRDSpec` is not checked (errcheck)
c.updateCRDSpec(crd, name, versionName, v3)
^
staging/src/k8s.io/apiextensions-apiserver/pkg/controller/openapi/controller.go:69:40: Error return value of `(k8s.io/client-go/tools/cache.SharedInformer).AddEventHandler` is not checked (errcheck)
crdInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{
^
staging/src/k8s.io/apiextensions-apiserver/pkg/registry/customresource/etcd_test.go:741:29: Error return value of `unstructured.SetNestedField` is not checked (errcheck)
unstructured.SetNestedField(u.Object, value, fields...)
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/customresource_discovery_controller.go:75:40: Error return value of `(k8s.io/client-go/tools/cache.SharedInformer).AddEventHandler` is not checked (errcheck)
crdInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/customresource_handler.go:202:40: Error return value of `(k8s.io/client-go/tools/cache.SharedInformer).AddEventHandler` is not checked (errcheck)
crdInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/customresource_handler_test.go:549:30: Error return value of `unstructured.SetNestedField` is not checked (errcheck)
unstructured.SetNestedField(u.Object, int64(1), "spec", "num")
^
staging/src/k8s.io/apiextensions-apiserver/pkg/cmd/server/testing/testserver.go:128:35: Error return value of `s.APIEnablement.RuntimeConfig.Set` is not checked (errcheck)
s.APIEnablement.RuntimeConfig.Set("api/all=true")
^
staging/src/k8s.io/apiextensions-apiserver/pkg/cmd/server/testing/testserver.go:130:10: Error return value of `fs.Parse` is not checked (errcheck)
fs.Parse(customFlags)
^
staging/src/k8s.io/apiextensions-apiserver/test/integration/fixtures/server.go:61:28: Error return value of `fakeKubeConfig.WriteString` is not checked (errcheck)
fakeKubeConfig.WriteString(`
^
staging/src/k8s.io/apiextensions-apiserver/test/integration/conversion/conversion_test.go:688:30: Error return value of `unstructured.SetNestedField` is not checked (errcheck)
unstructured.SetNestedField(objv1beta2.Object, meta, "metadata")
^
staging/src/k8s.io/apiextensions-apiserver/test/integration/defaulting_test.go:294:29: Error return value of `unstructured.SetNestedField` is not checked (errcheck)
unstructured.SetNestedField(foo.Object, "a", "spec", "a")
^
staging/src/k8s.io/apiextensions-apiserver/test/integration/defaulting_test.go:295:29: Error return value of `unstructured.SetNestedField` is not checked (errcheck)
unstructured.SetNestedField(foo.Object, "b", "status", "b")
^
staging/src/k8s.io/apiextensions-apiserver/test/integration/defaulting_test.go:309:29: Error return value of `unstructured.SetNestedField` is not checked (errcheck)
unstructured.SetNestedField(foo.Object, map[string]interface{}{}, "status")
^
staging/src/k8s.io/apiextensions-apiserver/test/integration/finalization_test.go:131:43: Error return value of `fixtures.DeleteV1CustomResourceDefinition` is not checked (errcheck)
fixtures.DeleteV1CustomResourceDefinition(noxuDefinition, apiExtensionClient)
^
staging/src/k8s.io/apiextensions-apiserver/test/integration/objectmeta_test.go:64:29: Error return value of `unstructured.SetNestedField` is not checked (errcheck)
unstructured.SetNestedField(obj.UnstructuredContent(), int64(42), "metadata", "unknown")
^
staging/src/k8s.io/apiextensions-apiserver/test/integration/objectmeta_test.go:65:29: Error return value of `unstructured.SetNestedField` is not checked (errcheck)
unstructured.SetNestedField(obj.UnstructuredContent(), nil, "metadata", "generation")
^
staging/src/k8s.io/apiextensions-apiserver/test/integration/objectmeta_test.go:66:29: Error return value of `unstructured.SetNestedField` is not checked (errcheck)
unstructured.SetNestedField(obj.UnstructuredContent(), map[string]interface{}{"foo": int64(42), "bar": "abc"}, "metadata", "labels")
^
staging/src/k8s.io/apiextensions-apiserver/test/integration/objectmeta_test.go:79:29: Error return value of `unstructured.SetNestedField` is not checked (errcheck)
unstructured.SetNestedField(obj.UnstructuredContent(), map[string]interface{}{"bar": "abc"}, "metadata", "labels")
^
staging/src/k8s.io/apiextensions-apiserver/test/integration/objectmeta_test.go:168:29: Error return value of `unstructured.SetNestedField` is not checked (errcheck)
unstructured.SetNestedField(original.UnstructuredContent(), int64(42), "metadata", "unknown")
^
staging/src/k8s.io/apiextensions-apiserver/test/integration/objectmeta_test.go:169:29: Error return value of `unstructured.SetNestedField` is not checked (errcheck)
unstructured.SetNestedField(original.UnstructuredContent(), nil, "metadata", "generation")
^
staging/src/k8s.io/apiextensions-apiserver/test/integration/objectmeta_test.go:171:29: Error return value of `unstructured.SetNestedField` is not checked (errcheck)
unstructured.SetNestedField(original.UnstructuredContent(), map[string]interface{}{"foo": int64(42), "bar": "abc"}, "metadata", "annotations")
^
staging/src/k8s.io/apiextensions-apiserver/test/integration/objectmeta_test.go:172:29: Error return value of `unstructured.SetNestedField` is not checked (errcheck)
unstructured.SetNestedField(original.UnstructuredContent(), map[string]interface{}{"invalid": "x y"}, "metadata", "labels")
^
staging/src/k8s.io/apiextensions-apiserver/test/integration/objectmeta_test.go:173:29: Error return value of `unstructured.SetNestedField` is not checked (errcheck)
unstructured.SetNestedField(original.UnstructuredContent(), int64(42), "embedded", "metadata", "unknown")
^
staging/src/k8s.io/apiextensions-apiserver/test/integration/objectmeta_test.go:174:29: Error return value of `unstructured.SetNestedField` is not checked (errcheck)
unstructured.SetNestedField(original.UnstructuredContent(), map[string]interface{}{"foo": int64(42), "bar": "abc"}, "embedded", "metadata", "annotations")
^
staging/src/k8s.io/apiextensions-apiserver/test/integration/objectmeta_test.go:175:29: Error return value of `unstructured.SetNestedField` is not checked (errcheck)
unstructured.SetNestedField(original.UnstructuredContent(), map[string]interface{}{"invalid": "x y"}, "embedded", "metadata", "labels")
^
staging/src/k8s.io/apiextensions-apiserver/test/integration/objectmeta_test.go:176:29: Error return value of `unstructured.SetNestedField` is not checked (errcheck)
unstructured.SetNestedField(original.UnstructuredContent(), "Foo", "embedded", "kind")
^
staging/src/k8s.io/apiextensions-apiserver/test/integration/objectmeta_test.go:177:29: Error return value of `unstructured.SetNestedField` is not checked (errcheck)
unstructured.SetNestedField(original.UnstructuredContent(), "foo/v1", "embedded", "apiVersion")
^
staging/src/k8s.io/apiextensions-apiserver/test/integration/objectmeta_test.go:255:29: Error return value of `unstructured.SetNestedField` is not checked (errcheck)
unstructured.SetNestedField(obj.Object, "changed", "metadata", "labels", "something")
^
staging/src/k8s.io/apiextensions-apiserver/test/integration/objectmeta_test.go:263:29: Error return value of `unstructured.SetNestedField` is not checked (errcheck)
unstructured.SetNestedField(obj.Object, "fixed", "metadata", "labels", "invalid")
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/types.go:180:2: deprecatedComment: the proper format is `Deprecated: <text>` (gocritic)
// deprecated indicates this version of the custom resource API is deprecated.
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/types.go:203:2: deprecatedComment: the proper format is `Deprecated: <text>` (gocritic)
// deprecated indicates this version of the custom resource API is deprecated.
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/types.go:397:1: deprecatedComment: the proper format is `Deprecated: <text>` (gocritic)
// Deprecated in v1.16, planned for removal in v1.22. Use apiextensions.k8s.io/v1 CustomResourceDefinition instead.
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/types.go:177:2: deprecatedComment: the proper format is `Deprecated: <text>` (gocritic)
// deprecated indicates this version of the custom resource API is deprecated.
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/convert_test.go:37:2: commentFormatting: put a space between `//` and comment text (gocritic)
//seed = int64(1549012506261785182)
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/kubeopenapi_test.go:37:2: commentFormatting: put a space between `//` and comment text (gocritic)
//seed = int64(1549012506261785182)
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/pruning/algorithm.go:81:4: ifElseChain: rewrite if-else to switch statement (gocritic)
if ok {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/objectmeta/algorithm_test.go:516:4: ifElseChain: rewrite if-else to switch statement (gocritic)
if tt.expectedError && err == nil {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/objectmeta/coerce_test.go:131:6: singleCaseSwitch: found switch with default case only (gocritic)
switch {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/cel/model/types_test.go:86:2: commentFormatting: put a space between `//` and comment text (gocritic)
//rule := rt.ConvertToRule(testValue(t, 11, mapVal))
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/conversion/webhook_converter_test.go:261:4: ifElseChain: rewrite if-else to switch statement (gocritic)
if err == nil && len(tc.ExpectErr) > 0 {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/conversion/webhook_converter_test.go:480:4: ifElseChain: rewrite if-else to switch statement (gocritic)
if err == nil && len(tc.ExpectErr) > 0 {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/controller/finalizer/crd_finalizer.go:143:2: ifElseChain: rewrite if-else to switch statement (gocritic)
if OverlappingBuiltInResources()[schema.GroupResource{Group: crd.Spec.Group, Resource: crd.Spec.Names.Plural}] {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/cel/validation.go:244:4: ifElseChain: rewrite if-else to switch statement (gocritic)
if strings.HasPrefix(err.Error(), "no such overload") {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/cel/validation.go:263:6: ifElseChain: rewrite if-else to switch statement (gocritic)
if msgErr.Type == cel.ErrorTypeInternal {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/cel/validation.go:326:2: ifElseChain: rewrite if-else to switch statement (gocritic)
if len(trimmedMsgStr) > celconfig.MaxEvaluatedMessageExpressionSizeBytes {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/cel/celcoststability_test.go:925:5: commentFormatting: put a space between `//` and comment text (gocritic)
//"self.m['a'] == null",
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/cel/validation_test.go:1127:5: commentFormatting: put a space between `//` and comment text (gocritic)
//"self.m['a'] == null",
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/cel/validation_test.go:1131:5: commentFormatting: put a space between `//` and comment text (gocritic)
//"self.l[0] == null",
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/cel/validation_test.go:1135:5: commentFormatting: put a space between `//` and comment text (gocritic)
//"self.s[0] == null",
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/cel/validation_test.go:1142:5: commentFormatting: put a space between `//` and comment text (gocritic)
//"self.m['a'] == null": "found no matching overload for '_==_' applied to '(string, null)",
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/cel/validation_test.go:2519:5: commentFormatting: put a space between `//` and comment text (gocritic)
//found := false
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/validation/formats.go:59:16: wrapperFunc: use strings.ReplaceAll method in `strings.Replace(s.Format, "-", "", -1)` (gocritic)
normalized := strings.Replace(s.Format, "-", "", -1) // go-openapi default format name normalization
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/validation/validation_test.go:131:4: singleCaseSwitch: should rewrite switch statement to if statement (gocritic)
switch t := t.(type) {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/validation/validation.go:1056:14: elseif: can replace 'else {if cond {}}' with 'else if cond {}' (gocritic)
} else {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/validation/validation.go:1009:4: ifElseChain: rewrite if-else to switch statement (gocritic)
if len(trimmedRule) == 0 {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/validation/validation.go:1029:4: ifElseChain: rewrite if-else to switch statement (gocritic)
if err != nil {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/validation/validation.go:1103:2: ifElseChain: rewrite if-else to switch statement (gocritic)
if exceedFactor > 100.0 {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/validation/validation_test.go:9115:15: appendAssign: append result not assigned to the same slice (gocritic)
schemas := append(tt.schema, &apiextensions.JSONSchemaProps{Type: "string"}) // append a leaf type
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/validation/validation_test.go:9120:4: ifElseChain: rewrite if-else to switch statement (gocritic)
if tt.expectedMaxCardinality == nil && curCostInfo.MaxCardinality == nil {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/validation/validation_test.go:8794:32: wrapperFunc: use strings.ReplaceAll method in `strings.Replace(string(bs), `"default":null`, `"deleted":null`, -1)` (gocritic)
expected := strings.Contains(strings.Replace(string(bs), `"default":null`, `"deleted":null`, -1), `"default":`)
^
staging/src/k8s.io/apiextensions-apiserver/pkg/controller/openapi/builder/builder.go:295:4: assignOp: replace `sub = sub + " a"` with `sub += " a"` (gocritic)
sub = sub + " a"
^
staging/src/k8s.io/apiextensions-apiserver/pkg/registry/customresource/validator.go:154:2: ifElseChain: rewrite if-else to switch statement (gocritic)
if err != nil {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/registry/customresource/validator.go:175:2: ifElseChain: rewrite if-else to switch statement (gocritic)
if err != nil {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/customresource_discovery_controller.go:263:13: unslice: could simplify aggregatedApiResourcesForDiscovery[:] to aggregatedApiResourcesForDiscovery (gocritic)
sort.Slice(aggregatedApiResourcesForDiscovery[:], func(i, j int) bool {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/customresource_handler.go:1095:33: captLocal: `Delegate' should not be capitalized (gocritic)
func newUnstructuredObjectTyper(Delegate runtime.ObjectTyper) UnstructuredObjectTyper {
^
staging/src/k8s.io/apiextensions-apiserver/test/integration/conversion/conversion_test.go:818:2: ifElseChain: rewrite if-else to switch statement (gocritic)
if currentAPIVersion == "stable.example.com/v1beta2" && (desiredAPIVersion == "stable.example.com/v1alpha1" || desiredAPIVersion == "stable.example.com/v1beta1") {
^
staging/src/k8s.io/apiextensions-apiserver/test/integration/validation_test.go:2067:4: ifElseChain: rewrite if-else to switch statement (gocritic)
if len(tst.expectedCreateErrors) > 0 && err == nil {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/validation/validation.go:239:42: S1002: should omit comparison to bool constant, can be simplified to `!*spec.PreserveUnknownFields` (gosimple)
if spec.PreserveUnknownFields == nil || *spec.PreserveUnknownFields == false {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/validation/validation.go:252:49: S1002: should omit comparison to bool constant, can be simplified to `!*spec.PreserveUnknownFields` (gosimple)
} else if spec.PreserveUnknownFields == nil || *spec.PreserveUnknownFields == false {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/validation/validation.go:265:43: S1002: should omit comparison to bool constant, can be simplified to `*spec.PreserveUnknownFields` (gosimple)
if spec.PreserveUnknownFields == nil || *spec.PreserveUnknownFields == true {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/validation/validation.go:813:5: S1002: should omit comparison to bool constant, can be simplified to `schema.UniqueItems` (gosimple)
if schema.UniqueItems == true {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/validation/validation.go:828:7: S1002: should omit comparison to bool constant, can be simplified to `!schema.AdditionalProperties.Allows` (gosimple)
if schema.AdditionalProperties.Allows == false || schema.AdditionalProperties.Schema != nil {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/validation/validation.go:917:45: S1002: should omit comparison to bool constant, can be simplified to `!*schema.XPreserveUnknownFields` (gosimple)
if schema.XPreserveUnknownFields != nil && *schema.XPreserveUnknownFields == false {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/validation/validation.go:1154:7: S1002: should omit comparison to bool constant, can be simplified to `!isRequired[k]` (gosimple)
if isRequired[k] == false && obj.Default == nil {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/customresource_handler.go:658:6: S1002: should omit comparison to bool constant, can be simplified to `!crd.Spec.PreserveUnknownFields` (gosimple)
if crd.Spec.PreserveUnknownFields == false && err != nil {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/customresource_handler.go:664:6: S1002: should omit comparison to bool constant, can be simplified to `!crd.Spec.PreserveUnknownFields` (gosimple)
if crd.Spec.PreserveUnknownFields == false {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/defaulting/algorithm.go:26:33: S1002: should omit comparison to bool constant, can be simplified to `!s.Generic.Nullable` (gosimple)
return x == nil && s != nil && s.Generic.Nullable == false
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/defaulting/prunenulls.go:22:33: S1002: should omit comparison to bool constant, can be simplified to `!s.Generic.Nullable` (gosimple)
return x == nil && s != nil && s.Generic.Nullable == false && s.Default.Object == nil
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/validation/validation.go:69:22: S1039: unnecessary use of fmt.Sprintf (gosimple)
ret = append(ret, fmt.Sprintf(`must be spec.names.plural+"."+spec.group`))
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/validation/validation.go:705:99: S1039: unnecessary use of fmt.Sprintf (gosimple)
allErrs = append(allErrs, field.Invalid(fldPath.Child("openAPIV3Schema.type"), schema.Type, fmt.Sprintf(`only "object" is allowed as the type at the root of the schema if the status subresource is enabled`)))
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/validation/validation.go:719:89: S1039: unnecessary use of fmt.Sprintf (gosimple)
allErrs = append(allErrs, field.Forbidden(fldPath.Child("openAPIV3Schema.nullable"), fmt.Sprintf(`nullable cannot be true at the root`)))
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/validation/validation.go:759:22: S1039: unnecessary use of fmt.Sprintf (gosimple)
costErrorMsg := fmt.Sprintf("contributed to estimated rule cost total exceeding cost limit for entire OpenAPIv3 schema")
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/validation/validation.go:1107:12: S1039: unnecessary use of fmt.Sprintf (gosimple)
factor = fmt.Sprintf("more than 100x")
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/cel/validation.go:204:56: S1039: unnecessary use of fmt.Sprintf (gosimple)
errs = append(errs, field.Invalid(fldPath, sts.Type, fmt.Sprintf("validation failed due to running out of cost budget, no further validation rules will be run")))
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/cel/validation.go:236:59: S1039: unnecessary use of fmt.Sprintf (gosimple)
errs = append(errs, field.Invalid(fldPath, sts.Type, fmt.Sprintf("validation failed due to running out of cost budget, no further validation rules will be run")))
^
staging/src/k8s.io/apiextensions-apiserver/pkg/controller/nonstructuralschema/nonstructuralschema_controller.go:96:4: S1039: unnecessary use of fmt.Sprint (gosimple)
fmt.Sprint("must be false")))
^
staging/src/k8s.io/apiextensions-apiserver/pkg/controller/nonstructuralschema/nonstructuralschema_controller_test.go:55:6: S1039: unnecessary use of fmt.Sprint (gosimple)
fmt.Sprint("must be false")).Error(),
^
staging/src/k8s.io/apiextensions-apiserver/pkg/registry/customresource/etcd.go:341:39: S1039: unnecessary use of fmt.Sprintf (gosimple)
return nil, apierrors.NewBadRequest(fmt.Sprintf("nil update passed to Scale"))
^
staging/src/k8s.io/apiextensions-apiserver/test/integration/basic_test.go:977:11: S1039: unnecessary use of fmt.Sprintf (gosimple)
[]byte(fmt.Sprintf(`{"labels":{"test-label":"dummy"}}`)), metav1.PatchOptions{},
^
staging/src/k8s.io/apiextensions-apiserver/test/integration/yaml_test.go:311:22: S1039: unnecessary use of fmt.Sprintf (gosimple)
yamlBody := []byte(fmt.Sprintf(`
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/customresource_handler_test.go:820:8: S1004: should use !bytes.Equal(objBytes, expectedBytes) instead (gosimple)
if bytes.Compare(objBytes, expectedBytes) != 0 {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/objectmeta/algorithm.go:58:7: S1016: should convert opts (type CoerceOptions) to coercer instead of using struct literal (gosimple)
c := coercer{DropInvalidFields: opts.DropInvalidFields, ReturnUnknownFieldPaths: opts.ReturnUnknownFieldPaths}
^
staging/src/k8s.io/apiextensions-apiserver/test/integration/validation_test.go:1577:8: S1003: should use !strings.Contains(cond.Message, v) instead (gosimple)
if strings.Index(cond.Message, v) == -1 {
^
staging/src/k8s.io/apiextensions-apiserver/test/integration/validation_test.go:1582:8: S1003: should use strings.Contains(cond.Message, v) instead (gosimple)
if strings.Index(cond.Message, v) != -1 {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/controller/finalizer/crd_finalizer.go:204:23: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
deletedNamespaces := sets.String{}
^
staging/src/k8s.io/apiextensions-apiserver/pkg/controller/finalizer/crd_finalizer.go:235:8: SA1019: wait.PollImmediate is deprecated: This method does not return errors from context, use PollWithContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
err = wait.PollImmediate(5*time.Second, 1*time.Minute, func() (bool, error) {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/fuzzer/fuzzer.go:78:33: SA1019: pointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
obj.PreserveUnknownFields = pointer.BoolPtr(true)
^
staging/src/k8s.io/apiextensions-apiserver/pkg/cmd/server/testing/testserver.go:167:8: SA1019: wait.Poll is deprecated: This method does not return errors from context, use PollWithContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
err = wait.Poll(100*time.Millisecond, time.Minute, func() (bool, error) {
^
staging/src/k8s.io/apiextensions-apiserver/test/integration/fixtures/resources.go:50:28: SA1019: pointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
XPreserveUnknownFields: pointer.BoolPtr(true),
^
staging/src/k8s.io/apiextensions-apiserver/test/integration/fixtures/resources.go:350:10: SA1019: wait.PollImmediate is deprecated: This method does not return errors from context, use PollWithContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
err := wait.PollImmediate(500*time.Millisecond, 30*time.Second, func() (bool, error) {
^
staging/src/k8s.io/apiextensions-apiserver/test/integration/fixtures/resources.go:378:8: SA1019: wait.PollImmediate is deprecated: This method does not return errors from context, use PollWithContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
err = wait.PollImmediate(500*time.Millisecond, 30*time.Second, func() (bool, error) {
^
staging/src/k8s.io/apiextensions-apiserver/test/integration/fixtures/resources.go:399:10: SA1019: wait.PollImmediate is deprecated: This method does not return errors from context, use PollWithContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
err := wait.PollImmediate(500*time.Millisecond, 30*time.Second, func() (bool, error) {
^
staging/src/k8s.io/apiextensions-apiserver/test/integration/fixtures/resources.go:427:8: SA1019: wait.PollImmediate is deprecated: This method does not return errors from context, use PollWithContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
err = wait.PollImmediate(500*time.Millisecond, 30*time.Second, func() (bool, error) {
^
staging/src/k8s.io/apiextensions-apiserver/test/integration/fixtures/resources.go:521:10: SA1019: wait.PollImmediate is deprecated: This method does not return errors from context, use PollWithContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
err := wait.PollImmediate(500*time.Millisecond, 30*time.Second, func() (bool, error) {
^
staging/src/k8s.io/apiextensions-apiserver/test/integration/fixtures/resources.go:543:11: SA1019: wait.PollImmediate is deprecated: This method does not return errors from context, use PollWithContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
err := wait.PollImmediate(500*time.Millisecond, 30*time.Second, func() (bool, error) {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/defaults.go:59:14: SA1019: utilpointer.Int32Ptr is deprecated: Use Int32 instead. (staticcheck)
obj.Port = utilpointer.Int32Ptr(443)
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/conversion_test.go:88:29: SA1019: pointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
PreserveUnknownFields: pointer.BoolPtr(false),
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/conversion_test.go:104:29: SA1019: pointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
PreserveUnknownFields: pointer.BoolPtr(false),
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/conversion_test.go:126:29: SA1019: pointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
PreserveUnknownFields: pointer.BoolPtr(false),
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/conversion_test.go:187:29: SA1019: pointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
PreserveUnknownFields: pointer.BoolPtr(false),
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/conversion_test.go:209:29: SA1019: pointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
PreserveUnknownFields: pointer.BoolPtr(false),
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/conversion_test.go:270:29: SA1019: pointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
PreserveUnknownFields: pointer.BoolPtr(false),
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/conversion_test.go:292:29: SA1019: pointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
PreserveUnknownFields: pointer.BoolPtr(false),
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/conversion_test.go:353:32: SA1019: pointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
PreserveUnknownFields: pointer.BoolPtr(false),
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/conversion_test.go:375:29: SA1019: pointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
PreserveUnknownFields: pointer.BoolPtr(false),
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/conversion_test.go:399:68: SA1019: pointer.StringPtr is deprecated: Use String instead. (staticcheck)
WebhookClientConfig: &apiextensions.WebhookClientConfig{URL: pointer.StringPtr("http://example.com")},
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/conversion_test.go:408:48: SA1019: pointer.StringPtr is deprecated: Use String instead. (staticcheck)
ClientConfig: &WebhookClientConfig{URL: pointer.StringPtr("http://example.com")},
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/conversion_test.go:445:29: SA1019: pointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
PreserveUnknownFields: pointer.BoolPtr(false),
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/conversion_test.go:455:48: SA1019: pointer.StringPtr is deprecated: Use String instead. (staticcheck)
ClientConfig: &WebhookClientConfig{URL: pointer.StringPtr("http://example.com")},
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/conversion_test.go:464:68: SA1019: pointer.StringPtr is deprecated: Use String instead. (staticcheck)
WebhookClientConfig: &apiextensions.WebhookClientConfig{URL: pointer.StringPtr("http://example.com")},
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/conversion_test.go:466:29: SA1019: pointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
PreserveUnknownFields: pointer.BoolPtr(false),
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/conversion_test.go:487:29: SA1019: pointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
PreserveUnknownFields: pointer.BoolPtr(false),
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/defaults_test.go:68:42: SA1019: utilpointer.Int32Ptr is deprecated: Use Int32 instead. (staticcheck)
Service: &ServiceReference{Port: utilpointer.Int32Ptr(443)},
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/defaults.go:73:31: SA1019: utilpointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
obj.PreserveUnknownFields = utilpointer.BoolPtr(true)
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/defaults.go:80:14: SA1019: utilpointer.Int32Ptr is deprecated: Use Int32 instead. (staticcheck)
obj.Port = utilpointer.Int32Ptr(443)
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/defaults_test.go:44:29: SA1019: utilpointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
PreserveUnknownFields: utilpointer.BoolPtr(true),
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/defaults_test.go:59:29: SA1019: utilpointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
PreserveUnknownFields: utilpointer.BoolPtr(true),
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/defaults_test.go:69:41: SA1019: utilpointer.Int32Ptr is deprecated: Use Int32 instead. (staticcheck)
Service: &ServiceReference{Port: utilpointer.Int32Ptr(443)},
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/defaults_test.go:72:29: SA1019: utilpointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
PreserveUnknownFields: utilpointer.BoolPtr(true),
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/defaults_test.go:82:29: SA1019: utilpointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
PreserveUnknownFields: utilpointer.BoolPtr(true),
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/defaults_test.go:94:29: SA1019: utilpointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
PreserveUnknownFields: utilpointer.BoolPtr(true),
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/defaults_test.go:113:29: SA1019: utilpointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
PreserveUnknownFields: utilpointer.BoolPtr(true),
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/defaults_test.go:121:29: SA1019: utilpointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
PreserveUnknownFields: utilpointer.BoolPtr(true),
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/validation/validation_test.go:107:29: SA1019: pointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
PreserveUnknownFields: pointer.BoolPtr(false),
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/validation/validation_test.go:157:29: SA1019: pointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
PreserveUnknownFields: pointer.BoolPtr(false),
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/validation/validation_test.go:207:29: SA1019: pointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
PreserveUnknownFields: pointer.BoolPtr(false),
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/validation/validation_test.go:257:29: SA1019: pointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
PreserveUnknownFields: pointer.BoolPtr(false),
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/validation/validation_test.go:303:29: SA1019: pointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
PreserveUnknownFields: pointer.BoolPtr(false),
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/validation/validation_test.go:345:29: SA1019: pointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
PreserveUnknownFields: pointer.BoolPtr(false),
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/validation/validation_test.go:389:29: SA1019: pointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
PreserveUnknownFields: pointer.BoolPtr(false),
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/validation/validation_test.go:441:29: SA1019: pointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
PreserveUnknownFields: pointer.BoolPtr(false),
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/validation/validation_test.go:488:29: SA1019: pointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
PreserveUnknownFields: pointer.BoolPtr(false),
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/validation/validation_test.go:536:29: SA1019: pointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
PreserveUnknownFields: pointer.BoolPtr(false),
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/validation/validation_test.go:581:29: SA1019: pointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
PreserveUnknownFields: pointer.BoolPtr(false),
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/types_jsonschema.go:269:7: ST1006: receiver name should not be an underscore, omit the name if it is unused (stylecheck)
func (_ JSON) OpenAPISchemaFormat() string { return "" }
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/types_jsonschema.go:262:7: ST1006: receiver name should not be an underscore, omit the name if it is unused (stylecheck)
func (_ JSON) OpenAPISchemaType() []string {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/types_jsonschema.go:312:7: ST1006: receiver name should not be an underscore, omit the name if it is unused (stylecheck)
func (_ JSONSchemaPropsOrBool) OpenAPISchemaFormat() string { return "" }
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/types_jsonschema.go:305:7: ST1006: receiver name should not be an underscore, omit the name if it is unused (stylecheck)
func (_ JSONSchemaPropsOrBool) OpenAPISchemaType() []string {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/types_jsonschema.go:292:7: ST1006: receiver name should not be an underscore, omit the name if it is unused (stylecheck)
func (_ JSONSchemaPropsOrArray) OpenAPISchemaFormat() string { return "" }
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/types_jsonschema.go:285:7: ST1006: receiver name should not be an underscore, omit the name if it is unused (stylecheck)
func (_ JSONSchemaPropsOrArray) OpenAPISchemaType() []string {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/types_jsonschema.go:334:7: ST1006: receiver name should not be an underscore, omit the name if it is unused (stylecheck)
func (_ JSONSchemaPropsOrStringArray) OpenAPISchemaFormat() string { return "" }
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/types_jsonschema.go:327:7: ST1006: receiver name should not be an underscore, omit the name if it is unused (stylecheck)
func (_ JSONSchemaPropsOrStringArray) OpenAPISchemaType() []string {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/types_jsonschema.go:269:7: ST1006: receiver name should not be an underscore, omit the name if it is unused (stylecheck)
func (_ JSON) OpenAPISchemaFormat() string { return "" }
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/types_jsonschema.go:262:7: ST1006: receiver name should not be an underscore, omit the name if it is unused (stylecheck)
func (_ JSON) OpenAPISchemaType() []string {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/types_jsonschema.go:312:7: ST1006: receiver name should not be an underscore, omit the name if it is unused (stylecheck)
func (_ JSONSchemaPropsOrBool) OpenAPISchemaFormat() string { return "" }
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/types_jsonschema.go:305:7: ST1006: receiver name should not be an underscore, omit the name if it is unused (stylecheck)
func (_ JSONSchemaPropsOrBool) OpenAPISchemaType() []string {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/types_jsonschema.go:292:7: ST1006: receiver name should not be an underscore, omit the name if it is unused (stylecheck)
func (_ JSONSchemaPropsOrArray) OpenAPISchemaFormat() string { return "" }
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/types_jsonschema.go:285:7: ST1006: receiver name should not be an underscore, omit the name if it is unused (stylecheck)
func (_ JSONSchemaPropsOrArray) OpenAPISchemaType() []string {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/types_jsonschema.go:334:7: ST1006: receiver name should not be an underscore, omit the name if it is unused (stylecheck)
func (_ JSONSchemaPropsOrStringArray) OpenAPISchemaFormat() string { return "" }
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/types_jsonschema.go:327:7: ST1006: receiver name should not be an underscore, omit the name if it is unused (stylecheck)
func (_ JSONSchemaPropsOrStringArray) OpenAPISchemaType() []string {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/defaulting/validation.go:62:235: ST1008: error should be returned as the last argument (stylecheck)
func validate(ctx context.Context, pth *field.Path, s *structuralschema.Structural, rootSchema *structuralschema.Structural, f SurroundingObjectFunc, insideMeta, requirePrunedDefaults bool, costBudget int64) (allErrs field.ErrorList, error error, remainingCost int64) {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/conversion.go:29:6: ST1003: should not use underscores in Go names; func Convert_apiextensions_JSONSchemaProps_To_v1_JSONSchemaProps should be ConvertApiextensionsJSONSchemaPropsToV1JSONSchemaProps (stylecheck)
func Convert_apiextensions_JSONSchemaProps_To_v1_JSONSchemaProps(in *apiextensions.JSONSchemaProps, out *JSONSchemaProps, s conversion.Scope) error {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/conversion.go:44:6: ST1003: should not use underscores in Go names; func Convert_apiextensions_JSON_To_v1_JSON should be ConvertApiextensionsJSONToV1JSON (stylecheck)
func Convert_apiextensions_JSON_To_v1_JSON(in *apiextensions.JSON, out *JSON, s conversion.Scope) error {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/conversion.go:58:6: ST1003: should not use underscores in Go names; func Convert_v1_JSON_To_apiextensions_JSON should be ConvertV1JSONToApiextensionsJSON (stylecheck)
func Convert_v1_JSON_To_apiextensions_JSON(in *JSON, out *apiextensions.JSON, s conversion.Scope) error {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/conversion.go:73:6: ST1003: should not use underscores in Go names; func Convert_apiextensions_CustomResourceDefinitionSpec_To_v1_CustomResourceDefinitionSpec should be ConvertApiextensionsCustomResourceDefinitionSpecToV1CustomResourceDefinitionSpec (stylecheck)
func Convert_apiextensions_CustomResourceDefinitionSpec_To_v1_CustomResourceDefinitionSpec(in *apiextensions.CustomResourceDefinitionSpec, out *CustomResourceDefinitionSpec, s conversion.Scope) error {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/conversion.go:116:6: ST1003: should not use underscores in Go names; func Convert_v1_CustomResourceDefinitionSpec_To_apiextensions_CustomResourceDefinitionSpec should be ConvertV1CustomResourceDefinitionSpecToApiextensionsCustomResourceDefinitionSpec (stylecheck)
func Convert_v1_CustomResourceDefinitionSpec_To_apiextensions_CustomResourceDefinitionSpec(in *CustomResourceDefinitionSpec, out *apiextensions.CustomResourceDefinitionSpec, s conversion.Scope) error {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/conversion.go:174:6: ST1003: should not use underscores in Go names; func Convert_v1_CustomResourceConversion_To_apiextensions_CustomResourceConversion should be ConvertV1CustomResourceConversionToApiextensionsCustomResourceConversion (stylecheck)
func Convert_v1_CustomResourceConversion_To_apiextensions_CustomResourceConversion(in *CustomResourceConversion, out *apiextensions.CustomResourceConversion, s conversion.Scope) error {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/conversion.go:193:6: ST1003: should not use underscores in Go names; func Convert_apiextensions_CustomResourceConversion_To_v1_CustomResourceConversion should be ConvertApiextensionsCustomResourceConversionToV1CustomResourceConversion (stylecheck)
func Convert_apiextensions_CustomResourceConversion_To_v1_CustomResourceConversion(in *apiextensions.CustomResourceConversion, out *CustomResourceConversion, s conversion.Scope) error {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/conversion.go:212:6: ST1003: should not use underscores in Go names; func Convert_apiextensions_ValidationRules_To_v1_ValidationRules should be ConvertApiextensionsValidationRulesToV1ValidationRules (stylecheck)
func Convert_apiextensions_ValidationRules_To_v1_ValidationRules(in *apiextensions.ValidationRules, out *ValidationRules, s conversion.Scope) error {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/defaults.go:30:6: ST1003: should not use underscores in Go names; func SetDefaults_CustomResourceDefinition should be SetDefaultsCustomResourceDefinition (stylecheck)
func SetDefaults_CustomResourceDefinition(obj *CustomResourceDefinition) {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/defaults.go:42:6: ST1003: should not use underscores in Go names; func SetDefaults_CustomResourceDefinitionSpec should be SetDefaultsCustomResourceDefinitionSpec (stylecheck)
func SetDefaults_CustomResourceDefinitionSpec(obj *CustomResourceDefinitionSpec) {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/defaults.go:57:6: ST1003: should not use underscores in Go names; func SetDefaults_ServiceReference should be SetDefaultsServiceReference (stylecheck)
func SetDefaults_ServiceReference(obj *ServiceReference) {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/conversion.go:28:6: ST1003: should not use underscores in Go names; func Convert_apiextensions_JSONSchemaProps_To_v1beta1_JSONSchemaProps should be ConvertApiextensionsJSONSchemaPropsToV1beta1JSONSchemaProps (stylecheck)
func Convert_apiextensions_JSONSchemaProps_To_v1beta1_JSONSchemaProps(in *apiextensions.JSONSchemaProps, out *JSONSchemaProps, s conversion.Scope) error {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/conversion.go:43:6: ST1003: should not use underscores in Go names; func Convert_apiextensions_JSON_To_v1beta1_JSON should be ConvertApiextensionsJSONToV1beta1JSON (stylecheck)
func Convert_apiextensions_JSON_To_v1beta1_JSON(in *apiextensions.JSON, out *JSON, s conversion.Scope) error {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/conversion.go:57:6: ST1003: should not use underscores in Go names; func Convert_v1beta1_JSON_To_apiextensions_JSON should be ConvertV1beta1JSONToApiextensionsJSON (stylecheck)
func Convert_v1beta1_JSON_To_apiextensions_JSON(in *JSON, out *apiextensions.JSON, s conversion.Scope) error {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/defaults.go:30:6: ST1003: should not use underscores in Go names; func SetDefaults_CustomResourceDefinition should be SetDefaultsCustomResourceDefinition (stylecheck)
func SetDefaults_CustomResourceDefinition(obj *CustomResourceDefinition) {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/defaults.go:42:6: ST1003: should not use underscores in Go names; func SetDefaults_CustomResourceDefinitionSpec should be SetDefaultsCustomResourceDefinitionSpec (stylecheck)
func SetDefaults_CustomResourceDefinitionSpec(obj *CustomResourceDefinitionSpec) {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/defaults.go:78:6: ST1003: should not use underscores in Go names; func SetDefaults_ServiceReference should be SetDefaultsServiceReference (stylecheck)
func SetDefaults_ServiceReference(obj *ServiceReference) {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/customresource_discovery_controller.go:90:2: ST1003: var aggregatedApiResourcesForDiscovery should be aggregatedAPIResourcesForDiscovery (stylecheck)
aggregatedApiResourcesForDiscovery := []apidiscoveryv2beta1.APIResourceDiscovery{}
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/customresource_handler.go:509:22: ST1003: should not use underscores in Go names; method removeStorage_locked should be removeStorageLocked (stylecheck)
func (r *crdHandler) removeStorage_locked(uid types.UID) {
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/customresource_handler.go:1299:14: ST1003: var foundApiVersion should be foundAPIVersion (stylecheck)
apiVersion, foundApiVersion, err := unstructured.NestedString(u.UnstructuredContent(), "apiVersion")
^
staging/src/k8s.io/apiextensions-apiserver/pkg/controller/apiapproval/apiapproval_controller.go:228:27: ST1005: error strings should not be capitalized (stylecheck)
utilruntime.HandleError(fmt.Errorf("Couldn't get key for object %#v: %v", obj, err))
^
staging/src/k8s.io/apiextensions-apiserver/pkg/registry/customresourcedefinition/etcd.go:105:4: ST1005: error strings should not be capitalized (stylecheck)
fmt.Errorf("Precondition failed: UID in precondition: %v, UID in object meta: %v", *options.Preconditions.UID, crd.UID),
^
staging/src/k8s.io/apiextensions-apiserver/pkg/registry/customresourcedefinition/etcd.go:113:4: ST1005: error strings should not be capitalized (stylecheck)
fmt.Errorf("Precondition failed: ResourceVersion in precondition: %v, ResourceVersion in object meta: %v", *options.Preconditions.ResourceVersion, crd.ResourceVersion),
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/customresource_handler_test.go:161:22: ST1013: should use constant http.StatusServiceUnavailable instead of numeric literal 503 (stylecheck)
http.Error(w, "", 503)
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/customresource_handler_test.go:164:21: ST1013: should use constant http.StatusTeapot instead of numeric literal 418 (stylecheck)
http.Error(w, "", 418)
^
staging/src/k8s.io/apiextensions-apiserver/test/integration/conversion/webhook.go:116:56: ST1013: should use constant http.StatusUnprocessableEntity instead of numeric literal 422 (stylecheck)
http.Error(w, "Cannot handle v1 ConversionReview", 422)
^
staging/src/k8s.io/apiextensions-apiserver/test/integration/conversion/webhook.go:135:61: ST1013: should use constant http.StatusUnprocessableEntity instead of numeric literal 422 (stylecheck)
http.Error(w, "Cannot handle v1beta1 ConversionReview", 422)
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/customresource_handler.go:683:20: ST1023: should omit type managedfields.TypeConverter from declaration; it will be inferred from the right-hand side (stylecheck)
var typeConverter managedfields.TypeConverter = managedfields.NewDeducedTypeConverter()
^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/cel/validation.go:120:25: ST1023: should omit type func(*schema.Structural, interface{}, interface{}) interpreter.Activation from declaration; it will be inferred from the right-hand side (stylecheck)
var activationFactory func(*schema.Structural, interface{}, interface{}) interpreter.Activation = validationActivationWithoutOldSelf
^
staging/src/k8s.io/apiextensions-apiserver/test/integration/scope_test.go:86:25: ST1023: should omit type dynamic.ResourceInterface from declaration; it will be inferred from the right-hand side (stylecheck)
var otherScopeClient dynamic.ResourceInterface = dynamicClient.Resource(gvr).Namespace(ns)
^
running ( cd /nvme/gopath/src/k8s.io/kubernetes/staging/src/k8s.io/apimachinery; env LOGCHECK_CONFIG=/nvme/gopath/src/k8s.io/kubernetes/hack/logcheck.conf /nvme/gopath/src/k8s.io/kubernetes/_output/local/bin/golangci-lint run --config=/nvme/gopath/src/k8s.io/kubernetes/hack/golangci-strict.yaml --path-prefix staging/src/k8s.io/apimachinery ./... )
staging/src/k8s.io/apimachinery/pkg/conversion/converter.go:58:33: Error return value of `c.RegisterUntypedConversionFunc` is not checked (errcheck)
c.RegisterUntypedConversionFunc(
^
staging/src/k8s.io/apimachinery/pkg/conversion/converter_test.go:242:16: Error return value of `ext.AddUntyped` is not checked (errcheck)
ext.AddUntyped(
^
staging/src/k8s.io/apimachinery/pkg/util/runtime/runtime_test.go:150:10: Error return value of `io.Copy` is not checked (errcheck)
io.Copy(&buf, r)
^
staging/src/k8s.io/apimachinery/pkg/runtime/serializer/streaming/streaming_test.go:61:12: Error return value of `fw.Write` is not checked (errcheck)
fw.Write(frames[i])
^
staging/src/k8s.io/apimachinery/pkg/util/waitgroup/ratelimited_waitgroup.go:85:15: Error return value of `limiter.Wait` is not checked (errcheck)
limiter.Wait(wg.stopCtx)
^
staging/src/k8s.io/apimachinery/pkg/util/waitgroup/ratelimited_waitgroup_test.go:73:14: Error return value of `target.Add` is not checked (errcheck)
target.Add(1)
^
staging/src/k8s.io/apimachinery/pkg/util/waitgroup/ratelimited_waitgroup_test.go:87:15: Error return value of `target.Add` is not checked (errcheck)
target.Add(1)
^
staging/src/k8s.io/apimachinery/pkg/util/waitgroup/ratelimited_waitgroup_test.go:134:20: Error return value of `wait.PollImmediate` is not checked (errcheck)
wait.PollImmediate(500*time.Millisecond, wait.ForeverTestTimeout, func() (done bool, err error) {
^
staging/src/k8s.io/apimachinery/pkg/util/waitgroup/ratelimited_waitgroup_test.go:193:14: Error return value of `target.Add` is not checked (errcheck)
target.Add(1)
^
staging/src/k8s.io/apimachinery/pkg/util/waitgroup/ratelimited_waitgroup_test.go:229:14: Error return value of `target.Add` is not checked (errcheck)
target.Add(1)
^
staging/src/k8s.io/apimachinery/pkg/util/waitgroup/ratelimited_waitgroup_test.go:303:18: Error return value of `w.delegate.Wait` is not checked (errcheck)
w.delegate.Wait(ctx)
^
staging/src/k8s.io/apimachinery/pkg/util/waitgroup/waitgroup_test.go:28:9: Error return value of `wg1.Add` is not checked (errcheck)
wg1.Add(n)
^
staging/src/k8s.io/apimachinery/pkg/util/waitgroup/waitgroup_test.go:29:9: Error return value of `wg2.Add` is not checked (errcheck)
wg2.Add(n)
^
staging/src/k8s.io/apimachinery/pkg/util/waitgroup/waitgroup_test.go:54:8: Error return value of `wg.Add` is not checked (errcheck)
wg.Add(1)
^
staging/src/k8s.io/apimachinery/pkg/watch/mux_test.go:87:11: Error return value of `m.Action` is not checked (errcheck)
m.Action(item.Type, item.Object)
^
staging/src/k8s.io/apimachinery/pkg/watch/mux_test.go:141:10: Error return value of `m.Action` is not checked (errcheck)
m.Action(Added, &myType{})
^
staging/src/k8s.io/apimachinery/pkg/watch/mux_test.go:168:10: Error return value of `m.Action` is not checked (errcheck)
m.Action(event1.Type, event1.Object)
^
staging/src/k8s.io/apimachinery/pkg/watch/mux_test.go:170:10: Error return value of `m.Action` is not checked (errcheck)
m.Action(event2.Type, event2.Object)
^
staging/src/k8s.io/apimachinery/pkg/watch/mux_test.go:206:12: Error return value of `m.Action` is not checked (errcheck)
m.Action(event1.Type, event1.Object)
^
staging/src/k8s.io/apimachinery/pkg/api/resource/quantity_proto_test.go:40:14: Error return value of `q.MarshalTo` is not checked (errcheck)
q.MarshalTo(result)
^
staging/src/k8s.io/apimachinery/pkg/api/resource/quantity_proto_test.go:58:14: Error return value of `q.Unmarshal` is not checked (errcheck)
q.Unmarshal(result)
^
staging/src/k8s.io/apimachinery/pkg/api/resource/quantity_proto_test.go:80:19: Error return value of `inputQ.Unmarshal` is not checked (errcheck)
inputQ.Unmarshal(inputByteArray)
^
staging/src/k8s.io/apimachinery/pkg/api/resource/quantity_proto_test.go:98:19: Error return value of `inputQ.Unmarshal` is not checked (errcheck)
inputQ.Unmarshal(inputByteArray)
^
staging/src/k8s.io/apimachinery/pkg/api/resource/quantity_test.go:1059:15: Error return value of `q.MarshalJSON` is not checked (errcheck)
q.MarshalJSON()
^
staging/src/k8s.io/apimachinery/pkg/util/wait/wait_test.go:617:20: Error return value is not checked (errcheck)
waitForWithContext(ctx, func(ctx context.Context) <-chan struct{} {
^
staging/src/k8s.io/apimachinery/pkg/util/wait/wait_test.go:636:12: Error return value is not checked (errcheck)
PollUntil(time.Microsecond, ConditionFunc(func() (bool, error) {
^
staging/src/k8s.io/apimachinery/pkg/util/net/http_test.go:246:17: Error return value is not checked (errcheck)
TLSClientConfig(rt)
^
staging/src/k8s.io/apimachinery/pkg/runtime/serializer/versioning/versioning_test.go:374:10: Error return value of `c.Encode` is not checked (errcheck)
c.Encode(&testDecodable{}, ioutil.Discard)
^
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured/unstructured.go:154:16: Error return value is not checked (errcheck)
SetNestedField(u.Object, value, fields...)
^
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured/unstructured.go:161:22: Error return value is not checked (errcheck)
SetNestedStringSlice(u.Object, value, fields...)
^
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured/unstructured.go:168:16: Error return value is not checked (errcheck)
SetNestedSlice(u.Object, value, fields...)
^
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured/unstructured.go:175:20: Error return value is not checked (errcheck)
SetNestedStringMap(u.Object, value, fields...)
^
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured/unstructured.go:347:35: Error return value of `timestamp.UnmarshalQueryParameter` is not checked (errcheck)
timestamp.UnmarshalQueryParameter(getNestedString(u.Object, "metadata", "creationTimestamp"))
^
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured/unstructured.go:362:35: Error return value of `timestamp.UnmarshalQueryParameter` is not checked (errcheck)
timestamp.UnmarshalQueryParameter(getNestedString(u.Object, "metadata", "deletionTimestamp"))
^
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured/unstructured_list.go:209:16: Error return value is not checked (errcheck)
SetNestedField(u.Object, value, fields...)
^
staging/src/k8s.io/apimachinery/pkg/util/proxy/transport_test.go:342:14: Error return value of `gzw.Write` is not checked (errcheck)
gzw.Write([]byte(ept))
^
staging/src/k8s.io/apimachinery/pkg/util/proxy/transport_test.go:360:14: Error return value of `flw.Write` is not checked (errcheck)
flw.Write([]byte(ept))
^
staging/src/k8s.io/apimachinery/pkg/util/proxy/upgradeaware.go:391:30: Error return value of `backendConn.SetReadDeadline` is not checked (errcheck)
backendConn.SetReadDeadline(deadline)
^
staging/src/k8s.io/apimachinery/pkg/util/proxy/upgradeaware.go:392:39: Error return value of `requestHijackedConn.SetWriteDeadline` is not checked (errcheck)
requestHijackedConn.SetWriteDeadline(deadline)
^
staging/src/k8s.io/apimachinery/pkg/util/proxy/upgradeaware_test.go:114:9: Error return value of `w.Write` is not checked (errcheck)
w.Write([]byte(s.responseBody))
^
staging/src/k8s.io/apimachinery/pkg/util/proxy/upgradeaware_test.go:512:14: Error return value of `ws.Write` is not checked (errcheck)
ws.Write([]byte("you failed"))
^
staging/src/k8s.io/apimachinery/pkg/util/proxy/upgradeaware_test.go:517:12: Error return value of `ws.Read` is not checked (errcheck)
ws.Read(body)
^
staging/src/k8s.io/apimachinery/pkg/util/proxy/upgradeaware_test.go:518:13: Error return value of `ws.Write` is not checked (errcheck)
ws.Write([]byte("hello " + string(body)))
^
staging/src/k8s.io/apimachinery/pkg/util/proxy/upgradeaware_test.go:616:12: Error return value of `w.Write` is not checked (errcheck)
w.Write([]byte(`some data`))
^
staging/src/k8s.io/apimachinery/pkg/util/proxy/upgradeaware_test.go:651:24: Error return value of `conn.SetReadDeadline` is not checked (errcheck)
conn.SetReadDeadline(time.Now().Add(time.Second))
^
staging/src/k8s.io/apimachinery/pkg/util/proxy/upgradeaware_test.go:658:13: Error return value of `req.Write` is not checked (errcheck)
req.Write(conn)
^
staging/src/k8s.io/apimachinery/pkg/util/proxy/upgradeaware_test.go:771:12: Error return value of `w.Write` is not checked (errcheck)
w.Write(originalBody)
^
staging/src/k8s.io/apimachinery/pkg/util/proxy/upgradeaware_test.go:996:11: Error return value of `w.Write` is not checked (errcheck)
w.Write([]byte(successfulResponse))
^
staging/src/k8s.io/apimachinery/pkg/util/managedfields/internal/lastappliedupdater_test.go:151:33: Error return value of `unstructured.SetNestedField` is not checked (errcheck)
unstructured.SetNestedField(u.Object, "A", "data", unique)
^
staging/src/k8s.io/apimachinery/pkg/util/managedfields/internal/lastappliedupdater_test.go:180:33: Error return value of `unstructured.SetNestedField` is not checked (errcheck)
unstructured.SetNestedField(u.Object, "A", "data", unique)
^
staging/src/k8s.io/apimachinery/pkg/util/diff/diff.go:56:1: deprecatedComment: use `Deprecated: ` (note the casing) instead of `DEPRECATED: ` (gocritic)
// DEPRECATED: use github.com/google/go-cmp/cmp.Diff
^
staging/src/k8s.io/apimachinery/pkg/util/diff/diff.go:63:1: deprecatedComment: use `Deprecated: ` (note the casing) instead of `DEPRECATED: ` (gocritic)
// DEPRECATED: use github.com/google/go-cmp/cmp.Diff
^
staging/src/k8s.io/apimachinery/pkg/util/diff/diff.go:70:1: deprecatedComment: use `Deprecated: ` (note the casing) instead of `DEPRECATED: ` (gocritic)
// DEPRECATED: use github.com/google/go-cmp/cmp.Diff
^
staging/src/k8s.io/apimachinery/pkg/util/diff/diff.go:147:4: singleCaseSwitch: should rewrite switch statement to if statement (gocritic)
switch i := path.Last().(type) {
^
staging/src/k8s.io/apimachinery/pkg/util/duration/duration.go:69:2: ifElseChain: rewrite if-else to switch statement (gocritic)
if hours < 8 {
^
staging/src/k8s.io/apimachinery/pkg/util/errors/errors.go:192:10: elseif: can replace 'else {if cond {}}' with 'else if cond {}' (gocritic)
} else {
^
staging/src/k8s.io/apimachinery/pkg/util/intstr/intstr.go:197:8: wrapperFunc: use strings.ReplaceAll method in `strings.Replace(intOrStr.StrVal, "%", "", -1)` (gocritic)
s := strings.Replace(intOrStr.StrVal, "%", "", -1)
^
staging/src/k8s.io/apimachinery/pkg/conversion/helper_test.go:23:2: singleCaseSwitch: found switch with default case only (gocritic)
switch obj := simple.(type) {
^
staging/src/k8s.io/apimachinery/pkg/runtime/serializer/recognizer/recognizer.go:63:3: singleCaseSwitch: should rewrite switch statement to if statement (gocritic)
switch t := r.(type) {
^
staging/src/k8s.io/apimachinery/pkg/labels/selector_test.go:169:2: commentFormatting: put a space between `//` and comment text (gocritic)
//expectNoMatchDirect(t, Set{"foo": "=blah"}, labelset)
^
staging/src/k8s.io/apimachinery/pkg/labels/selector_test.go:206:3: commentFormatting: put a space between `//` and comment text (gocritic)
//Note that Lex returns the longest valid token found
^
staging/src/k8s.io/apimachinery/pkg/labels/selector_test.go:211:3: commentFormatting: put a space between `//` and comment text (gocritic)
//Non-"special" characters are considered part of an identifier
^
staging/src/k8s.io/apimachinery/pkg/labels/selector_test.go:463:35: commentFormatting: put a space between `//` and comment text (gocritic)
Key: strings.Repeat("a", 254), //breaks DNS rule that len(key) <= 253
^
staging/src/k8s.io/apimachinery/pkg/labels/selector_test.go:60:6: wrapperFunc: use strings.ReplaceAll method in `strings.Replace(test, " ", "", -1)` (gocritic)
if strings.Replace(test, " ", "", -1) != lq.String() {
^
staging/src/k8s.io/apimachinery/pkg/util/wait/wait_test.go:700:13: elseif: can replace 'else {if cond {}}' with 'else if cond {}' (gocritic)
} else {
^
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/validation/validation_test.go:71:10: elseif: can replace 'else {if cond {}}' with 'else if cond {}' (gocritic)
} else {
^
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/validation/validation_test.go:91:10: elseif: can replace 'else {if cond {}}' with 'else if cond {}' (gocritic)
} else {
^
staging/src/k8s.io/apimachinery/pkg/api/errors/errors.go:260:1: deprecatedComment: use `Deprecated: ` (note the casing) instead of `DEPRECATED: ` (gocritic)
// DEPRECATED: Please use NewResourceExpired instead.
^
staging/src/k8s.io/apimachinery/pkg/api/errors/errors.go:210:2: ifElseChain: rewrite if-else to switch statement (gocritic)
if qualifiedResource.Empty() {
^
staging/src/k8s.io/apimachinery/pkg/api/errors/errors.go:786:3: singleCaseSwitch: should rewrite switch statement to if statement (gocritic)
switch t.Status().Reason {
^
staging/src/k8s.io/apimachinery/pkg/runtime/serializer/json/json_test.go:480:3: commentFormatting: put a space between `//` and comment text (gocritic)
//gvk defaulting if kind not provided in data and defaultGVK use into's kind
^
staging/src/k8s.io/apimachinery/pkg/util/net/interface.go:114:3: commentFormatting: put a space between `//` and comment text (gocritic)
//ignore the headers in the route info
^
staging/src/k8s.io/apimachinery/pkg/util/net/interface_test.go:155:3: ifElseChain: rewrite if-else to switch statement (gocritic)
if err != nil {
^
staging/src/k8s.io/apimachinery/pkg/util/net/interface_test.go:197:3: ifElseChain: rewrite if-else to switch statement (gocritic)
if err != nil {
^
staging/src/k8s.io/apimachinery/pkg/util/net/interface_test.go:572:3: ifElseChain: rewrite if-else to switch statement (gocritic)
if err != nil {
^
staging/src/k8s.io/apimachinery/pkg/util/net/interface_test.go:599:3: ifElseChain: rewrite if-else to switch statement (gocritic)
if err != nil {
^
staging/src/k8s.io/apimachinery/pkg/util/net/interface_test.go:798:3: ifElseChain: rewrite if-else to switch statement (gocritic)
if err != nil {
^
staging/src/k8s.io/apimachinery/pkg/util/net/port_range_test.go:59:3: ifElseChain: rewrite if-else to switch statement (gocritic)
if err != nil && tc.success == true {
^
staging/src/k8s.io/apimachinery/pkg/api/resource/amount.go:234:3: assignOp: replace `exponent = exponent - 1` with `exponent--` (gocritic)
exponent = exponent - 1
^
staging/src/k8s.io/apimachinery/pkg/api/resource/amount.go:240:3: assignOp: replace `exponent = exponent - 2` with `exponent -= 2` (gocritic)
exponent = exponent - 2
^
staging/src/k8s.io/apimachinery/pkg/api/resource/math.go:280:4: assignOp: replace `result = result / 1024` with `result /= 1024` (gocritic)
result = result / 1024
^
staging/src/k8s.io/apimachinery/pkg/api/resource/math.go:274:4: assignOp: replace `result = result / 10` with `result /= 10` (gocritic)
result = result / 10
^
staging/src/k8s.io/apimachinery/pkg/api/resource/math.go:285:4: assignOp: replace `result = result / base` with `result /= base` (gocritic)
result = result / base
^
staging/src/k8s.io/apimachinery/pkg/api/resource/math.go:180:3: assignOp: replace `value = value / 10` with `value /= 10` (gocritic)
value = value / 10
^
staging/src/k8s.io/apimachinery/pkg/api/resource/quantity_test.go:1462:6: dupArg: suspicious method call with the same argument and receiver (gocritic)
if q.Cmp(q) != 0 {
^
staging/src/k8s.io/apimachinery/pkg/runtime/converter.go:308:5: singleCaseSwitch: should rewrite switch statement to if statement (gocritic)
switch dt.Kind() {
^
staging/src/k8s.io/apimachinery/pkg/runtime/converter.go:314:5: singleCaseSwitch: should rewrite switch statement to if statement (gocritic)
switch dt.Kind() {
^
staging/src/k8s.io/apimachinery/pkg/runtime/swagger_doc_generator.go:88:12: wrapperFunc: use strings.ReplaceAll method in `strings.Replace(postDoc, "\"", "\\\"", -1)` (gocritic)
postDoc = strings.Replace(postDoc, "\"", "\\\"", -1) // Escape "
^
staging/src/k8s.io/apimachinery/pkg/runtime/swagger_doc_generator.go:87:12: wrapperFunc: use strings.ReplaceAll method in `strings.Replace(postDoc, "\\\"", "\"", -1)` (gocritic)
postDoc = strings.Replace(postDoc, "\\\"", "\"", -1) // replace user's \" to "
^
staging/src/k8s.io/apimachinery/pkg/runtime/swagger_doc_generator.go:89:12: wrapperFunc: use strings.ReplaceAll method in `strings.Replace(postDoc, "\n", "\\n", -1)` (gocritic)
postDoc = strings.Replace(postDoc, "\n", "\\n", -1)
^
staging/src/k8s.io/apimachinery/pkg/runtime/swagger_doc_generator.go:90:12: wrapperFunc: use strings.ReplaceAll method in `strings.Replace(postDoc, "\t", "\\t", -1)` (gocritic)
postDoc = strings.Replace(postDoc, "\t", "\\t", -1)
^
staging/src/k8s.io/apimachinery/pkg/runtime/allocator_test.go:49:31: assignOp: replace `i = i / 10` with `i /= 10` (gocritic)
for i := initialSize; i > 0; i = i / 10 {
^
staging/src/k8s.io/apimachinery/pkg/apis/meta/fuzzer/fuzzer.go:62:14: commentFormatting: put a space between `//` and comment text (gocritic)
if true { //c.RandBool() {
^
staging/src/k8s.io/apimachinery/pkg/api/validation/objectmeta_test.go:481:10: elseif: can replace 'else {if cond {}}' with 'else if cond {}' (gocritic)
} else {
^
staging/src/k8s.io/apimachinery/pkg/util/proxy/transport.go:89:3: assignOp: replace `forwardedURI = forwardedURI + "/"` with `forwardedURI += "/"` (gocritic)
forwardedURI = forwardedURI + "/"
^
staging/src/k8s.io/apimachinery/pkg/util/proxy/upgradeaware.go:277:11: elseif: can replace 'else {if cond {}}' with 'else if cond {}' (gocritic)
} else {
^
staging/src/k8s.io/apimachinery/pkg/util/proxy/transport_test.go:279:16: wrapperFunc: use strings.ReplaceAll method in `strings.Replace(item.input, sourceURL.Host, serverURL.Host, -1)` (gocritic)
item.input = strings.Replace(item.input, sourceURL.Host, serverURL.Host, -1)
^
staging/src/k8s.io/apimachinery/pkg/util/proxy/transport_test.go:280:19: wrapperFunc: use strings.ReplaceAll method in `strings.Replace(item.redirect, sourceURL.Host, serverURL.Host, -1)` (gocritic)
item.redirect = strings.Replace(item.redirect, sourceURL.Host, serverURL.Host, -1)
^
staging/src/k8s.io/apimachinery/pkg/util/strategicpatch/patch.go:1458:11: appendAssign: append result not assigned to the same slice (gocritic)
both := append(original, patch...)
^
staging/src/k8s.io/apimachinery/pkg/util/strategicpatch/patch.go:446:3: ifElseChain: rewrite if-else to switch statement (gocritic)
if i >= len(left) && j < len(right) {
^
staging/src/k8s.io/apimachinery/pkg/util/validation/validation.go:101:2: S1017: should replace this if statement with an unconditional strings.TrimSuffix (gosimple)
if strings.HasSuffix(name, ".") {
^
staging/src/k8s.io/apimachinery/pkg/labels/selector.go:922:5: S1009: should omit nil check; len() for k8s.io/apimachinery/pkg/labels.Set is defined as zero (gosimple)
if ls == nil || len(ls) == 0 {
^
staging/src/k8s.io/apimachinery/pkg/labels/selector.go:944:5: S1009: should omit nil check; len() for k8s.io/apimachinery/pkg/labels.Set is defined as zero (gosimple)
if ls == nil || len(ls) == 0 {
^
staging/src/k8s.io/apimachinery/pkg/util/errors/errors_test.go:153:2: S1021: should merge variable declaration with assignment on next line (gosimple)
var agg Aggregate
^
staging/src/k8s.io/apimachinery/pkg/util/errors/errors_test.go:169:2: S1021: should merge variable declaration with assignment on next line (gosimple)
var agg Aggregate
^
staging/src/k8s.io/apimachinery/pkg/util/errors/errors_test.go:185:2: S1021: should merge variable declaration with assignment on next line (gosimple)
var agg Aggregate
^
staging/src/k8s.io/apimachinery/pkg/util/errors/errors_test.go:201:2: S1021: should merge variable declaration with assignment on next line (gosimple)
var agg Aggregate
^
staging/src/k8s.io/apimachinery/pkg/util/net/interface_test.go:320:2: S1021: should merge variable declaration with assignment on next line (gosimple)
var ifat []net.Addr
^
staging/src/k8s.io/apimachinery/pkg/util/net/interface_test.go:337:2: S1021: should merge variable declaration with assignment on next line (gosimple)
var ifat []net.Addr
^
staging/src/k8s.io/apimachinery/pkg/util/net/interface_test.go:354:2: S1021: should merge variable declaration with assignment on next line (gosimple)
var ifat []net.Addr
^
staging/src/k8s.io/apimachinery/pkg/util/net/interface_test.go:371:2: S1021: should merge variable declaration with assignment on next line (gosimple)
var ifat []net.Addr
^
staging/src/k8s.io/apimachinery/pkg/util/net/interface_test.go:415:2: S1021: should merge variable declaration with assignment on next line (gosimple)
var ifat []net.Addr
^
staging/src/k8s.io/apimachinery/pkg/util/net/interface_test.go:432:2: S1021: should merge variable declaration with assignment on next line (gosimple)
var ifat []net.Addr
^
staging/src/k8s.io/apimachinery/pkg/util/net/interface_test.go:449:2: S1021: should merge variable declaration with assignment on next line (gosimple)
var ifat []net.Addr
^
staging/src/k8s.io/apimachinery/pkg/util/net/interface_test.go:544:2: S1021: should merge variable declaration with assignment on next line (gosimple)
var ifat []net.Addr
^
staging/src/k8s.io/apimachinery/pkg/util/strategicpatch/patch.go:443:27: S1019: should use make([]interface{}, size) instead (gosimple)
s := make([]interface{}, size, size)
^
staging/src/k8s.io/apimachinery/pkg/version/helpers.go:34:24: S1007: should use raw string (`...`) with regexp.MustCompile to avoid having to escape twice (gosimple)
var kubeVersionRegex = regexp.MustCompile("^v([\\d]+)(?:(alpha|beta)([\\d]+))?$")
^
staging/src/k8s.io/apimachinery/pkg/runtime/serializer/json/json_test.go:76:2: S1023: redundant `return` statement (gosimple)
return
^
staging/src/k8s.io/apimachinery/pkg/runtime/serializer/json/json_test.go:109:2: S1023: redundant `return` statement (gosimple)
return
^
staging/src/k8s.io/apimachinery/pkg/api/apitesting/naming/naming.go:38:70: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
func VerifyGroupNames(scheme *runtime.Scheme, legacyUnsuffixedGroups sets.String) error {
^
staging/src/k8s.io/apimachinery/pkg/apis/meta/fuzzer/fuzzer.go:226:4: SA1019: j.SelfLink is deprecated: selfLink is a legacy read-only field that is no longer populated by the system. +optional (staticcheck)
j.SelfLink = c.RandString()
^
staging/src/k8s.io/apimachinery/pkg/api/apitesting/roundtrip/compatibility.go:232:111: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
func (c *CompatibilityTestOptions) runCurrentVersionTest(t *testing.T, gvk schema.GroupVersionKind, usedFiles sets.String) {
^
staging/src/k8s.io/apimachinery/pkg/api/apitesting/roundtrip/compatibility.go:334:77: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
func read(dir string, gvk schema.GroupVersionKind, suffix string, usedFiles sets.String) (json, yaml, proto []byte, err error) {
^
staging/src/k8s.io/apimachinery/pkg/api/apitesting/roundtrip/compatibility.go:373:139: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
func (c *CompatibilityTestOptions) runPreviousVersionTest(t *testing.T, gvk schema.GroupVersionKind, previousVersionDir string, usedFiles sets.String) {
^
staging/src/k8s.io/apimachinery/pkg/api/apitesting/roundtrip/roundtrip.go:119:37: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
func GlobalNonRoundTrippableTypes() sets.String {
^
staging/src/k8s.io/apimachinery/pkg/api/apitesting/roundtrip/roundtrip.go:223:9: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
ret := sets.String{}
^
staging/src/k8s.io/apimachinery/pkg/api/apitesting/roundtrip/compatibility.go:22:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
staging/src/k8s.io/apimachinery/pkg/api/meta/testrestmapper/test_restmapper.go:58:21: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
remainingGroups := sets.String{}
^
staging/src/k8s.io/apimachinery/pkg/util/strategicpatch/testing/openapi.go:20:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured/helpers_test.go:20:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/validation/validation.go:119:5: SA1019: options.OrphanDependents is deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the "orphan" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. +optional (staticcheck)
if options.OrphanDependents != nil && options.PropagationPolicy != nil {
^
staging/src/k8s.io/apimachinery/pkg/labels/selector.go:280:32: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
func (r *Requirement) Values() sets.String {
^
staging/src/k8s.io/apimachinery/pkg/labels/selector.go:281:9: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
ret := sets.String{}
^
staging/src/k8s.io/apimachinery/pkg/labels/selector.go:700:13: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
var values sets.String
^
staging/src/k8s.io/apimachinery/pkg/labels/selector.go:766:33: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
func (p *Parser) parseValues() (sets.String, error) {
^
staging/src/k8s.io/apimachinery/pkg/labels/selector.go:792:42: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
func (p *Parser) parseIdentifiersList() (sets.String, error) {
^
staging/src/k8s.io/apimachinery/pkg/labels/selector.go:828:37: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
func (p *Parser) parseExactValue() (sets.String, error) {
^
staging/src/k8s.io/apimachinery/pkg/labels/selector_test.go:339:11: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
Vals sets.String
^
staging/src/k8s.io/apimachinery/pkg/labels/selector_test.go:713:61: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
func getRequirement(key string, op selection.Operator, vals sets.String, t *testing.T) Requirement {
^
staging/src/k8s.io/apimachinery/pkg/runtime/scheme.go:573:12: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
groups := sets.String{}
^
staging/src/k8s.io/apimachinery/pkg/runtime/serializer/encoder_with_allocator_test.go:21:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
staging/src/k8s.io/apimachinery/pkg/runtime/serializer/streaming/streaming_test.go:22:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
staging/src/k8s.io/apimachinery/pkg/runtime/serializer/versioning/versioning_test.go:22:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
staging/src/k8s.io/apimachinery/pkg/runtime/serializer/versioning/versioning_unstructured_test.go:21:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
staging/src/k8s.io/apimachinery/pkg/test/api_meta_meta_test.go:126:27: SA1019: j.SelfLink is deprecated: selfLink is a legacy read-only field that is no longer populated by the system. +optional (staticcheck)
if e, a := "google.com", j.SelfLink; e != a {
^
staging/src/k8s.io/apimachinery/pkg/util/framer/framer_test.go:22:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
staging/src/k8s.io/apimachinery/pkg/util/httpstream/spdy/roundtripper.go:26:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
staging/src/k8s.io/apimachinery/pkg/util/managedfields/fieldmanager_test.go:22:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
staging/src/k8s.io/apimachinery/pkg/util/managedfields/internal/versionconverter_test.go:22:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
staging/src/k8s.io/apimachinery/pkg/util/managedfields/internal/fieldmanager_test.go:21:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
staging/src/k8s.io/apimachinery/pkg/util/net/http.go:117:29: SA1019: t.Dial has been deprecated since Go 1.7: Use DialContext instead, which allows the transport to cancel dials as soon as they are no longer needed. If both are set, DialContext takes priority. (staticcheck)
if t.DialContext == nil && t.Dial == nil {
^
staging/src/k8s.io/apimachinery/pkg/util/net/http.go:226:6: SA1019: transport.Dial has been deprecated since Go 1.7: Use DialContext instead, which allows the transport to cancel dials as soon as they are no longer needed. If both are set, DialContext takes priority. (staticcheck)
if transport.Dial != nil {
^
staging/src/k8s.io/apimachinery/pkg/util/net/http.go:228:12: SA1019: transport.Dial has been deprecated since Go 1.7: Use DialContext instead, which allows the transport to cancel dials as soon as they are no longer needed. If both are set, DialContext takes priority. (staticcheck)
return transport.Dial(net, addr)
^
staging/src/k8s.io/apimachinery/pkg/util/net/interface_test.go:21:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
staging/src/k8s.io/apimachinery/pkg/util/proxy/transport.go:44:34: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
var atomsToAttrs = map[atom.Atom]sets.String{
^
staging/src/k8s.io/apimachinery/pkg/util/proxy/transport.go:25:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
staging/src/k8s.io/apimachinery/pkg/util/proxy/upgradeaware.go:24:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
staging/src/k8s.io/apimachinery/pkg/util/proxy/transport_test.go:24:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
staging/src/k8s.io/apimachinery/pkg/util/proxy/upgradeaware_test.go:29:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
staging/src/k8s.io/apimachinery/pkg/util/rand/rand_test.go:68:2: SA1019: rand.Seed has been deprecated since Go 1.20 and an alternative has been available since Go 1.0: Programs that call Seed and then expect a specific sequence of results from the global random source (using functions such as Int) can be broken when a dependency changes how much it consumes from the global random source. To avoid such breakages, programs that need a specific result sequence should use NewRand(NewSource(seed)) to obtain a random generator that other packages cannot access. (staticcheck)
rand.Seed(5)
^
staging/src/k8s.io/apimachinery/pkg/util/wait/wait_test.go:685:5: SA1019: rand.Seed has been deprecated since Go 1.20 and an alternative has been available since Go 1.0: Programs that call Seed and then expect a specific sequence of results from the global random source (using functions such as Int) can be broken when a dependency changes how much it consumes from the global random source. To avoid such breakages, programs that need a specific result sequence should use NewRand(NewSource(seed)) to obtain a random generator that other packages cannot access. (staticcheck)
rand.Seed(seed)
^
staging/src/k8s.io/apimachinery/pkg/util/yaml/decoder_test.go:25:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
staging/src/k8s.io/apimachinery/pkg/api/meta/help.go:72:24: ST1005: error strings should not be capitalized (stylecheck)
errExpectSliceItems = errors.New("Items field must be a slice of objects")
^
staging/src/k8s.io/apimachinery/pkg/util/managedfields/internal/pathelement.go:138:14: ST1005: error strings should not be capitalized (stylecheck)
return "", errors.New("Invalid type of path element")
^
staging/src/k8s.io/apimachinery/pkg/util/mergepatch/util.go:79:14: ST1005: error strings should not end with punctuation or newlines (stylecheck)
return "", fmt.Errorf("yaml marshal failed:%v\n%v\n", err, spew.Sdump(v))
^
staging/src/k8s.io/apimachinery/pkg/util/net/interface.go:318:15: ST1005: error strings should not end with punctuation or newlines (stylecheck)
return nil, fmt.Errorf("no interfaces found on host.")
^
staging/src/k8s.io/apimachinery/pkg/util/net/interface.go:460:14: ST1005: error strings should not end with punctuation or newlines (stylecheck)
return nil, fmt.Errorf("unable to select an IP from default routes.")
^
staging/src/k8s.io/apimachinery/pkg/util/strategicpatch/patch.go:682:21: ST1005: error strings should not be capitalized (stylecheck)
return nil, nil, fmt.Errorf("Unexpected returned value from compareListValuesAtIndex: %v and %v", originalV, modifiedV)
^
staging/src/k8s.io/apimachinery/pkg/util/strategicpatch/patch.go:968:15: ST1005: error strings should not end with punctuation or newlines (stylecheck)
return "", fmt.Errorf("fail to find unknown prefix %q in %s\n", prefix, s)
^
staging/src/k8s.io/apimachinery/pkg/util/strategicpatch/patch.go:1019:10: ST1005: error strings should not end with punctuation or newlines (stylecheck)
return fmt.Errorf("The order in patch list:\n%v\n doesn't match %s list:\n%v\n", typedPatchList, setElementOrderDirectivePrefix, setOrderList)
^
staging/src/k8s.io/apimachinery/pkg/util/wait/wait.go:28:1: ST1022: comment on exported var ForeverTestTimeout should be of the form "ForeverTestTimeout ..." (stylecheck)
// For any test of the style:
^
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1beta1/conversion.go:27:6: ST1003: should not use underscores in Go names; func Convert_Slice_string_To_v1beta1_IncludeObjectPolicy should be ConvertSliceStringToV1beta1IncludeObjectPolicy (stylecheck)
func Convert_Slice_string_To_v1beta1_IncludeObjectPolicy(in *[]string, out *IncludeObjectPolicy, s conversion.Scope) error {
^
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1beta1/conversion.go:35:6: ST1003: should not use underscores in Go names; func Convert_v1beta1_PartialObjectMetadataList_To_v1_PartialObjectMetadataList should be ConvertV1beta1PartialObjectMetadataListToV1PartialObjectMetadataList (stylecheck)
func Convert_v1beta1_PartialObjectMetadataList_To_v1_PartialObjectMetadataList(in *PartialObjectMetadataList, out *v1.PartialObjectMetadataList, s conversion.Scope) error {
^
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1beta1/conversion.go:42:6: ST1003: should not use underscores in Go names; func Convert_v1_PartialObjectMetadataList_To_v1beta1_PartialObjectMetadataList should be ConvertV1PartialObjectMetadataListToV1beta1PartialObjectMetadataList (stylecheck)
func Convert_v1_PartialObjectMetadataList_To_v1beta1_PartialObjectMetadataList(in *v1.PartialObjectMetadataList, out *PartialObjectMetadataList, s conversion.Scope) error {
^
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/conversion.go:33:6: ST1003: should not use underscores in Go names; func Convert_Pointer_float64_To_float64 should be ConvertPointerFloat64ToFloat64 (stylecheck)
func Convert_Pointer_float64_To_float64(in **float64, out *float64, s conversion.Scope) error {
^
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/conversion.go:42:6: ST1003: should not use underscores in Go names; func Convert_float64_To_Pointer_float64 should be ConvertFloat64ToPointerFloat64 (stylecheck)
func Convert_float64_To_Pointer_float64(in *float64, out **float64, s conversion.Scope) error {
^
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/conversion.go:48:6: ST1003: should not use underscores in Go names; func Convert_Pointer_int32_To_int32 should be ConvertPointerInt32ToInt32 (stylecheck)
func Convert_Pointer_int32_To_int32(in **int32, out *int32, s conversion.Scope) error {
^
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/conversion.go:57:6: ST1003: should not use underscores in Go names; func Convert_int32_To_Pointer_int32 should be ConvertInt32ToPointerInt32 (stylecheck)
func Convert_int32_To_Pointer_int32(in *int32, out **int32, s conversion.Scope) error {
^
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/conversion.go:63:6: ST1003: should not use underscores in Go names; func Convert_Pointer_int64_To_int64 should be ConvertPointerInt64ToInt64 (stylecheck)
func Convert_Pointer_int64_To_int64(in **int64, out *int64, s conversion.Scope) error {
^
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/conversion.go:72:6: ST1003: should not use underscores in Go names; func Convert_int64_To_Pointer_int64 should be ConvertInt64ToPointerInt64 (stylecheck)
func Convert_int64_To_Pointer_int64(in *int64, out **int64, s conversion.Scope) error {
^
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/conversion.go:78:6: ST1003: should not use underscores in Go names; func Convert_Pointer_int64_To_int should be ConvertPointerInt64ToInt (stylecheck)
func Convert_Pointer_int64_To_int(in **int64, out *int, s conversion.Scope) error {
^
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/conversion.go:87:6: ST1003: should not use underscores in Go names; func Convert_int_To_Pointer_int64 should be ConvertIntToPointerInt64 (stylecheck)
func Convert_int_To_Pointer_int64(in *int, out **int64, s conversion.Scope) error {
^
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/conversion.go:93:6: ST1003: should not use underscores in Go names; func Convert_Pointer_string_To_string should be ConvertPointerStringToString (stylecheck)
func Convert_Pointer_string_To_string(in **string, out *string, s conversion.Scope) error {
^
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/conversion.go:102:6: ST1003: should not use underscores in Go names; func Convert_string_To_Pointer_string should be ConvertStringToPointerString (stylecheck)
func Convert_string_To_Pointer_string(in *string, out **string, s conversion.Scope) error {
^
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/conversion.go:112:6: ST1003: should not use underscores in Go names; func Convert_Pointer_bool_To_bool should be ConvertPointerBoolToBool (stylecheck)
func Convert_Pointer_bool_To_bool(in **bool, out *bool, s conversion.Scope) error {
^
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/conversion.go:121:6: ST1003: should not use underscores in Go names; func Convert_bool_To_Pointer_bool should be ConvertBoolToPointerBool (stylecheck)
func Convert_bool_To_Pointer_bool(in *bool, out **bool, s conversion.Scope) error {
^
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/conversion.go:132:6: ST1003: should not use underscores in Go names; func Convert_v1_TypeMeta_To_v1_TypeMeta should be ConvertV1TypeMetaToV1TypeMeta (stylecheck)
func Convert_v1_TypeMeta_To_v1_TypeMeta(in, out *TypeMeta, s conversion.Scope) error {
^
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/conversion.go:140:6: ST1003: should not use underscores in Go names; func Convert_v1_ListMeta_To_v1_ListMeta should be ConvertV1ListMetaToV1ListMeta (stylecheck)
func Convert_v1_ListMeta_To_v1_ListMeta(in, out *ListMeta, s conversion.Scope) error {
^
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/conversion.go:146:6: ST1003: should not use underscores in Go names; func Convert_v1_DeleteOptions_To_v1_DeleteOptions should be ConvertV1DeleteOptionsToV1DeleteOptions (stylecheck)
func Convert_v1_DeleteOptions_To_v1_DeleteOptions(in, out *DeleteOptions, s conversion.Scope) error {
^
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/conversion.go:152:6: ST1003: should not use underscores in Go names; func Convert_intstr_IntOrString_To_intstr_IntOrString should be ConvertIntstrIntOrStringToIntstrIntOrString (stylecheck)
func Convert_intstr_IntOrString_To_intstr_IntOrString(in, out *intstr.IntOrString, s conversion.Scope) error {
^
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/conversion.go:157:6: ST1003: should not use underscores in Go names; func Convert_Pointer_intstr_IntOrString_To_intstr_IntOrString should be ConvertPointerIntstrIntOrStringToIntstrIntOrString (stylecheck)
func Convert_Pointer_intstr_IntOrString_To_intstr_IntOrString(in **intstr.IntOrString, out *intstr.IntOrString, s conversion.Scope) error {
^
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/conversion.go:166:6: ST1003: should not use underscores in Go names; func Convert_intstr_IntOrString_To_Pointer_intstr_IntOrString should be ConvertIntstrIntOrStringToPointerIntstrIntOrString (stylecheck)
func Convert_intstr_IntOrString_To_Pointer_intstr_IntOrString(in *intstr.IntOrString, out **intstr.IntOrString, s conversion.Scope) error {
^
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/conversion.go:173:6: ST1003: should not use underscores in Go names; func Convert_v1_Time_To_v1_Time should be ConvertV1TimeToV1Time (stylecheck)
func Convert_v1_Time_To_v1_Time(in *Time, out *Time, s conversion.Scope) error {
^
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/conversion.go:180:6: ST1003: should not use underscores in Go names; func Convert_v1_MicroTime_To_v1_MicroTime should be ConvertV1MicroTimeToV1MicroTime (stylecheck)
func Convert_v1_MicroTime_To_v1_MicroTime(in *MicroTime, out *MicroTime, s conversion.Scope) error {
^
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/conversion.go:186:6: ST1003: should not use underscores in Go names; func Convert_Pointer_v1_Duration_To_v1_Duration should be ConvertPointerV1DurationToV1Duration (stylecheck)
func Convert_Pointer_v1_Duration_To_v1_Duration(in **Duration, out *Duration, s conversion.Scope) error {
^
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/conversion.go:195:6: ST1003: should not use underscores in Go names; func Convert_v1_Duration_To_Pointer_v1_Duration should be ConvertV1DurationToPointerV1Duration (stylecheck)
func Convert_v1_Duration_To_Pointer_v1_Duration(in *Duration, out **Duration, s conversion.Scope) error {
^
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/conversion.go:202:6: ST1003: should not use underscores in Go names; func Convert_Slice_string_To_v1_Time should be ConvertSliceStringToV1Time (stylecheck)
func Convert_Slice_string_To_v1_Time(in *[]string, out *Time, s conversion.Scope) error {
^
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/conversion.go:210:6: ST1003: should not use underscores in Go names; func Convert_Slice_string_To_Pointer_v1_Time should be ConvertSliceStringToPointerV1Time (stylecheck)
func Convert_Slice_string_To_Pointer_v1_Time(in *[]string, out **Time, s conversion.Scope) error {
^
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/conversion.go:226:6: ST1003: should not use underscores in Go names; func Convert_string_To_labels_Selector should be ConvertStringToLabelsSelector (stylecheck)
func Convert_string_To_labels_Selector(in *string, out *labels.Selector, s conversion.Scope) error {
^
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/conversion.go:235:6: ST1003: should not use underscores in Go names; func Convert_string_To_fields_Selector should be ConvertStringToFieldsSelector (stylecheck)
func Convert_string_To_fields_Selector(in *string, out *fields.Selector, s conversion.Scope) error {
^
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/conversion.go:244:6: ST1003: should not use underscores in Go names; func Convert_labels_Selector_To_string should be ConvertLabelsSelectorToString (stylecheck)
func Convert_labels_Selector_To_string(in *labels.Selector, out *string, s conversion.Scope) error {
^
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/conversion.go:252:6: ST1003: should not use underscores in Go names; func Convert_fields_Selector_To_string should be ConvertFieldsSelectorToString (stylecheck)
func Convert_fields_Selector_To_string(in *fields.Selector, out *string, s conversion.Scope) error {
^
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/conversion.go:261:6: ST1003: should not use underscores in Go names; func Convert_resource_Quantity_To_resource_Quantity should be ConvertResourceQuantityToResourceQuantity (stylecheck)
func Convert_resource_Quantity_To_resource_Quantity(in *resource.Quantity, out *resource.Quantity, s conversion.Scope) error {
^
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/conversion.go:266:6: ST1003: should not use underscores in Go names; func Convert_Map_string_To_string_To_v1_LabelSelector should be ConvertMapStringToStringToV1LabelSelector (stylecheck)
func Convert_Map_string_To_string_To_v1_LabelSelector(in *map[string]string, out *LabelSelector, s conversion.Scope) error {
^
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/conversion.go:276:6: ST1003: should not use underscores in Go names; func Convert_v1_LabelSelector_To_Map_string_To_string should be ConvertV1LabelSelectorToMapStringToString (stylecheck)
func Convert_v1_LabelSelector_To_Map_string_To_string(in *LabelSelector, out *map[string]string, s conversion.Scope) error {
^
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/conversion.go:285:6: ST1003: should not use underscores in Go names; func Convert_Slice_string_To_Slice_int32 should be ConvertSliceStringToSliceInt32 (stylecheck)
func Convert_Slice_string_To_Slice_int32(in *[]string, out *[]int32, s conversion.Scope) error {
^
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/conversion.go:299:6: ST1003: should not use underscores in Go names; func Convert_Slice_string_To_Pointer_v1_DeletionPropagation should be ConvertSliceStringToPointerV1DeletionPropagation (stylecheck)
func Convert_Slice_string_To_Pointer_v1_DeletionPropagation(in *[]string, out **DeletionPropagation, s conversion.Scope) error {
^
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/conversion.go:312:6: ST1003: should not use underscores in Go names; func Convert_Slice_string_To_v1_IncludeObjectPolicy should be ConvertSliceStringToV1IncludeObjectPolicy (stylecheck)
func Convert_Slice_string_To_v1_IncludeObjectPolicy(in *[]string, out *IncludeObjectPolicy, s conversion.Scope) error {
^
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/conversion.go:320:6: ST1003: should not use underscores in Go names; func Convert_url_Values_To_v1_DeleteOptions should be ConvertURLValuesToV1DeleteOptions (stylecheck)
func Convert_url_Values_To_v1_DeleteOptions(in *url.Values, out *DeleteOptions, s conversion.Scope) error {
^
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/conversion.go:350:6: ST1003: should not use underscores in Go names; func Convert_Slice_string_To_v1_ResourceVersionMatch should be ConvertSliceStringToV1ResourceVersionMatch (stylecheck)
func Convert_Slice_string_To_v1_ResourceVersionMatch(in *[]string, out *ResourceVersionMatch, s conversion.Scope) error {
^
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/watch.go:42:6: ST1003: should not use underscores in Go names; func Convert_watch_Event_To_v1_WatchEvent should be ConvertWatchEventToV1WatchEvent (stylecheck)
func Convert_watch_Event_To_v1_WatchEvent(in *watch.Event, out *WatchEvent, s conversion.Scope) error {
^
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/watch.go:55:6: ST1003: should not use underscores in Go names; func Convert_v1_InternalEvent_To_v1_WatchEvent should be ConvertV1InternalEventToV1WatchEvent (stylecheck)
func Convert_v1_InternalEvent_To_v1_WatchEvent(in *InternalEvent, out *WatchEvent, s conversion.Scope) error {
^
running ( cd /nvme/gopath/src/k8s.io/kubernetes/staging/src/k8s.io/apiserver; env LOGCHECK_CONFIG=/nvme/gopath/src/k8s.io/kubernetes/hack/logcheck.conf /nvme/gopath/src/k8s.io/kubernetes/_output/local/bin/golangci-lint run --config=/nvme/gopath/src/k8s.io/kubernetes/hack/golangci-strict.yaml --path-prefix staging/src/k8s.io/apiserver ./... )
staging/src/k8s.io/apiserver/pkg/util/wsstream/conn.go:228:22: Error return value of `conn.ws.SetDeadline` is not checked (errcheck)
conn.ws.SetDeadline(time.Now().Add(conn.timeout))
^
staging/src/k8s.io/apiserver/pkg/util/wsstream/conn_test.go:43:12: Error return value of `conn.Open` is not checked (errcheck)
conn.Open(w, req)
^
staging/src/k8s.io/apiserver/pkg/util/wsstream/conn_test.go:123:12: Error return value of `conn.Open` is not checked (errcheck)
conn.Open(w, req)
^
staging/src/k8s.io/apiserver/pkg/util/wsstream/stream.go:138:17: Error return value of `ws.SetDeadline` is not checked (errcheck)
ws.SetDeadline(time.Now().Add(timeout))
^
staging/src/k8s.io/apiserver/pkg/util/wsstream/stream_test.go:172:73: Error return value is not checked (errcheck)
r.handleCrash = func(additionalHandlers ...func(interface{})) { recover() }
^
staging/src/k8s.io/apiserver/pkg/server/mux/pathrecorder_test.go:111:10: Error return value of `http.Get` is not checked (errcheck)
http.Get(s.URL + "/publicPrefix/")
^
staging/src/k8s.io/apiserver/pkg/server/mux/pathrecorder_test.go:113:10: Error return value of `http.Get` is not checked (errcheck)
http.Get(s.URL + "/publicPrefix/something")
^
staging/src/k8s.io/apiserver/pkg/server/mux/pathrecorder_test.go:115:10: Error return value of `http.Get` is not checked (errcheck)
http.Get(s.URL + "/publicPrefix/but-more-precise")
^
staging/src/k8s.io/apiserver/pkg/server/mux/pathrecorder_test.go:117:10: Error return value of `http.Get` is not checked (errcheck)
http.Get(s.URL + "/publicPrefix/but-more-precise/")
^
staging/src/k8s.io/apiserver/pkg/server/mux/pathrecorder_test.go:119:10: Error return value of `http.Get` is not checked (errcheck)
http.Get(s.URL + "/publicPrefix/but-more-precise/more-stuff")
^
staging/src/k8s.io/apiserver/pkg/server/mux/pathrecorder_test.go:122:10: Error return value of `http.Get` is not checked (errcheck)
http.Get(s.URL + "/publicPrefix/exactmatch")
^
staging/src/k8s.io/apiserver/pkg/server/mux/pathrecorder_test.go:124:10: Error return value of `http.Get` is not checked (errcheck)
http.Get(s.URL + "/publicPrefix/exactmatch/")
^
staging/src/k8s.io/apiserver/pkg/server/mux/pathrecorder_test.go:126:10: Error return value of `http.Get` is not checked (errcheck)
http.Get(s.URL + "/otherPublic/exactmatchslash")
^
staging/src/k8s.io/apiserver/pkg/server/mux/pathrecorder_test.go:128:10: Error return value of `http.Get` is not checked (errcheck)
http.Get(s.URL + "/otherPublic/exactmatchslash/")
^
staging/src/k8s.io/apiserver/pkg/server/mux/pathrecorder_test.go:131:10: Error return value of `http.Get` is not checked (errcheck)
http.Get(s.URL + "/secretPrefix/")
^
staging/src/k8s.io/apiserver/pkg/server/mux/pathrecorder_test.go:133:10: Error return value of `http.Get` is not checked (errcheck)
http.Get(s.URL + "/secretPrefix/something")
^
staging/src/k8s.io/apiserver/pkg/storage/etcd3/metrics/metrics_test.go:30:19: Error return value of `registry.Register` is not checked (errcheck)
registry.Register(decodeErrorCounts)
^
staging/src/k8s.io/apiserver/pkg/storage/value/metrics_test.go:107:32: Error return value of `tt.prefix.TransformToStorage` is not checked (errcheck)
tt.prefix.TransformToStorage(context.Background(), []byte("value"), nil)
^
staging/src/k8s.io/apiserver/pkg/storage/value/metrics_test.go:108:34: Error return value of `tt.prefix.TransformFromStorage` is not checked (errcheck)
tt.prefix.TransformFromStorage(context.Background(), []byte("k8s:enc:kms:v1:value"), nil)
^
staging/src/k8s.io/apiserver/pkg/storage/value/transformer_test.go:187:34: Error return value of `tc.prefix.TransformFromStorage` is not checked (errcheck)
tc.prefix.TransformFromStorage(context.Background(), tc.input, nil)
^
staging/src/k8s.io/apiserver/pkg/storage/value/transformer_test.go:245:32: Error return value of `tc.prefix.TransformToStorage` is not checked (errcheck)
tc.prefix.TransformToStorage(context.Background(), tc.input, nil)
^
staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/testing/v1beta1/kms_plugin_mock.go:110:23: Error return value of `s.grpcServer.Serve` is not checked (errcheck)
go s.grpcServer.Serve(s.listener)
^
staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/testing/v2/kms_plugin_mock.go:131:23: Error return value of `s.grpcServer.Serve` is not checked (errcheck)
go s.grpcServer.Serve(s.listener)
^
staging/src/k8s.io/apiserver/pkg/storage/etcd3/testserver/test_server.go:77:10: Error return value of `os.Chmod` is not checked (errcheck)
os.Chmod(cfg.Dir, 0700)
^
staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/kmsv2/envelope_test.go:810:10: Error return value of `flag.Set` is not checked (errcheck)
flag.Set("v", "6")
^
staging/src/k8s.io/apiserver/pkg/server/egressselector/egress_selector_test.go:273:10: Error return value is not checked (errcheck)
dialer(context.TODO(), "", "")
^
staging/src/k8s.io/apiserver/pkg/admission/attributes_test.go:30:20: Error return value of `attr.AddAnnotation` is not checked (errcheck)
attr.AddAnnotation("foo.admission.k8s.io/key1", "value1")
^
staging/src/k8s.io/apiserver/pkg/admission/attributes_test.go:31:20: Error return value of `attr.AddAnnotation` is not checked (errcheck)
attr.AddAnnotation("foo.admission.k8s.io/key2", "value2")
^
staging/src/k8s.io/apiserver/pkg/admission/audit_test.go:53:18: Error return value of `a.AddAnnotation` is not checked (errcheck)
a.AddAnnotation(k, v)
^
staging/src/k8s.io/apiserver/pkg/admission/audit_test.go:60:18: Error return value of `a.AddAnnotation` is not checked (errcheck)
a.AddAnnotation(k, v)
^
staging/src/k8s.io/apiserver/pkg/server/httplog/httplog_test.go:153:14: Error return value of `logger.Write` is not checked (errcheck)
logger.Write(nil)
^
staging/src/k8s.io/apiserver/pkg/server/httplog/httplog_test.go:162:14: Error return value of `logger.Write` is not checked (errcheck)
logger.Write(nil)
^
staging/src/k8s.io/apiserver/pkg/authentication/token/cache/cached_token_authenticator_test.go:63:21: Error return value of `a.AuthenticateToken` is not checked (errcheck)
a.AuthenticateToken(context.Background(), "bad1")
^
staging/src/k8s.io/apiserver/pkg/authentication/token/cache/cached_token_authenticator_test.go:64:21: Error return value of `a.AuthenticateToken` is not checked (errcheck)
a.AuthenticateToken(context.Background(), "bad2")
^
staging/src/k8s.io/apiserver/pkg/authentication/token/cache/cached_token_authenticator_test.go:65:21: Error return value of `a.AuthenticateToken` is not checked (errcheck)
a.AuthenticateToken(context.Background(), "bad3")
^
staging/src/k8s.io/apiserver/pkg/authentication/token/cache/cached_token_authenticator_test.go:67:21: Error return value of `a.AuthenticateToken` is not checked (errcheck)
a.AuthenticateToken(context.Background(), "bad1")
^
staging/src/k8s.io/apiserver/pkg/authentication/token/cache/cached_token_authenticator_test.go:68:21: Error return value of `a.AuthenticateToken` is not checked (errcheck)
a.AuthenticateToken(context.Background(), "bad2")
^
staging/src/k8s.io/apiserver/pkg/authentication/token/cache/cached_token_authenticator_test.go:69:21: Error return value of `a.AuthenticateToken` is not checked (errcheck)
a.AuthenticateToken(context.Background(), "bad3")
^
staging/src/k8s.io/apiserver/pkg/authentication/token/cache/cached_token_authenticator_test.go:118:21: Error return value of `a.AuthenticateToken` is not checked (errcheck)
a.AuthenticateToken(context.Background(), "usertoken1")
^
staging/src/k8s.io/apiserver/pkg/authentication/token/cache/cached_token_authenticator_test.go:119:21: Error return value of `a.AuthenticateToken` is not checked (errcheck)
a.AuthenticateToken(context.Background(), "usertoken2")
^
staging/src/k8s.io/apiserver/pkg/authentication/token/cache/cached_token_authenticator_test.go:120:21: Error return value of `a.AuthenticateToken` is not checked (errcheck)
a.AuthenticateToken(context.Background(), "usertoken3")
^
staging/src/k8s.io/apiserver/pkg/authentication/token/cache/cached_token_authenticator_test.go:200:24: Error return value of `a.AuthenticateToken` is not checked (errcheck)
a.AuthenticateToken(context.Background(), "")
^
staging/src/k8s.io/apiserver/pkg/authentication/token/cache/cached_token_authenticator_test.go:227:23: Error return value of `a.AuthenticateToken` is not checked (errcheck)
a.AuthenticateToken(ctx1, "")
^
staging/src/k8s.io/apiserver/pkg/authentication/token/cache/cached_token_authenticator_test.go:279:22: Error return value of `a.AuthenticateToken` is not checked (errcheck)
a.AuthenticateToken(ctx, "")
^
staging/src/k8s.io/apiserver/pkg/authentication/token/cache/cached_token_authenticator_test.go:498:21: Error return value of `a.AuthenticateToken` is not checked (errcheck)
a.AuthenticateToken(ctx, tok)
^
staging/src/k8s.io/apiserver/pkg/util/x509metrics/server_cert_deprecations_test.go:656:10: Error return value of `w.Write` is not checked (errcheck)
w.Write([]byte("ok"))
^
staging/src/k8s.io/apiserver/pkg/util/webhook/webhook.go:111:24: Error return value is not checked (errcheck)
WithExponentialBackoff(ctx, g.RetryBackoff, func() error {
^
staging/src/k8s.io/apiserver/pkg/util/webhook/webhook_test.go:601:29: Error return value of `(*encoding/json.Encoder).Encode` is not checked (errcheck)
json.NewEncoder(w).Encode(apierrors.NewServerTimeout(gr, "get", 2))
^
staging/src/k8s.io/apiserver/pkg/util/webhook/webhook_test.go:605:29: Error return value of `(*encoding/json.Encoder).Encode` is not checked (errcheck)
json.NewEncoder(w).Encode(apierrors.NewInternalError(fmt.Errorf("nope")))
^
staging/src/k8s.io/apiserver/pkg/util/webhook/webhook_test.go:609:29: Error return value of `(*encoding/json.Encoder).Encode` is not checked (errcheck)
json.NewEncoder(w).Encode(apierrors.NewGenericServerResponse(http.StatusNotAcceptable, "get", gr, "testing", "nope", 0, false))
^
staging/src/k8s.io/apiserver/pkg/util/shufflesharding/shufflesharding_test.go:242:4: assignOp: replace `histogram[count] = histogram[count] + 1` with `histogram[count]++` (gocritic)
histogram[count] = histogram[count] + 1
^
staging/src/k8s.io/apiserver/pkg/server/mux/pathrecorder_test.go:90:3: assignOp: replace `exactMatchCount = exactMatchCount + 1` with `exactMatchCount++` (gocritic)
exactMatchCount = exactMatchCount + 1
^
staging/src/k8s.io/apiserver/pkg/server/mux/pathrecorder_test.go:98:3: assignOp: replace `fallThroughCount = fallThroughCount + 1` with `fallThroughCount++` (gocritic)
fallThroughCount = fallThroughCount + 1
^
staging/src/k8s.io/apiserver/pkg/server/mux/pathrecorder_test.go:45:3: assignOp: replace `first = first + 1` with `first++` (gocritic)
first = first + 1
^
staging/src/k8s.io/apiserver/pkg/server/mux/pathrecorder_test.go:86:3: assignOp: replace `precisePrefixCount = precisePrefixCount + 1` with `precisePrefixCount++` (gocritic)
precisePrefixCount = precisePrefixCount + 1
^
staging/src/k8s.io/apiserver/pkg/server/mux/pathrecorder_test.go:82:3: assignOp: replace `publicPrefixCount = publicPrefixCount + 1` with `publicPrefixCount++` (gocritic)
publicPrefixCount = publicPrefixCount + 1
^
staging/src/k8s.io/apiserver/pkg/server/mux/pathrecorder_test.go:62:3: assignOp: replace `second = second + 1` with `second++` (gocritic)
second = second + 1
^
staging/src/k8s.io/apiserver/pkg/server/mux/pathrecorder_test.go:78:3: assignOp: replace `secretPrefixCount = secretPrefixCount + 1` with `secretPrefixCount++` (gocritic)
secretPrefixCount = secretPrefixCount + 1
^
staging/src/k8s.io/apiserver/pkg/server/mux/pathrecorder_test.go:94:3: assignOp: replace `slashMatchCount = slashMatchCount + 1` with `slashMatchCount++` (gocritic)
slashMatchCount = slashMatchCount + 1
^
staging/src/k8s.io/apiserver/pkg/util/wsstream/conn.go:261:4: assignOp: replace `channel = channel - '0'` with `channel -= '0'` (gocritic)
channel = channel - '0'
^
staging/src/k8s.io/apiserver/pkg/endpoints/deprecation/deprecation.go:122:4: assignOp: replace `deprecationWarning = deprecationWarning + fmt.S<...>ailable in v%d.%d+", removedMajor, removedMinor)` with `deprecationWarning += fmt.Sprintf(", unavailable in v%d.%d+", removedMajor, removedMinor)` (gocritic)
deprecationWarning = deprecationWarning + fmt.Sprintf(", unavailable in v%d.%d+", removedMajor, removedMinor)
^
staging/src/k8s.io/apiserver/pkg/endpoints/deprecation/deprecation.go:129:4: assignOp: replace `deprecationWarning = deprecationWarning + fmt.S<...>ement.GroupVersion().String(), replacement.Kind)` with `deprecationWarning += fmt.Sprintf("; use %s %s", replacement.GroupVersion().String(), replacement.Kind)` (gocritic)
deprecationWarning = deprecationWarning + fmt.Sprintf("; use %s %s", replacement.GroupVersion().String(), replacement.Kind)
^
staging/src/k8s.io/apiserver/pkg/authentication/request/x509/x509_test.go:695:10: elseif: can replace 'else {if cond {}}' with 'else if cond {}' (gocritic)
} else {
^
staging/src/k8s.io/apiserver/pkg/apis/audit/fuzzer/fuzzer.go:68:18: wrapperFunc: use strings.ReplaceAll method in `strings.Replace(o.APIGroup, "/", "-", -1)` (gocritic)
o.APIGroup = strings.Replace(o.APIGroup, "/", "-", -1)
^
staging/src/k8s.io/apiserver/pkg/apis/audit/fuzzer/fuzzer.go:69:20: wrapperFunc: use strings.ReplaceAll method in `strings.Replace(o.APIVersion, "/", "-", -1)` (gocritic)
o.APIVersion = strings.Replace(o.APIVersion, "/", "-", -1)
^
staging/src/k8s.io/apiserver/pkg/cel/value_test.go:286:5: dupArg: suspicious method call with the same argument and receiver (gocritic)
if mv.Equal(mv) != types.True {
^
staging/src/k8s.io/apiserver/pkg/cel/value_test.go:287:41: dupArg: suspicious method call with the same argument and receiver (gocritic)
t.Fatalf("map.Equal(map) failed: %v", mv.Equal(mv))
^
staging/src/k8s.io/apiserver/pkg/cel/value_test.go:342:5: dupArg: suspicious method call with the same argument and receiver (gocritic)
if obj1.Equal(obj1) != types.True {
^
staging/src/k8s.io/apiserver/pkg/cel/value_test.go:343:48: dupArg: suspicious method call with the same argument and receiver (gocritic)
t.Errorf("obj1.Equal(obj1) failed, got: %v", obj1.Equal(obj1))
^
staging/src/k8s.io/apiserver/pkg/endpoints/openapi/openapi.go:81:4: assignOp: replace `prefix = prefix + ToValidOperationID(parts[2], prefix != "")` with `prefix += ToValidOperationID(parts[2], prefix != "")` (gocritic)
prefix = prefix + ToValidOperationID(parts[2], prefix != "")
^
staging/src/k8s.io/apiserver/pkg/endpoints/openapi/openapi.go:78:3: assignOp: replace `prefix = prefix + ToValidOperationID(trimmed, prefix != "")` with `prefix += ToValidOperationID(trimmed, prefix != "")` (gocritic)
prefix = prefix + ToValidOperationID(trimmed, prefix != "")
^
staging/src/k8s.io/apiserver/pkg/cel/common/values.go:426:2: singleCaseSwitch: should rewrite switch statement to if statement (gocritic)
switch typeDesc.Kind() {
^
staging/src/k8s.io/apiserver/pkg/cel/common/values.go:558:2: singleCaseSwitch: should rewrite switch statement to if statement (gocritic)
switch typeDesc.Kind() {
^
staging/src/k8s.io/apiserver/pkg/util/openapi/enablement.go:34:51: captLocal: `GetOpenAPIDefinitions' should not be capitalized (gocritic)
func GetOpenAPIDefinitionsWithoutDisabledFeatures(GetOpenAPIDefinitions common.GetOpenAPIDefinitions) common.GetOpenAPIDefinitions {
^
staging/src/k8s.io/apiserver/pkg/cel/openapi/resolver/definitions.go:43:25: unlambda: replace `func(path string) spec.Ref {
return spec.MustCreateRef(path)
}` with `spec.MustCreateRef` (gocritic)
defs := getDefinitions(func(path string) spec.Ref {
^
staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/envelope_test.go:304:12: appendAssign: append result not assigned to the same slice (gocritic)
prefix := append(encKeyLen, encKeyBytes...)
^
staging/src/k8s.io/apiserver/pkg/apis/example/fuzzer/fuzzer.go:38:14: commentFormatting: put a space between `//` and comment text (gocritic)
if true { //c.RandBool() {
^
staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/kmsv2/envelope_test.go:611:12: elseif: can replace 'else {if cond {}}' with 'else if cond {}' (gocritic)
} else {
^
staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/kmsv2/envelope_test.go:639:12: elseif: can replace 'else {if cond {}}' with 'else if cond {}' (gocritic)
} else {
^
staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/kmsv2/envelope_test.go:689:11: elseif: can replace 'else {if cond {}}' with 'else if cond {}' (gocritic)
} else {
^
staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/kmsv2/envelope_test.go:742:11: elseif: can replace 'else {if cond {}}' with 'else if cond {}' (gocritic)
} else {
^
staging/src/k8s.io/apiserver/pkg/cel/library/cost_test.go:402:2: singleCaseSwitch: should rewrite switch statement to if statement (gocritic)
switch t := element.Type().TypeKind.(type) {
^
staging/src/k8s.io/apiserver/pkg/server/egressselector/config.go:134:2: ifElseChain: rewrite if-else to switch statement (gocritic)
if transport.TCP != nil && transport.UDS != nil {
^
staging/src/k8s.io/apiserver/pkg/server/egressselector/config.go:196:2: ifElseChain: rewrite if-else to switch statement (gocritic)
if strings.HasPrefix(tcpConfig.URL, "http://") {
^
staging/src/k8s.io/apiserver/pkg/server/egressselector/egress_selector.go:310:3: ifElseChain: rewrite if-else to switch statement (gocritic)
if c.Transport.UDS != nil {
^
staging/src/k8s.io/apiserver/pkg/audit/request_test.go:43:3: assignOp: replace `ua = ua + "a"` with `ua += "a"` (gocritic)
ua = ua + "a"
^
staging/src/k8s.io/apiserver/plugin/pkg/audit/log/backend.go:81:17: unslice: could simplify bs[:] to bs (gocritic)
line = string(bs[:])
^
staging/src/k8s.io/apiserver/pkg/util/webhook/validation.go:29:46: captLocal: `URL' should not be capitalized (gocritic)
func ValidateWebhookURL(fldPath *field.Path, URL string, forceHttps bool) field.ErrorList {
^
staging/src/k8s.io/apiserver/pkg/endpoints/handlers/responsewriters/status.go:62:3: singleCaseSwitch: should rewrite switch statement to if statement (gocritic)
switch {
^
staging/src/k8s.io/apiserver/pkg/endpoints/handlers/responsewriters/writers.go:181:3: singleCaseSwitch: should rewrite switch statement to if statement (gocritic)
switch strings.TrimSpace(token) {
^
staging/src/k8s.io/apiserver/pkg/endpoints/handlers/responsewriters/writers.go:252:2: singleCaseSwitch: should rewrite switch statement to if statement (gocritic)
switch t := w.w.(type) {
^
staging/src/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/integrator.go:44:20: commentFormatting: put a space between `//` and comment text (gocritic)
Duration float64 //seconds
^
staging/src/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/integrator.go:45:20: commentFormatting: put a space between `//` and comment text (gocritic)
Average float64 //time-weighted
^
staging/src/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/integrator.go:46:20: commentFormatting: put a space between `//` and comment text (gocritic)
Deviation float64 //standard deviation: sqrt(avg((value-avg)^2))
^
staging/src/k8s.io/apiserver/pkg/server/dynamiccertificates/named_certificates_test.go:230:3: ifElseChain: rewrite if-else to switch statement (gocritic)
if err == nil && len(test.errorString) != 0 {
^
staging/src/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/queueset/queueset.go:1047:16: appendAssign: append result not assigned to the same slice (gocritic)
keptQueues := append(queues[:index], queues[index+1:]...)
^
staging/src/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/queueset/queueset.go:951:4: ifElseChain: rewrite if-else to switch statement (gocritic)
if !klogV.Enabled() {
^
staging/src/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/queueset/queueset.go:963:3: ifElseChain: rewrite if-else to switch statement (gocritic)
if !klogV.Enabled() {
^
staging/src/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/queueset/queueset.go:980:4: ifElseChain: rewrite if-else to switch statement (gocritic)
if !klogV.Enabled() {
^
staging/src/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/queueset/fifo_list_test.go:177:19: appendAssign: append result not assigned to the same slice (gocritic)
orderExpected := append(arrival[0:randomIndex], arrival[randomIndex+1:]...)
^
staging/src/k8s.io/apiserver/pkg/authentication/request/x509/x509.go:151:15: S1024: should use time.Until instead of t.Sub(time.Now()) (gosimple)
remaining := req.TLS.PeerCertificates[0].NotAfter.Sub(time.Now())
^
staging/src/k8s.io/apiserver/pkg/server/storage/resource_config.go:108:2: S1005: unnecessary assignment to the blank identifier (gosimple)
enabled, _ := o.GroupVersionConfigs[version]
^
staging/src/k8s.io/apiserver/pkg/util/flowcontrol/controller_test.go:480:7: S1005: unnecessary assignment to the blank identifier (gosimple)
_ = <-finishCh
^
staging/src/k8s.io/apiserver/pkg/util/wsstream/conn.go:82:27: S1007: should use raw string (`...`) with regexp.MustCompile to avoid having to escape twice (gosimple)
connectionUpgradeRegex = regexp.MustCompile("(^|.*,\\s*)upgrade($|\\s*,)")
^
staging/src/k8s.io/apiserver/plugin/pkg/audit/webhook/webhook.go:61:2: S1008: should use 'return err != nil' instead of 'if err != nil { return true }; return false' (gosimple)
if err != nil {
^
staging/src/k8s.io/apiserver/pkg/admission/plugin/cel/filter.go:181:13: S1039: unnecessary use of fmt.Sprintf (gosimple)
Detail: fmt.Sprintf("unexpected internal error compiling expression"),
^
staging/src/k8s.io/apiserver/pkg/admission/plugin/cel/filter.go:205:15: S1039: unnecessary use of fmt.Sprintf (gosimple)
Detail: fmt.Sprintf("validation failed due to running out of cost budget, no further validation rules will be run"),
^
staging/src/k8s.io/apiserver/pkg/admission/plugin/cel/filter_test.go:635:24: S1039: unnecessary use of fmt.Sprintf (gosimple)
Error: errors.New(fmt.Sprintf("operation cancelled: actual cost limit exceeded")),
^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/validator_test.go:52:12: S1039: unnecessary use of fmt.Sprintf (gosimple)
Detail: fmt.Sprintf("validation failed due to running out of cost budget, no further validation rules will be run"),
^
staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/matchconditions/matcher.go:104:45: S1039: unnecessary use of fmt.Sprintf (gosimple)
errorList = append(errorList, errors.New(fmt.Sprintf("internal error converting ExpressionAccessor to MatchCondition")))
^
staging/src/k8s.io/apiserver/pkg/storage/testing/watcher_tests.go:308:2: S1000: should use a simple channel send/receive instead of `select` with a single case (gosimple)
select {
^
staging/src/k8s.io/apiserver/pkg/endpoints/discovery/aggregated/wrapper_test.go:48:9: S1030: should use w.Body.String() instead of string(w.Body.Bytes()) (gosimple)
return string(w.Body.Bytes())
^
staging/src/k8s.io/apiserver/pkg/storage/etcd3/store.go:356:11: S1028: should use fmt.Errorf(...) instead of errors.New(fmt.Sprintf(...)) (gosimple)
return errors.New(fmt.Sprintf("invalid DeleteRange response: %v", txnResp.Responses))
^
staging/src/k8s.io/apiserver/pkg/cel/common/schemas.go:116:5: S1011: should replace loop with `enumValues = append(enumValues, prop.Enum()...)` (gosimple)
for _, e := range prop.Enum() {
^
staging/src/k8s.io/apiserver/pkg/admission/plugin/resourcequota/resource_access.go:134:3: S1011: should replace loop with `items = append(items, lruEntry.items...)` (gosimple)
for i := range lruEntry.items {
^
staging/src/k8s.io/apiserver/pkg/util/webhook/validation.go:89:2: S1017: should replace this if statement with an unconditional strings.TrimSuffix (gosimple)
if strings.HasSuffix(urlPathToCheck, "/") {
^
staging/src/k8s.io/apiserver/pkg/audit/union.go:68:43: S1025: should use String() instead of fmt.Sprintf (gosimple)
backendStrings = append(backendStrings, fmt.Sprintf("%s", backend))
^
staging/src/k8s.io/apiserver/pkg/endpoints/handlers/responsewriters/errors.go:42:12: S1025: the argument is already a string, there's no need to use fmt.Sprintf (gosimple)
errMsg = fmt.Sprintf("%s", msg)
^
staging/src/k8s.io/apiserver/pkg/server/options/audit_test.go:167:34: S1025: should use String() instead of fmt.Sprintf (gosimple)
assert.Equal(t, tc.expected, fmt.Sprintf("%s", config.AuditBackend))
^
staging/src/k8s.io/apiserver/pkg/storage/cacher/cacher.go:1258:38: S1002: should omit comparison to bool constant, can be simplified to `!*opts.SendInitialEvents` (gosimple)
if opts.SendInitialEvents == nil || *opts.SendInitialEvents == false || !opts.Predicate.AllowWatchBookmarks {
^
staging/src/k8s.io/apiserver/pkg/storage/cacher/cacher.go:1273:38: S1002: should omit comparison to bool constant, can be simplified to `*opts.SendInitialEvents` (gosimple)
if opts.SendInitialEvents == nil || *opts.SendInitialEvents == true {
^
staging/src/k8s.io/apiserver/pkg/storage/cacher/cacher.go:1304:38: S1002: should omit comparison to bool constant, can be simplified to `*opts.SendInitialEvents` (gosimple)
if opts.SendInitialEvents != nil && *opts.SendInitialEvents == true {
^
staging/src/k8s.io/apiserver/pkg/storage/storagebackend/factory/etcd3.go:212:6: S1002: should omit comparison to bool constant, can be simplified to `!limiter.Allow()` (gosimple)
if limiter.Allow() == false {
^
staging/src/k8s.io/apiserver/pkg/endpoints/installer.go:719:6: S1003: should use strings.Contains(action.Path, "/{name}") instead (gosimple)
if strings.Index(action.Path, "/{name}") != -1 || action.Verb == "POST" {
^
staging/src/k8s.io/apiserver/plugin/pkg/audit/fake/fake.go:38:2: S1023: redundant `return` statement (gosimple)
return
^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/admission_test.go:1948:2: S1023: redundant `return` statement (gosimple)
return
^
staging/src/k8s.io/apiserver/pkg/authentication/request/bearertoken/bearertoken_test.go:141:2: S1023: redundant `return` statement (gosimple)
return
^
staging/src/k8s.io/apiserver/pkg/server/filters/goaway_test.go:142:3: S1023: redundant `return` statement (gosimple)
return
^
staging/src/k8s.io/apiserver/pkg/server/filters/goaway_test.go:157:3: S1023: redundant `return` statement (gosimple)
return
^
staging/src/k8s.io/apiserver/pkg/storage/testing/store_tests.go:69:5: SA1019: out.SelfLink is deprecated: selfLink is a legacy read-only field that is no longer populated by the system. +optional (staticcheck)
if out.SelfLink != "" {
^
staging/src/k8s.io/apiserver/pkg/storage/testing/store_tests.go:2055:7: SA1019: pod.SelfLink is deprecated: selfLink is a legacy read-only field that is no longer populated by the system. +optional (staticcheck)
pod.SelfLink = "testlink"
^
staging/src/k8s.io/apiserver/pkg/storage/testing/store_tests.go:2079:7: SA1019: out.SelfLink is deprecated: selfLink is a legacy read-only field that is no longer populated by the system. +optional (staticcheck)
if out.SelfLink != "" {
^
staging/src/k8s.io/apiserver/pkg/server/routes/index.go:39:9: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
ret := sets.String{}
^
staging/src/k8s.io/apiserver/pkg/server/routes/flags.go:22:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/testing/v1beta1/kms_plugin_mock.go:79:13: SA1019: wait.PollImmediate is deprecated: This method does not return errors from context, use PollWithContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
pollErr := wait.PollImmediate(1*time.Second, wait.ForeverTestTimeout, func() (bool, error) {
^
staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/testing/v1beta1/kms_plugin_mock.go:84:16: SA1019: wait.ErrWaitTimeout is deprecated: This type will be made private in favor of Interrupted() for checking errors or ErrorInterrupted(err) for returning a wrapped error. (staticcheck)
if pollErr == wait.ErrWaitTimeout {
^
staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/testing/v2/kms_plugin_mock.go:82:13: SA1019: wait.PollImmediate is deprecated: This method does not return errors from context, use PollWithContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
pollErr := wait.PollImmediate(1*time.Second, wait.ForeverTestTimeout, func() (bool, error) {
^
staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/testing/v2/kms_plugin_mock.go:87:16: SA1019: wait.ErrWaitTimeout is deprecated: This type will be made private in favor of Interrupted() for checking errors or ErrorInterrupted(err) for returning a wrapped error. (staticcheck)
if pollErr == wait.ErrWaitTimeout {
^
staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/testing/v2/kms_plugin_mock.go:99:19: SA1019: wait.PollImmediate is deprecated: This method does not return errors from context, use PollWithContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
updatePollErr := wait.PollImmediate(1*time.Second, wait.ForeverTestTimeout, func() (bool, error) {
^
staging/src/k8s.io/apiserver/pkg/admission/handler.go:37:13: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
operations sets.String
^
staging/src/k8s.io/apiserver/pkg/admission/config.go:23:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
staging/src/k8s.io/apiserver/pkg/admission/plugins.go:23:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
staging/src/k8s.io/apiserver/pkg/admission/config_test.go:20:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
staging/src/k8s.io/apiserver/pkg/admission/plugin/namespace/lifecycle/admission.go:66:21: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
immortalNamespaces sets.String
^
staging/src/k8s.io/apiserver/pkg/admission/plugin/namespace/lifecycle/admission.go:189:38: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
func NewLifecycle(immortalNamespaces sets.String) (*Lifecycle, error) {
^
staging/src/k8s.io/apiserver/pkg/admission/plugin/namespace/lifecycle/admission.go:193:47: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
func newLifecycleWithClock(immortalNamespaces sets.String, clock utilcache.Clock) (*Lifecycle, error) {
^
staging/src/k8s.io/apiserver/pkg/admission/plugin/resourcequota/controller.go:70:13: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
inProgress sets.String
^
staging/src/k8s.io/apiserver/pkg/admission/plugin/resourcequota/controller.go:130:15: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
inProgress: sets.String{},
^
staging/src/k8s.io/apiserver/pkg/admission/plugin/resourcequota/controller.go:449:28: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
restrictedResourcesSet := sets.String{}
^
staging/src/k8s.io/apiserver/pkg/admission/plugin/resourcequota/config.go:22:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/admission_test.go:575:9: SA1019: wait.PollWithContext is deprecated: This method does not return errors from context, use PollWithContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
return wait.PollWithContext(ctx, 100*time.Millisecond, 1*time.Second, func(ctx context.Context) (done bool, err error) {
^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/admission_test.go:623:9: SA1019: wait.PollWithContext is deprecated: This method does not return errors from context, use PollWithContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
return wait.PollWithContext(ctx, 200*time.Millisecond, 3*time.Hour, func(ctx context.Context) (done bool, err error) {
^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/internal/generic/controller_test.go:499:21: SA1019: wait.PollWithContext is deprecated: This method does not return errors from context, use PollWithContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
require.NoError(t, wait.PollWithContext(testContext, 100*time.Millisecond, 500*time.Millisecond, func(ctx context.Context) (done bool, err error) {
^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/internal/generic/controller_test.go:511:21: SA1019: wait.PollWithContext is deprecated: This method does not return errors from context, use PollWithContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
require.NoError(t, wait.PollWithContext(testContext, 100*time.Millisecond, 500*time.Millisecond, func(ctx context.Context) (done bool, err error) {
^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/internal/generic/controller_test.go:522:21: SA1019: wait.PollWithContext is deprecated: This method does not return errors from context, use PollWithContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
require.NoError(t, wait.PollWithContext(testContext, 100*time.Millisecond, 500*time.Millisecond, func(ctx context.Context) (done bool, err error) {
^
staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/config/kubeconfig.go:22:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/mutating/reinvocationcontext.go:30:39: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
previouslyInvokedReinvocableWebhooks sets.String
^
staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/mutating/reinvocationcontext.go:32:19: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
reinvokeWebhooks sets.String
^
staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/request/admissionreview_test.go:538:18: SA1019: utilpointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
DryRun: utilpointer.BoolPtr(false),
^
staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/request/admissionreview_test.go:581:18: SA1019: utilpointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
DryRun: utilpointer.BoolPtr(false),
^
staging/src/k8s.io/apiserver/pkg/apis/config/validation/validation.go:366:99: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
func validateKMSConfiguration(c *config.KMSConfiguration, fieldPath *field.Path, kmsProviderNames sets.String, reload bool) field.ErrorList {
^
staging/src/k8s.io/apiserver/pkg/apis/config/validation/validation.go:428:96: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
func validateKMSConfigName(c *config.KMSConfiguration, fieldPath *field.Path, kmsProviderNames sets.String, reload bool) field.ErrorList {
^
staging/src/k8s.io/apiserver/pkg/apis/config/validation/validation_test.go:1346:20: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
kmsProviderNames sets.String
^
staging/src/k8s.io/apiserver/pkg/audit/policy/util.go:25:18: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
func AllStages() sets.String {
^
staging/src/k8s.io/apiserver/pkg/audit/policy/util.go:35:18: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
func AllLevels() sets.String {
^
staging/src/k8s.io/apiserver/pkg/audit/policy/util.go:62:35: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
func ConvertStringSetToStages(set sets.String) []audit.Stage {
^
staging/src/k8s.io/apiserver/pkg/audit/policy/reader.go:21:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
staging/src/k8s.io/apiserver/pkg/audit/policy/reader_test.go:20:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
staging/src/k8s.io/apiserver/pkg/authentication/request/headerrequest/requestheader.go:22:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
staging/src/k8s.io/apiserver/pkg/authentication/request/x509/x509.go:188:90: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
func NewVerifier(opts x509.VerifyOptions, auth authenticator.Request, allowedCommonNames sets.String) authenticator.Request {
^
staging/src/k8s.io/apiserver/pkg/authentication/request/x509/x509_test.go:557:14: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
AllowedCNs sets.String
^
staging/src/k8s.io/apiserver/pkg/authentication/request/x509/x509_test.go:24:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
staging/src/k8s.io/apiserver/pkg/authentication/token/tokenfile/tokenfile_test.go:21:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
staging/src/k8s.io/apiserver/pkg/endpoints/groupversion.go:70:18: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
RootScopedKinds sets.String
^
staging/src/k8s.io/apiserver/pkg/endpoints/installer.go:796:38: SA1019: strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead. (staticcheck)
Operation("read"+namespaced+kind+strings.Title(subresource)+operationSuffix).
^
staging/src/k8s.io/apiserver/pkg/endpoints/installer.go:817:38: SA1019: strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead. (staticcheck)
Operation("list"+namespaced+kind+strings.Title(subresource)+operationSuffix).
^
staging/src/k8s.io/apiserver/pkg/endpoints/installer.go:850:41: SA1019: strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead. (staticcheck)
Operation("replace"+namespaced+kind+strings.Title(subresource)+operationSuffix).
^
staging/src/k8s.io/apiserver/pkg/endpoints/installer.go:880:39: SA1019: strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead. (staticcheck)
Operation("patch"+namespaced+kind+strings.Title(subresource)+operationSuffix).
^
staging/src/k8s.io/apiserver/pkg/endpoints/installer.go:909:40: SA1019: strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead. (staticcheck)
Operation("create"+namespaced+kind+strings.Title(subresource)+operationSuffix).
^
staging/src/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/conversion.go:24:6: ST1003: should not use underscores in Go names; func Convert_v1alpha1_EgressSelection_To_apiserver_EgressSelection should be ConvertV1alpha1EgressSelectionToApiserverEgressSelection (stylecheck)
func Convert_v1alpha1_EgressSelection_To_apiserver_EgressSelection(in *EgressSelection, out *apiserver.EgressSelection, s conversion.Scope) error {
^
staging/src/k8s.io/apiserver/pkg/apis/apiserver/v1beta1/conversion.go:24:6: ST1003: should not use underscores in Go names; func Convert_v1beta1_EgressSelection_To_apiserver_EgressSelection should be ConvertV1beta1EgressSelectionToApiserverEgressSelection (stylecheck)
func Convert_v1beta1_EgressSelection_To_apiserver_EgressSelection(in *EgressSelection, out *apiserver.EgressSelection, s conversion.Scope) error {
^
staging/src/k8s.io/apiserver/pkg/admission/plugin/resourcequota/apis/resourcequota/v1/defaults.go:25:6: ST1003: should not use underscores in Go names; func SetDefaults_Configuration should be SetDefaultsConfiguration (stylecheck)
func SetDefaults_Configuration(obj *Configuration) {}
^
staging/src/k8s.io/apiserver/pkg/admission/plugin/resourcequota/apis/resourcequota/v1alpha1/defaults.go:25:6: ST1003: should not use underscores in Go names; func SetDefaults_Configuration should be SetDefaultsConfiguration (stylecheck)
func SetDefaults_Configuration(obj *Configuration) {}
^
staging/src/k8s.io/apiserver/pkg/admission/plugin/resourcequota/apis/resourcequota/v1beta1/defaults.go:25:6: ST1003: should not use underscores in Go names; func SetDefaults_Configuration should be SetDefaultsConfiguration (stylecheck)
func SetDefaults_Configuration(obj *Configuration) {}
^
staging/src/k8s.io/apiserver/pkg/apis/example2/v1/conversion.go:24:6: ST1003: should not use underscores in Go names; func Convert_example_ReplicaSetSpec_To_v1_ReplicaSetSpec should be ConvertExampleReplicaSetSpecToV1ReplicaSetSpec (stylecheck)
func Convert_example_ReplicaSetSpec_To_v1_ReplicaSetSpec(in *example.ReplicaSetSpec, out *ReplicaSetSpec, s conversion.Scope) error {
^
staging/src/k8s.io/apiserver/pkg/apis/example2/v1/conversion.go:30:6: ST1003: should not use underscores in Go names; func Convert_v1_ReplicaSetSpec_To_example_ReplicaSetSpec should be ConvertV1ReplicaSetSpecToExampleReplicaSetSpec (stylecheck)
func Convert_v1_ReplicaSetSpec_To_example_ReplicaSetSpec(in *ReplicaSetSpec, out *example.ReplicaSetSpec, s conversion.Scope) error {
^
staging/src/k8s.io/apiserver/pkg/endpoints/testing/conversion.go:26:6: ST1003: func convertUrlValuesToSimpleGetOptions should be convertURLValuesToSimpleGetOptions (stylecheck)
func convertUrlValuesToSimpleGetOptions(in *url.Values, out *SimpleGetOptions, s conversion.Scope) error {
^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/controller.go:431:2: ST1003: var valueJson should be valueJSON (stylecheck)
valueJson, err := utiljson.Marshal([]validationFailureValue{{
^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/admission_test.go:252:2: ST1003: struct field keyId should be keyID (stylecheck)
keyId string
^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/admission_test.go:1657:2: ST1003: var valueJson should be valueJSON (stylecheck)
valueJson, ok := annotations["validation.policy.admission.k8s.io/validation_failure"]
^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/admission_test.go:1788:2: ST1003: var valueJson should be valueJSON (stylecheck)
valueJson, ok := annotations["validation.policy.admission.k8s.io/validation_failure"]
^
staging/src/k8s.io/apiserver/pkg/apis/config/v1/defaults.go:37:6: ST1003: should not use underscores in Go names; func SetDefaults_KMSConfiguration should be SetDefaultsKMSConfiguration (stylecheck)
func SetDefaults_KMSConfiguration(obj *KMSConfiguration) {
^
staging/src/k8s.io/apiserver/pkg/authentication/group/token_group_adder_test.go:53:6: ST1003: func toJson should be toJSON (stylecheck)
func toJson(x interface{}) string {
^
staging/src/k8s.io/apiserver/pkg/authorization/authorizerfactory/builtin.go:80:9: ST1003: should not use underscores in Go names; range var attr_group should be attrGroup (stylecheck)
for _, attr_group := range attr.GetUser().GetGroups() {
^
staging/src/k8s.io/apiserver/pkg/authorization/authorizerfactory/builtin.go:81:10: ST1003: should not use underscores in Go names; range var priv_group should be privGroup (stylecheck)
for _, priv_group := range r.groups {
^
staging/src/k8s.io/apiserver/pkg/cel/escaping.go:66:2: ST1003: should not use underscores in Go names; var previous_underscore should be previousUnderscore (stylecheck)
previous_underscore := false
^
staging/src/k8s.io/apiserver/pkg/cel/library/cost.go:37:44: ST1003: method parameter overloadId should be overloadID (stylecheck)
func (l *CostEstimator) CallCost(function, overloadId string, args []ref.Val, result ref.Val) *uint64 {
^
staging/src/k8s.io/apiserver/pkg/cel/library/cost.go:86:52: ST1003: method parameter overloadId should be overloadID (stylecheck)
func (l *CostEstimator) EstimateCallCost(function, overloadId string, target *checker.AstNode, args []checker.AstNode) *checker.CallEstimate {
^
staging/src/k8s.io/apiserver/pkg/cel/library/urls.go:155:6: ST1003: func stringToUrl should be stringToURL (stylecheck)
func stringToUrl(arg ref.Val) ref.Val {
^
staging/src/k8s.io/apiserver/pkg/cel/library/cost_test.go:414:56: ST1003: method parameter overloadId should be overloadID (stylecheck)
func (t *testCostEstimator) EstimateCallCost(function, overloadId string, target *checker.AstNode, args []checker.AstNode) *checker.CallEstimate {
^
staging/src/k8s.io/apiserver/pkg/endpoints/installer.go:53:2: ST1003: should not use ALL_CAPS in Go names; use CamelCase instead (stylecheck)
ROUTE_META_GVK = "x-kubernetes-group-version-kind"
^
staging/src/k8s.io/apiserver/pkg/endpoints/installer.go:54:2: ST1003: should not use ALL_CAPS in Go names; use CamelCase instead (stylecheck)
ROUTE_META_ACTION = "x-kubernetes-action"
^
staging/src/k8s.io/apiserver/pkg/endpoints/discovery/aggregated/handler_test.go:169:2: ST1003: should not use underscores in Go names; var res1_initial should be res1Initial (stylecheck)
res1_initial, _, _ := fetchPath(manager1, "application/json", discoveryPath, "")
^
staging/src/k8s.io/apiserver/pkg/endpoints/discovery/aggregated/handler_test.go:170:2: ST1003: should not use underscores in Go names; var res2_initial should be res2Initial (stylecheck)
res2_initial, _, _ := fetchPath(manager2, "application/json", discoveryPath, "")
^
staging/src/k8s.io/apiserver/pkg/endpoints/discovery/aggregated/handler_test.go:185:2: ST1003: should not use underscores in Go names; var res1_addedToOne should be res1AddedToOne (stylecheck)
res1_addedToOne, _, _ := fetchPath(manager1, "application/json", discoveryPath, "")
^
staging/src/k8s.io/apiserver/pkg/endpoints/discovery/aggregated/handler_test.go:186:2: ST1003: should not use underscores in Go names; var res2_addedToOne should be res2AddedToOne (stylecheck)
res2_addedToOne, _, _ := fetchPath(manager2, "application/json", discoveryPath, "")
^
staging/src/k8s.io/apiserver/pkg/endpoints/discovery/aggregated/handler_test.go:201:2: ST1003: should not use underscores in Go names; var res1_addedToBoth should be res1AddedToBoth (stylecheck)
res1_addedToBoth, _, _ := fetchPath(manager1, "application/json", discoveryPath, "")
^
staging/src/k8s.io/apiserver/pkg/endpoints/discovery/aggregated/handler_test.go:202:2: ST1003: should not use underscores in Go names; var res2_addedToBoth should be res2AddedToBoth (stylecheck)
res2_addedToBoth, _, _ := fetchPath(manager2, "application/json", discoveryPath, "")
^
staging/src/k8s.io/apiserver/pkg/endpoints/discovery/aggregated/handler_test.go:223:2: ST1003: should not use underscores in Go names; var res1_removeFromBoth should be res1RemoveFromBoth (stylecheck)
res1_removeFromBoth, _, _ := fetchPath(manager1, "application/json", discoveryPath, "")
^
staging/src/k8s.io/apiserver/pkg/endpoints/discovery/aggregated/handler_test.go:224:2: ST1003: should not use underscores in Go names; var res2_removeFromBoth should be res2RemoveFromBoth (stylecheck)
res2_removeFromBoth, _, _ := fetchPath(manager2, "application/json", discoveryPath, "")
^
staging/src/k8s.io/apiserver/pkg/endpoints/filters/impersonation_test.go:112:3: ST1003: struct field impersonationUid should be impersonationUID (stylecheck)
impersonationUid string
^
staging/src/k8s.io/apiserver/pkg/registry/generic/rest/response_checker.go:32:6: ST1003: type HttpResponseChecker should be HTTPResponseChecker (stylecheck)
type HttpResponseChecker interface {
^
staging/src/k8s.io/apiserver/pkg/registry/generic/rest/response_checker.go:42:6: ST1003: type GenericHttpResponseChecker should be GenericHTTPResponseChecker (stylecheck)
type GenericHttpResponseChecker struct {
^
staging/src/k8s.io/apiserver/pkg/registry/generic/rest/response_checker.go:69:6: ST1003: func NewGenericHttpResponseChecker should be NewGenericHTTPResponseChecker (stylecheck)
func NewGenericHttpResponseChecker(qualifiedResource schema.GroupResource, name string) GenericHttpResponseChecker {
^
staging/src/k8s.io/apiserver/pkg/server/config.go:784:2: ST1003: var genericApiServerHookName should be genericAPIServerHookName (stylecheck)
genericApiServerHookName := "generic-apiserver-start-informers"
^
staging/src/k8s.io/apiserver/pkg/server/genericapiserver.go:557:2: ST1003: var stopHttpServerCh should be stopHTTPServerCh (stylecheck)
stopHttpServerCh := make(chan struct{})
^
staging/src/k8s.io/apiserver/pkg/server/genericapiserver.go:561:3: ST1003: var timeToStopHttpServerCh should be timeToStopHTTPServerCh (stylecheck)
timeToStopHttpServerCh := notAcceptingNewRequestCh.Signaled()
^
staging/src/k8s.io/apiserver/pkg/server/healthz/healthz_test.go:267:6: ST1003: func createGetRequestWithUrl should be createGetRequestWithURL (stylecheck)
func createGetRequestWithUrl(rawUrlString string) *http.Request {
^
staging/src/k8s.io/apiserver/pkg/storage/etcd3/metrics/metrics.go:191:6: ST1003: func UpdateEtcdDbSize should be UpdateEtcdDBSize (stylecheck)
func UpdateEtcdDbSize(ep string, size int64) {
^
staging/src/k8s.io/apiserver/pkg/util/openapi/enablement_test.go:31:6: ST1003: should not use underscores in Go names; func schema_k8sio_api_apps_v1_DeploymentCondition should be schemaK8sioAPIAppsV1DeploymentCondition (stylecheck)
func schema_k8sio_api_apps_v1_DeploymentCondition(ref common.ReferenceCallback) common.OpenAPIDefinition {
^
staging/src/k8s.io/apiserver/plugin/pkg/audit/log/backend.go:34:2: ST1003: const FormatJson should be FormatJSON (stylecheck)
FormatJson = "json"
^
staging/src/k8s.io/apiserver/pkg/admission/initializer/initializer_test.go:120:7: ST1006: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (stylecheck)
func (self *WantAuthorizerAdmission) Admit(ctx context.Context, a admission.Attributes, o admission.ObjectInterfaces) error {
^
staging/src/k8s.io/apiserver/pkg/admission/initializer/initializer_test.go:123:7: ST1006: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (stylecheck)
func (self *WantAuthorizerAdmission) Handles(o admission.Operation) bool { return false }
^
staging/src/k8s.io/apiserver/pkg/admission/initializer/initializer_test.go:119:7: ST1006: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (stylecheck)
func (self *WantAuthorizerAdmission) SetAuthorizer(a authorizer.Authorizer) { self.auth = a }
^
staging/src/k8s.io/apiserver/pkg/admission/initializer/initializer_test.go:124:7: ST1006: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (stylecheck)
func (self *WantAuthorizerAdmission) ValidateInitialization() error { return nil }
^
staging/src/k8s.io/apiserver/pkg/admission/initializer/initializer_test.go:137:7: ST1006: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (stylecheck)
func (self *WantDrainedNotification) Admit(ctx context.Context, a admission.Attributes, o admission.ObjectInterfaces) error {
^
staging/src/k8s.io/apiserver/pkg/admission/initializer/initializer_test.go:140:7: ST1006: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (stylecheck)
func (self *WantDrainedNotification) Handles(o admission.Operation) bool { return false }
^
staging/src/k8s.io/apiserver/pkg/admission/initializer/initializer_test.go:134:7: ST1006: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (stylecheck)
func (self *WantDrainedNotification) SetDrainedNotification(stopCh <-chan struct{}) {
^
staging/src/k8s.io/apiserver/pkg/admission/initializer/initializer_test.go:141:7: ST1006: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (stylecheck)
func (self *WantDrainedNotification) ValidateInitialization() error { return nil }
^
running ( cd /nvme/gopath/src/k8s.io/kubernetes/staging/src/k8s.io/client-go; env LOGCHECK_CONFIG=/nvme/gopath/src/k8s.io/kubernetes/hack/logcheck.conf /nvme/gopath/src/k8s.io/kubernetes/_output/local/bin/golangci-lint run --config=/nvme/gopath/src/k8s.io/kubernetes/hack/golangci-strict.yaml --path-prefix staging/src/k8s.io/client-go ./... )
staging/src/k8s.io/client-go/tools/cache/synctrack/lazy_test.go:93:10: Error return value of `z.Get` is not checked (errcheck)
z.Get()
^
staging/src/k8s.io/client-go/tools/clientcmd/api/helpers_test.go:223:14: Error return value is not checked (errcheck)
MinifyConfig(&config)
^
staging/src/k8s.io/client-go/transport/cert_rotation.go:142:28: Error return value of `wait.PollImmediateUntil` is not checked (errcheck)
go wait.PollImmediateUntil(CertCallbackRefreshDuration, func() (bool, error) {
^
staging/src/k8s.io/client-go/transport/round_trippers_test.go:130:49: Error return value of `(net/http.RoundTripper).RoundTrip` is not checked (errcheck)
NewBearerAuthRoundTripper("test", rt).RoundTrip(req)
^
staging/src/k8s.io/client-go/transport/round_trippers_test.go:152:59: Error return value of `(net/http.RoundTripper).RoundTrip` is not checked (errcheck)
NewBasicAuthRoundTripper(tc.user, tc.pass, rt).RoundTrip(req)
^
staging/src/k8s.io/client-go/transport/round_trippers_test.go:171:48: Error return value of `(net/http.RoundTripper).RoundTrip` is not checked (errcheck)
NewUserAgentRoundTripper("test", rt).RoundTrip(req)
^
staging/src/k8s.io/client-go/transport/round_trippers_test.go:183:48: Error return value of `(net/http.RoundTripper).RoundTrip` is not checked (errcheck)
NewUserAgentRoundTripper("test", rt).RoundTrip(req)
^
staging/src/k8s.io/client-go/transport/round_trippers_test.go:281:69: Error return value of `(net/http.RoundTripper).RoundTrip` is not checked (errcheck)
NewImpersonatingRoundTripper(tc.impersonationConfig, rt).RoundTrip(req)
^
staging/src/k8s.io/client-go/transport/round_trippers_test.go:352:75: Error return value of `(net/http.RoundTripper).RoundTrip` is not checked (errcheck)
NewAuthProxyRoundTripper(tc.username, tc.groups, tc.extra, rt).RoundTrip(req)
^
staging/src/k8s.io/client-go/transport/round_trippers_test.go:534:55: Error return value of `(net/http.RoundTripper).RoundTrip` is not checked (errcheck)
NewDebuggingRoundTripper(rt, tc.levels...).RoundTrip(req)
^
staging/src/k8s.io/client-go/transport/token_source_test.go:224:16: Error return value of `rt.RoundTrip` is not checked (errcheck)
rt.RoundTrip(&http.Request{Header: test.header})
^
staging/src/k8s.io/client-go/util/testing/fake_handler.go:72:17: Error return value of `response.Write` is not checked (errcheck)
response.Write([]byte(f.ResponseBody))
^
staging/src/k8s.io/client-go/util/testing/fake_handler.go:84:16: Error return value of `response.Write` is not checked (errcheck)
response.Write([]byte(f.ResponseBody))
^
staging/src/k8s.io/client-go/util/testing/fake_openapi_handler.go:80:18: Error return value of `filepath.WalkDir` is not checked (errcheck)
filepath.WalkDir(specsPath, func(path string, d fs.DirEntry, err error) error {
^
staging/src/k8s.io/client-go/tools/cache/testing/fake_controller_source.go:160:23: Error return value of `f.Broadcaster.Action` is not checked (errcheck)
f.Broadcaster.Action(e.Type, e.Object)
^
staging/src/k8s.io/client-go/plugin/pkg/client/auth/exec/exec_test.go:1148:28: Error return value of `a.UpdateTransportConfig` is not checked (errcheck)
a.UpdateTransportConfig(tc)
^
staging/src/k8s.io/client-go/dynamic/client_test.go:131:11: Error return value of `w.Write` is not checked (errcheck)
w.Write(tc.resp)
^
staging/src/k8s.io/client-go/dynamic/client_test.go:206:11: Error return value of `w.Write` is not checked (errcheck)
w.Write(tc.resp)
^
staging/src/k8s.io/client-go/dynamic/client_test.go:285:46: Error return value of `unstructured.UnstructuredJSONScheme.Encode` is not checked (errcheck)
unstructured.UnstructuredJSONScheme.Encode(statusOK, w)
^
staging/src/k8s.io/client-go/dynamic/client_test.go:338:46: Error return value of `unstructured.UnstructuredJSONScheme.Encode` is not checked (errcheck)
unstructured.UnstructuredJSONScheme.Encode(statusOK, w)
^
staging/src/k8s.io/client-go/dynamic/client_test.go:416:11: Error return value of `w.Write` is not checked (errcheck)
w.Write(data)
^
staging/src/k8s.io/client-go/dynamic/client_test.go:498:11: Error return value of `w.Write` is not checked (errcheck)
w.Write(data)
^
staging/src/k8s.io/client-go/dynamic/client_test.go:566:15: Error return value of `enc.Encode` is not checked (errcheck)
enc.Encode(&e)
^
staging/src/k8s.io/client-go/dynamic/client_test.go:657:11: Error return value of `w.Write` is not checked (errcheck)
w.Write(data)
^
staging/src/k8s.io/client-go/testing/fixture_test.go:222:12: Error return value of `o.Create` is not checked (errcheck)
o.Create(testResource, obj, c.ns)
^
staging/src/k8s.io/client-go/testing/fixture_test.go:225:12: Error return value of `o.Update` is not checked (errcheck)
o.Update(testResource, obj, c.ns)
^
staging/src/k8s.io/client-go/testing/fixture_test.go:227:12: Error return value of `o.Delete` is not checked (errcheck)
o.Delete(testResource, c.ns, c.name)
^
staging/src/k8s.io/client-go/listers/extensions/v1beta1/daemonset_expansion_test.go:131:13: Error return value of `store.Add` is not checked (errcheck)
store.Add(r)
^
staging/src/k8s.io/client-go/tools/record/event_test.go:393:17: Error return value is not checked (errcheck)
validateEvent(strconv.Itoa(index), actualEvent, item.expect, t)
^
staging/src/k8s.io/client-go/tools/record/event_test.go:396:17: Error return value is not checked (errcheck)
validateEvent(strconv.Itoa(index), actualEvent, item.expect, t)
^
staging/src/k8s.io/client-go/tools/record/event_test.go:675:17: Error return value is not checked (errcheck)
validateEvent(strconv.Itoa(index), actualEvent, item.expect, t)
^
staging/src/k8s.io/client-go/tools/record/event_test.go:678:17: Error return value is not checked (errcheck)
validateEvent(strconv.Itoa(index), actualEvent, item.expect, t)
^
staging/src/k8s.io/client-go/tools/record/event_test.go:954:17: Error return value is not checked (errcheck)
validateEvent(strconv.Itoa(index), actualEvent, item.expect, t)
^
staging/src/k8s.io/client-go/tools/record/event_test.go:957:17: Error return value is not checked (errcheck)
validateEvent(strconv.Itoa(index), actualEvent, item.expect, t)
^
staging/src/k8s.io/client-go/tools/record/event_test.go:970:17: Error return value is not checked (errcheck)
validateEvent(strconv.Itoa(index), actualEvent, item.expect, t)
^
staging/src/k8s.io/client-go/tools/record/event_test.go:973:17: Error return value is not checked (errcheck)
validateEvent(strconv.Itoa(index), actualEvent, item.expect, t)
^
staging/src/k8s.io/client-go/tools/cache/controller.go:199:35: Error return value of `c.config.Queue.AddIfNotPresent` is not checked (errcheck)
c.config.Queue.AddIfNotPresent(obj)
^
staging/src/k8s.io/client-go/tools/cache/controller_test.go:232:11: Error return value of `wait.Poll` is not checked (errcheck)
wait.Poll(100*time.Millisecond, wait.ForeverTestTimeout, func() (bool, error) {
^
staging/src/k8s.io/client-go/tools/cache/delta_fifo_test.go:64:9: Error return value of `f.Add` is not checked (errcheck)
f.Add(mkFifoObj(string([]rune{'a', rune(i)}), i+1))
^
staging/src/k8s.io/client-go/tools/cache/delta_fifo_test.go:69:9: Error return value of `f.Add` is not checked (errcheck)
f.Add(mkFifoObj(string([]rune{'b', rune(u)}), u+1))
^
staging/src/k8s.io/client-go/tools/cache/delta_fifo_test.go:111:10: Error return value of `f.Delete` is not checked (errcheck)
f.Delete(oldObj)
^
staging/src/k8s.io/client-go/tools/cache/delta_fifo_test.go:112:11: Error return value of `f.Replace` is not checked (errcheck)
f.Replace([]interface{}{newObj}, "")
^
staging/src/k8s.io/client-go/tools/cache/delta_fifo_test.go:135:10: Error return value of `f.Add` is not checked (errcheck)
f.Add(obj)
^
staging/src/k8s.io/client-go/tools/cache/delta_fifo_test.go:136:14: Error return value of `f.Replace` is not checked (errcheck)
f.Replace([]interface{}{}, "0")
^
staging/src/k8s.io/client-go/tools/cache/delta_fifo_test.go:147:10: Error return value of `f.Add` is not checked (errcheck)
f.Add(obj)
^
staging/src/k8s.io/client-go/tools/cache/delta_fifo_test.go:148:14: Error return value of `f.Replace` is not checked (errcheck)
f.Replace([]interface{}{obj}, "0")
^
staging/src/k8s.io/client-go/tools/cache/delta_fifo_test.go:149:14: Error return value of `f.Replace` is not checked (errcheck)
f.Replace([]interface{}{}, "0")
^
staging/src/k8s.io/client-go/tools/cache/delta_fifo_test.go:160:10: Error return value of `f.Add` is not checked (errcheck)
f.Add(obj)
^
staging/src/k8s.io/client-go/tools/cache/delta_fifo_test.go:161:13: Error return value of `f.Delete` is not checked (errcheck)
f.Delete(obj)
^
staging/src/k8s.io/client-go/tools/cache/delta_fifo_test.go:162:14: Error return value of `f.Replace` is not checked (errcheck)
f.Replace([]interface{}{}, "0")
^
staging/src/k8s.io/client-go/util/flowcontrol/backoff_test.go:43:2: commentFormatting: put a space between `//` and comment text (gocritic)
//Now confirm that the Reset cancels backoff.
^
staging/src/k8s.io/client-go/tools/cache/synctrack/lazy_test.go:163:3: ifElseChain: rewrite if-else to switch statement (gocritic)
if count == 1 {
^
staging/src/k8s.io/client-go/tools/cache/synctrack/lazy_test.go:208:3: ifElseChain: rewrite if-else to switch statement (gocritic)
if count == 1 {
^
staging/src/k8s.io/client-go/util/jsonpath/jsonpath.go:509:4: commentFormatting: put a space between `//` and comment text (gocritic)
//case exists
^
staging/src/k8s.io/client-go/util/jsonpath/jsonpath.go:443:3: ifElseChain: rewrite if-else to switch statement (gocritic)
if kind == reflect.Struct {
^
staging/src/k8s.io/client-go/util/jsonpath/jsonpath.go:471:3: ifElseChain: rewrite if-else to switch statement (gocritic)
if kind == reflect.Struct {
^
staging/src/k8s.io/client-go/util/jsonpath/parser.go:164:29: commentFormatting: put a space between `//` and comment text (gocritic)
case r == '@' || r == '$': //the current object, just pass it
^
staging/src/k8s.io/client-go/util/jsonpath/parser.go:275:2: commentFormatting: put a space between `//` and comment text (gocritic)
//union operator
^
staging/src/k8s.io/client-go/util/jsonpath/parser.go:303:2: commentFormatting: put a space between `//` and comment text (gocritic)
//slice operator
^
staging/src/k8s.io/client-go/util/jsonpath/parser.go:356:5: commentFormatting: put a space between `//` and comment text (gocritic)
//save the paired rune
^
staging/src/k8s.io/client-go/util/jsonpath/parser.go:361:4: commentFormatting: put a space between `//` and comment text (gocritic)
//only add when met paired rune
^
staging/src/k8s.io/client-go/util/jsonpath/parser.go:366:4: commentFormatting: put a space between `//` and comment text (gocritic)
//in rightParser below quotes only appear zero or once
^
staging/src/k8s.io/client-go/util/jsonpath/parser.go:408:4: commentFormatting: put a space between `//` and comment text (gocritic)
//if it's not escape break the Loop
^
staging/src/k8s.io/client-go/util/jsonpath/parser.go:432:23: wrapperFunc: use strings.ReplaceAll method in `strings.Replace(value, "\\", "", -1)` (gocritic)
cur.append(newField(strings.Replace(value, "\\", "", -1)))
^
staging/src/k8s.io/client-go/util/jsonpath/jsonpath_test.go:79:3: commentFormatting: put a space between `//` and comment text (gocritic)
//since map is visited in random order, we need to sort the results.
^
staging/src/k8s.io/client-go/util/workqueue/default_rate_limiters.go:94:2: assignOp: replace `r.failures[item] = r.failures[item] + 1` with `r.failures[item]++` (gocritic)
r.failures[item] = r.failures[item] + 1
^
staging/src/k8s.io/client-go/util/workqueue/default_rate_limiters.go:149:2: assignOp: replace `r.failures[item] = r.failures[item] + 1` with `r.failures[item]++` (gocritic)
r.failures[item] = r.failures[item] + 1
^
staging/src/k8s.io/client-go/transport/round_trippers_test.go:385:29: appendAssign: append result not assigned to the same slice (gocritic)
actualExtra[extraKey] = append(actualExtra[key], values...)
^
staging/src/k8s.io/client-go/transport/transport_test.go:396:4: singleCaseSwitch: should rewrite switch statement to if statement (gocritic)
switch {
^
staging/src/k8s.io/client-go/tools/portforward/portforward.go:84:3: ifElseChain: rewrite if-else to switch statement (gocritic)
if len(parts) == 1 {
^
staging/src/k8s.io/client-go/tools/portforward/portforward.go:127:3: ifElseChain: rewrite if-else to switch statement (gocritic)
if address == "localhost" {
^
staging/src/k8s.io/client-go/scale/scheme/extensionsv1beta1/conversion.go:54:2: ifElseChain: rewrite if-else to switch statement (gocritic)
if in.TargetSelector != "" {
^
staging/src/k8s.io/client-go/scale/scheme/appsv1beta2/conversion.go:54:2: ifElseChain: rewrite if-else to switch statement (gocritic)
if in.TargetSelector != "" {
^
staging/src/k8s.io/client-go/scale/scheme/appsv1beta1/conversion.go:54:2: ifElseChain: rewrite if-else to switch statement (gocritic)
if in.TargetSelector != "" {
^
staging/src/k8s.io/client-go/plugin/pkg/client/auth/exec/exec.go:524:2: typeSwitchVar: 1 case can benefit from type switch with assignment (gocritic)
switch err.(type) {
^
staging/src/k8s.io/client-go/tools/auth/exec/exec_test.go:262:4: ifElseChain: rewrite if-else to switch statement (gocritic)
if test.wantErrorPrefix != "" {
^
staging/src/k8s.io/client-go/tools/auth/exec/types_test.go:74:5: ifElseChain: rewrite if-else to switch statement (gocritic)
if !ok {
^
staging/src/k8s.io/client-go/tools/auth/exec/types_test.go:117:5: ifElseChain: rewrite if-else to switch statement (gocritic)
if !ok {
^
staging/src/k8s.io/client-go/testing/fixture.go:239:2: assignOp: replace `listGVK.Kind = listGVK.Kind + "List"` with `listGVK.Kind += "List"` (gocritic)
listGVK.Kind = listGVK.Kind + "List"
^
staging/src/k8s.io/client-go/listers/extensions/v1beta1/daemonset_expansion_test.go:135:3: ifElseChain: rewrite if-else to switch statement (gocritic)
if err != nil && c.expectErr {
^
staging/src/k8s.io/client-go/openapi3/root.go:159:2: ifElseChain: rewrite if-else to switch statement (gocritic)
if apiPrefix == "apis" {
^
staging/src/k8s.io/client-go/tools/cache/delta_fifo.go:463:15: appendAssign: append result not assigned to the same slice (gocritic)
newDeltas := append(oldDeltas, Delta{actionType, obj})
^
staging/src/k8s.io/client-go/tools/cache/reflector_test.go:527:5: assignOp: replace `counter = counter + 1` with `counter++` (gocritic)
counter = counter + 1
^
staging/src/k8s.io/client-go/restmapper/discovery_test.go:442:2: assignOp: replace `c.invalidateCalls = c.invalidateCalls + 1` with `c.invalidateCalls++` (gocritic)
c.invalidateCalls = c.invalidateCalls + 1
^
staging/src/k8s.io/client-go/rest/request.go:564:2: ifElseChain: rewrite if-else to switch statement (gocritic)
if isCoreGroup {
^
staging/src/k8s.io/client-go/rest/request.go:1308:2: singleCaseSwitch: should rewrite switch statement to if statement (gocritic)
switch t := out.(type) {
^
staging/src/k8s.io/client-go/rest/request.go:1355:2: singleCaseSwitch: should rewrite switch statement to if statement (gocritic)
switch t := out.(type) {
^
staging/src/k8s.io/client-go/rest/request.go:1390:2: singleCaseSwitch: should rewrite switch statement to if statement (gocritic)
switch t := out.(type) {
^
staging/src/k8s.io/client-go/rest/urlbackoff.go:95:2: commentFormatting: put a space between `//` and comment text (gocritic)
//If we got this far, there is no backoff required for this URL anymore.
^
staging/src/k8s.io/client-go/rest/request_test.go:1024:11: unlambda: replace `func(err error) bool {
return apierrors.IsForbidden(err)
}` with `apierrors.IsForbidden` (gocritic)
ErrFn: func(err error) bool {
^
staging/src/k8s.io/client-go/rest/request_test.go:1044:11: unlambda: replace `func(err error) bool {
return apierrors.IsForbidden(err)
}` with `apierrors.IsForbidden` (gocritic)
ErrFn: func(err error) bool {
^
staging/src/k8s.io/client-go/rest/request_test.go:1064:11: unlambda: replace `func(err error) bool {
return apierrors.IsUnauthorized(err)
}` with `apierrors.IsUnauthorized` (gocritic)
ErrFn: func(err error) bool {
^
staging/src/k8s.io/client-go/rest/request_test.go:1087:11: unlambda: replace `func(err error) bool {
return apierrors.IsUnauthorized(err)
}` with `apierrors.IsUnauthorized` (gocritic)
ErrFn: func(err error) bool {
^
staging/src/k8s.io/client-go/rest/request_test.go:1161:11: unlambda: replace `func(err error) bool {
return apierrors.IsInternalError(err)
}` with `apierrors.IsInternalError` (gocritic)
ErrFn: func(err error) bool {
^
staging/src/k8s.io/client-go/rest/request_test.go:1336:11: unlambda: replace `func(err error) bool {
return apierrors.IsInternalError(err)
}` with `apierrors.IsInternalError` (gocritic)
ErrFn: func(err error) bool {
^
staging/src/k8s.io/client-go/tools/clientcmd/validation.go:74:2: singleCaseSwitch: should rewrite switch statement to if statement (gocritic)
switch t := err.(type) {
^
staging/src/k8s.io/client-go/tools/clientcmd/main_test.go:32:2: exitAfterDefer: os.Exit will exit, and `defer os.RemoveAll(tmp)` will not run (gocritic)
os.Exit(m.Run())
^
staging/src/k8s.io/client-go/tools/clientcmd/validation_test.go:636:9: elseif: can replace 'else {if cond {}}' with 'else if cond {}' (gocritic)
} else {
^
staging/src/k8s.io/client-go/tools/clientcmd/validation_test.go:699:9: elseif: can replace 'else {if cond {}}' with 'else if cond {}' (gocritic)
} else {
^
staging/src/k8s.io/client-go/tools/clientcmd/validation_test.go:719:9: elseif: can replace 'else {if cond {}}' with 'else if cond {}' (gocritic)
} else {
^
staging/src/k8s.io/client-go/plugin/pkg/client/auth/exec/exec.go:539:8: S1034(related information): could eliminate this type assertion (gosimple)
e := err.(*exec.ExitError)
^
staging/src/k8s.io/client-go/util/flowcontrol/throttle_test.go:171:3: S1038: should use t.Logf(...) instead of t.Log(fmt.Sprintf(...)) (gosimple)
t.Log(fmt.Sprintf("wait err: %v", err))
^
staging/src/k8s.io/client-go/tools/portforward/portforward_test.go:112:2: S1000: should use a simple channel send/receive instead of `select` with a single case (gosimple)
select {
^
staging/src/k8s.io/client-go/tools/remotecommand/remotecommand_test.go:105:2: S1000: should use a simple channel send/receive instead of `select` with a single case (gosimple)
select {
^
staging/src/k8s.io/client-go/discovery/discovery_client.go:208:2: S1011: should replace loop with `groups.Groups = append(groups.Groups, apiGroups.Groups...)` (gosimple)
for _, group := range apiGroups.Groups {
^
staging/src/k8s.io/client-go/tools/cache/delta_fifo.go:510:2: S1011: should replace loop with `list = append(list, f.queue...)` (gosimple)
for _, key := range f.queue {
^
staging/src/k8s.io/client-go/rest/request_test.go:1511:3: S1023: redundant `return` statement (gosimple)
return
^
staging/src/k8s.io/client-go/rest/request_test.go:1300:5: S1008: should use 'return err.Error() == "a container name must be specified for pod kube-dns-v20-mz5cv, choose one of: [kubedns dnsmasq healthz]"' instead of 'if err.Error() == "a container name must be specified for pod kube-dns-v20-mz5cv, choose one of: [kubedns dnsmasq healthz]" { return true }; return false' (gosimple)
if err.Error() == "a container name must be specified for pod kube-dns-v20-mz5cv, choose one of: [kubedns dnsmasq healthz]" {
^
staging/src/k8s.io/client-go/rest/with_retry_test.go:83:5: S1008: should use 'return err == fakeError' instead of 'if err == fakeError { return true }; return false' (gosimple)
if err == fakeError {
^
staging/src/k8s.io/client-go/rest/with_retry_test.go:165:5: S1008: should use 'return err == fakeError' instead of 'if err == fakeError { return true }; return false' (gosimple)
if err == fakeError {
^
staging/src/k8s.io/client-go/tools/cache/reflector.go:881:2: S1008: should use 'return strings.Contains(apierr.Status().Message, "Too large resource version")' instead of 'if strings.Contains(apierr.Status().Message, "Too large resource version") { return true }; return false' (gosimple)
if strings.Contains(apierr.Status().Message, "Too large resource version") {
^
staging/src/k8s.io/client-go/rest/client_test.go:375:96: S1025: the argument is already a string, there's no need to use fmt.Sprintf (gosimple)
status := &metav1.Status{TypeMeta: metav1.TypeMeta{APIVersion: "v1", Kind: "Status"}, Status: fmt.Sprintf("%s", metav1.StatusSuccess)}
^
staging/src/k8s.io/client-go/util/cert/io.go:32:5: S1002: should omit comparison to bool constant, can be simplified to `!certReadable` (gosimple)
if certReadable == false && keyReadable == false {
^
staging/src/k8s.io/client-go/util/cert/io.go:36:5: S1002: should omit comparison to bool constant, can be simplified to `!certReadable` (gosimple)
if certReadable == false {
^
staging/src/k8s.io/client-go/util/cert/io.go:40:5: S1002: should omit comparison to bool constant, can be simplified to `!keyReadable` (gosimple)
if keyReadable == false {
^
staging/src/k8s.io/client-go/util/jsonpath/parser.go:355:7: S1002: should omit comparison to bool constant, can be simplified to `!begin` (gosimple)
if begin == false {
^
staging/src/k8s.io/client-go/rest/config.go:261:8: S1016: should convert c (type TLSClientConfig) to sanitizedTLSClientConfig instead of using struct literal (gosimple)
cc := sanitizedTLSClientConfig{
^
staging/src/k8s.io/client-go/tools/watch/retrywatcher.go:81:47: S1019: should use make(chan watch.Event) instead (gosimple)
resultChan: make(chan watch.Event, 0),
^
staging/src/k8s.io/client-go/tools/watch/retrywatcher_test.go:125:35: S1019: should use make(chan watch.Event) instead (gosimple)
result := make(chan watch.Event, 0)
^
staging/src/k8s.io/client-go/transport/round_trippers_test.go:479:23: S1039: unnecessary use of fmt.Sprintf (gosimple)
lines := []string{fmt.Sprintf("Request Headers:\n")}
^
staging/src/k8s.io/client-go/transport/round_trippers_test.go:494:23: S1039: unnecessary use of fmt.Sprintf (gosimple)
lines := []string{fmt.Sprintf("Response Headers:\n")}
^
staging/src/k8s.io/client-go/transport/round_trippers_test.go:513:34: S1039: unnecessary use of fmt.Sprintf (gosimple)
expectedOutputLines: []string{fmt.Sprintf("curl -v -X")},
^
staging/src/k8s.io/client-go/rest/connection_test.go:67:2: SA2002: the goroutine calls T.Fatalf, which must be called in the same goroutine as the test (staticcheck)
go lb.handleConnection(conn, stopCh)
^
staging/src/k8s.io/client-go/rest/connection_test.go:57:3: SA2002(related information): call to T.Fatalf (staticcheck)
lb.t.Fatalf("failed to close connection: %v", err)
^
staging/src/k8s.io/client-go/rest/connection_test.go:114:2: SA2002: the goroutine calls T.Fatalf, which must be called in the same goroutine as the test (staticcheck)
go lb.serve(stopCh)
^
staging/src/k8s.io/client-go/rest/connection_test.go:64:3: SA2002(related information): call to T.Fatalf (staticcheck)
lb.t.Fatalf("failed to accept: %v", err)
^
staging/src/k8s.io/client-go/rest/connection_test.go:147:2: SA2002: the goroutine calls T.Fatalf, which must be called in the same goroutine as the test (staticcheck)
go lb.serve(stopCh)
^
staging/src/k8s.io/client-go/rest/connection_test.go:188:2: SA2002: the goroutine calls T.Fatalf, which must be called in the same goroutine as the test (staticcheck)
go lb.serve(stopCh)
^
staging/src/k8s.io/client-go/rest/connection_test.go:224:2: SA2002: the goroutine calls T.Fatalf, which must be called in the same goroutine as the test (staticcheck)
go lb.serve(stopCh)
^
staging/src/k8s.io/client-go/rest/connection_test.go:275:2: SA2002: the goroutine calls T.Fatalf, which must be called in the same goroutine as the test (staticcheck)
go lb.serve(stopCh)
^
staging/src/k8s.io/client-go/rest/connection_test.go:323:2: SA2002: the goroutine calls T.Fatalf, which must be called in the same goroutine as the test (staticcheck)
go lb.serve(stopCh)
^
staging/src/k8s.io/client-go/discovery/helper.go:74:20: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
serverVersions := sets.String{}
^
staging/src/k8s.io/client-go/listers/extensions/v1beta1/daemonset_expansion_test.go:36:21: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
outDaemonSetNames sets.String
^
staging/src/k8s.io/client-go/tools/cache/delta_fifo.go:626:15: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
keys := make(sets.String, len(list))
^
staging/src/k8s.io/client-go/tools/cache/expiration_cache_fakes.go:38:18: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
NeverExpire sets.String
^
staging/src/k8s.io/client-go/tools/cache/index.go:95:23: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
type Index map[string]sets.String
^
staging/src/k8s.io/client-go/tools/cache/reflector.go:223:27: SA1019: wait.NewExponentialBackoffManager is deprecated: Will be removed when the legacy Poll methods are removed. Callers should construct a Backoff struct, use DelayWithReset() to get a DelayFunc that periodically resets itself, and then invoke Timer() when calling wait.BackoffUntil. (staticcheck)
backoffManager: wait.NewExponentialBackoffManager(800*time.Millisecond, 30*time.Second, 2*time.Minute, 2.0, 1.0, reflectorClock),
^
staging/src/k8s.io/client-go/tools/cache/reflector.go:224:27: SA1019: wait.NewExponentialBackoffManager is deprecated: Will be removed when the legacy Poll methods are removed. Callers should construct a Backoff struct, use DelayWithReset() to get a DelayFunc that periodically resets itself, and then invoke Timer() when calling wait.BackoffUntil. (staticcheck)
initConnBackoffManager: wait.NewExponentialBackoffManager(800*time.Millisecond, 30*time.Second, 2*time.Minute, 2.0, 1.0, reflectorClock),
^
staging/src/k8s.io/client-go/tools/cache/shared_informer.go:326:9: SA1019: wait.PollImmediateUntil is deprecated: This method does not return errors from context, use PollWithContextCancel. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
err := wait.PollImmediateUntil(syncedPollPeriod,
^
staging/src/k8s.io/client-go/tools/cache/thread_safe_store.go:74:75: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
func (i *storeIndex) getKeysFromIndex(indexName string, obj interface{}) (sets.String, error) {
^
staging/src/k8s.io/client-go/tools/cache/thread_safe_store.go:86:18: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
var storeKeySet sets.String
^
staging/src/k8s.io/client-go/tools/cache/thread_safe_store.go:94:17: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
storeKeySet = sets.String{}
^
staging/src/k8s.io/client-go/tools/cache/thread_safe_store.go:105:70: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
func (i *storeIndex) getKeysByIndex(indexName, indexedValue string) (sets.String, error) {
^
staging/src/k8s.io/client-go/tools/cache/thread_safe_store.go:188:9: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
set = sets.String{}
^
staging/src/k8s.io/client-go/tools/cache/controller_test.go:113:15: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
outputSet := sets.String{}
^
staging/src/k8s.io/client-go/tools/cache/controller_test.go:170:15: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
outputSet := sets.String{}
^
staging/src/k8s.io/client-go/tools/cache/controller_test.go:246:20: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
currentNames := sets.String{}
^
staging/src/k8s.io/client-go/tools/cache/index_test.go:74:25: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
expected := map[string]sets.String{}
^
staging/src/k8s.io/client-go/tools/cache/index_test.go:82:13: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
found := sets.String{}
^
staging/src/k8s.io/client-go/tools/cache/main_test.go:27:2: SA1019: rand.Seed has been deprecated since Go 1.20 and an alternative has been available since Go 1.0: Programs that call Seed and then expect a specific sequence of results from the global random source (using functions such as Int) can be broken when a dependency changes how much it consumes from the global random source. To avoid such breakages, programs that need a specific result sequence should use NewRand(NewSource(seed)) to obtain a random generator that other packages cannot access. (staticcheck)
rand.Seed(time.Now().UnixNano())
^
staging/src/k8s.io/client-go/tools/cache/reflector_test.go:378:11: SA1019: wait.NewExponentialBackoffManager is deprecated: Will be removed when the legacy Poll methods are removed. Callers should construct a Backoff struct, use DelayWithReset() to get a DelayFunc that periodically resets itself, and then invoke Timer() when calling wait.BackoffUntil. (staticcheck)
bm := wait.NewExponentialBackoffManager(time.Millisecond, maxBackoff, 100*time.Millisecond, 2.0, 1.0, fakeClock)
^
staging/src/k8s.io/client-go/tools/cache/shared_informer_test.go:41:20: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
expectedItemNames sets.String
^
staging/src/k8s.io/client-go/tools/cache/shared_informer_test.go:77:9: SA1019: wait.PollImmediate is deprecated: This method does not return errors from context, use PollWithContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
err := wait.PollImmediate(100*time.Millisecond, 2*time.Second, func() (bool, error) {
^
staging/src/k8s.io/client-go/tools/cache/shared_informer_test.go:821:9: SA1019: wait.PollImmediate is deprecated: This method does not return errors from context, use PollWithContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
err := wait.PollImmediate(100*time.Millisecond, 2*time.Second, func() (bool, error) {
^
staging/src/k8s.io/client-go/tools/cache/store_test.go:58:12: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
found := sets.String{}
^
staging/src/k8s.io/client-go/tools/cache/store_test.go:77:12: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
found := sets.String{}
^
staging/src/k8s.io/client-go/tools/cache/store_test.go:97:25: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
expected := map[string]sets.String{}
^
staging/src/k8s.io/client-go/tools/cache/store_test.go:107:13: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
found := sets.String{}
^
staging/src/k8s.io/client-go/tools/events/eventseries_test.go:207:9: SA1019: wait.PollImmediate is deprecated: This method does not return errors from context, use PollWithContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
err := wait.PollImmediate(100*time.Millisecond, 5*time.Second, func() (done bool, err error) {
^
staging/src/k8s.io/client-go/tools/leaderelection/leaderelection.go:269:10: SA1019: wait.PollImmediateUntil is deprecated: This method does not return errors from context, use PollWithContextCancel. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
err := wait.PollImmediateUntil(le.config.RetryPeriod, func() (bool, error) {
^
staging/src/k8s.io/client-go/tools/pager/pager.go:124:4: SA1019: list.SelfLink is deprecated: selfLink is a legacy read-only field that is no longer populated by the system. +optional (staticcheck)
list.SelfLink = m.GetSelfLink()
^
staging/src/k8s.io/client-go/tools/record/events_cache.go:230:12: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
localKeys sets.String
^
staging/src/k8s.io/client-go/tools/record/main_test.go:27:2: SA1019: rand.Seed has been deprecated since Go 1.20 and an alternative has been available since Go 1.0: Programs that call Seed and then expect a specific sequence of results from the global random source (using functions such as Int) can be broken when a dependency changes how much it consumes from the global random source. To avoid such breakages, programs that need a specific result sequence should use NewRand(NewSource(seed)) to obtain a random generator that other packages cannot access. (staticcheck)
rand.Seed(time.Now().UnixNano())
^
staging/src/k8s.io/client-go/tools/watch/until.go:89:23: SA1019: wait.ErrWaitTimeout is deprecated: This type will be made private in favor of Interrupted() for checking errors or ErrorInterrupted(err) for returning a wrapped error. (staticcheck)
return lastEvent, wait.ErrWaitTimeout
^
staging/src/k8s.io/client-go/tools/watch/retrywatcher_test.go:556:10: SA1019: wait.PollImmediate is deprecated: This method does not return errors from context, use PollWithContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
err = wait.PollImmediate(10*time.Millisecond, 10*time.Second, func() (done bool, err error) {
^
staging/src/k8s.io/client-go/tools/watch/retrywatcher_test.go:560:14: SA1019: wait.ErrWaitTimeout is deprecated: This type will be made private in favor of Interrupted() for checking errors or ErrorInterrupted(err) for returning a wrapped error. (staticcheck)
if err == wait.ErrWaitTimeout {
^
staging/src/k8s.io/client-go/tools/watch/until_test.go:119:12: SA1019: wait.ErrWaitTimeout is deprecated: This type will be made private in favor of Interrupted() for checking errors or ErrorInterrupted(err) for returning a wrapped error. (staticcheck)
if err != wait.ErrWaitTimeout {
^
staging/src/k8s.io/client-go/tools/watch/until_test.go:212:19: SA1019: wait.ErrWaitTimeout is deprecated: This type will be made private in favor of Interrupted() for checking errors or ErrorInterrupted(err) for returning a wrapped error. (staticcheck)
expectedErr: wait.ErrWaitTimeout,
^
staging/src/k8s.io/client-go/util/certificate/csr/csr.go:192:16: SA1019: wait.ErrWaitTimeout is deprecated: This type will be made private in favor of Interrupted() for checking errors or ErrorInterrupted(err) for returning a wrapped error. (staticcheck)
return nil, wait.ErrWaitTimeout
^
staging/src/k8s.io/client-go/util/certificate/csr/csr.go:216:16: SA1019: wait.ErrWaitTimeout is deprecated: This type will be made private in favor of Interrupted() for checking errors or ErrorInterrupted(err) for returning a wrapped error. (staticcheck)
return nil, wait.ErrWaitTimeout
^
staging/src/k8s.io/client-go/util/certificate/csr/csr.go:296:12: SA1019: wait.ErrWaitTimeout is deprecated: This type will be made private in favor of Interrupted() for checking errors or ErrorInterrupted(err) for returning a wrapped error. (staticcheck)
if err == wait.ErrWaitTimeout {
^
staging/src/k8s.io/client-go/util/certificate/csr/csr.go:297:15: SA1019: wait.ErrWaitTimeout is deprecated: This type will be made private in favor of Interrupted() for checking errors or ErrorInterrupted(err) for returning a wrapped error. (staticcheck)
return nil, wait.ErrWaitTimeout
^
staging/src/k8s.io/client-go/rest/urlbackoff_test.go:69:3: ST1011: var backoffSec is of type time.Duration; don't use unit-specific suffix "Sec" (stylecheck)
backoffSec := myBackoff.CalculateBackoff(parse("http://1.2.3.4:100"))
^
staging/src/k8s.io/client-go/tools/leaderelection/resourcelock/interface.go:209:15: ST1005: error strings should not be capitalized (stylecheck)
return nil, fmt.Errorf("Invalid lock-type %s", lockType)
^
staging/src/k8s.io/client-go/plugin/pkg/client/auth/azure/azure_stub.go:33:14: ST1005: error strings should not be capitalized (stylecheck)
return nil, errors.New(`The azure auth plugin has been removed.
^
staging/src/k8s.io/client-go/plugin/pkg/client/auth/gcp/gcp_stub.go:33:14: ST1005: error strings should not be capitalized (stylecheck)
return nil, errors.New(`The gcp auth plugin has been removed.
^
staging/src/k8s.io/client-go/discovery/discovery_client.go:282:25: ST1005: error strings should not be capitalized (stylecheck)
return nil, nil, nil, fmt.Errorf("Unknown discovery response content-type: %s", responseContentType)
^
staging/src/k8s.io/client-go/discovery/discovery_client.go:330:25: ST1005: error strings should not be capitalized (stylecheck)
return nil, nil, nil, fmt.Errorf("Unknown discovery response content-type: %s", responseContentType)
^
staging/src/k8s.io/client-go/openapi3/root.go:156:14: ST1005: error strings should not be capitalized (stylecheck)
return gv, fmt.Errorf("Unable to parse api relative path: %s", path)
^
staging/src/k8s.io/client-go/openapi3/root.go:162:15: ST1005: error strings should not be capitalized (stylecheck)
return gv, fmt.Errorf("Group without Version not allowed")
^
staging/src/k8s.io/client-go/openapi3/root.go:169:14: ST1005: error strings should not be capitalized (stylecheck)
return gv, fmt.Errorf("Unable to parse api relative path: %s", path)
^
staging/src/k8s.io/client-go/plugin/pkg/client/auth/oidc/oidc.go:114:15: ST1005: error strings should not be capitalized (stylecheck)
return nil, fmt.Errorf("Must provide %s", cfgIssuerURL)
^
staging/src/k8s.io/client-go/plugin/pkg/client/auth/oidc/oidc.go:119:15: ST1005: error strings should not be capitalized (stylecheck)
return nil, fmt.Errorf("Must provide %s", cfgClientID)
^
staging/src/k8s.io/client-go/plugin/pkg/client/auth/oidc/oidc.go:239:14: ST1005: error strings should not be capitalized (stylecheck)
return "", errors.New("No valid id-token, and cannot refresh without refresh-token")
^
staging/src/k8s.io/client-go/tools/cache/delta_fifo.go:482:10: ST1005: error strings should not be capitalized (stylecheck)
return fmt.Errorf("Impossible dedupDeltas for id=%q: oldDeltas=%#+v, obj=%#+v; broke DeltaFIFO invariant by storing empty Deltas", id, oldDeltas, obj)
^
staging/src/k8s.io/client-go/tools/clientcmd/helpers.go:35:12: ST1005: error strings should not be capitalized (stylecheck)
return 0, fmt.Errorf("Invalid timeout value. Timeout must be a single integer in seconds, or an integer followed by a corresponding time unit (e.g. 1s | 2m | 3h)")
^
staging/src/k8s.io/client-go/tools/clientcmd/validation.go:248:47: ST1005: error strings should not end with punctuation or newlines (stylecheck)
validationErrors = append(validationErrors, fmt.Errorf("certificate-authority-data and certificate-authority are both specified for %v. certificate-authority-data will override.", clusterName))
^
staging/src/k8s.io/client-go/tools/clientcmd/validation.go:278:48: ST1005: error strings should not end with punctuation or newlines (stylecheck)
validationErrors = append(validationErrors, fmt.Errorf("client-cert-data and client-cert are both specified for %v. client-cert-data will override.", authInfoName))
^
staging/src/k8s.io/client-go/tools/clientcmd/validation.go:286:48: ST1005: error strings should not end with punctuation or newlines (stylecheck)
validationErrors = append(validationErrors, fmt.Errorf("client-key-data or client-key must be specified for %v to use the clientCert authentication method.", authInfoName))
^
staging/src/k8s.io/client-go/tools/leaderelection/leaderelection.go:100:15: ST1005: error strings should not end with punctuation or newlines (stylecheck)
return nil, fmt.Errorf("Lock must not be nil.")
^
staging/src/k8s.io/client-go/tools/remotecommand/v1.go:115:17: ST1005: error strings should not be capitalized (stylecheck)
errorChan <- fmt.Errorf("Error reading from error stream: %s", err)
^
staging/src/k8s.io/client-go/tools/remotecommand/v1.go:119:17: ST1005: error strings should not be capitalized (stylecheck)
errorChan <- fmt.Errorf("Error executing remote command: %s", message)
^
staging/src/k8s.io/client-go/discovery/cached/disk/cached_discovery_test.go:780:31: ST1016: methods on the same type should have the same receiver name (seen 2x "d", 9x "c") (stylecheck)
func (c *fakeDiscoveryClient) OpenAPISchema() (*openapi_v2.Document, error) {
^
staging/src/k8s.io/client-go/restmapper/discovery_test.go:417:30: ST1016: methods on the same type should have the same receiver name (seen 2x "c", 5x "d") (stylecheck)
func (*fakeFailingDiscovery) OpenAPISchema() (*openapi_v2.Document, error) {
^
staging/src/k8s.io/client-go/scale/scheme/appsv1beta1/conversion.go:28:6: ST1003: should not use underscores in Go names; func Convert_scheme_ScaleStatus_To_v1beta1_ScaleStatus should be ConvertSchemeScaleStatusToV1beta1ScaleStatus (stylecheck)
func Convert_scheme_ScaleStatus_To_v1beta1_ScaleStatus(in *scheme.ScaleStatus, out *v1beta1.ScaleStatus, s conversion.Scope) error {
^
staging/src/k8s.io/client-go/scale/scheme/appsv1beta1/conversion.go:47:6: ST1003: should not use underscores in Go names; func Convert_v1beta1_ScaleStatus_To_scheme_ScaleStatus should be ConvertV1beta1ScaleStatusToSchemeScaleStatus (stylecheck)
func Convert_v1beta1_ScaleStatus_To_scheme_ScaleStatus(in *v1beta1.ScaleStatus, out *scheme.ScaleStatus, s conversion.Scope) error {
^
staging/src/k8s.io/client-go/scale/scheme/appsv1beta2/conversion.go:28:6: ST1003: should not use underscores in Go names; func Convert_scheme_ScaleStatus_To_v1beta2_ScaleStatus should be ConvertSchemeScaleStatusToV1beta2ScaleStatus (stylecheck)
func Convert_scheme_ScaleStatus_To_v1beta2_ScaleStatus(in *scheme.ScaleStatus, out *v1beta2.ScaleStatus, s conversion.Scope) error {
^
staging/src/k8s.io/client-go/scale/scheme/appsv1beta2/conversion.go:47:6: ST1003: should not use underscores in Go names; func Convert_v1beta2_ScaleStatus_To_scheme_ScaleStatus should be ConvertV1beta2ScaleStatusToSchemeScaleStatus (stylecheck)
func Convert_v1beta2_ScaleStatus_To_scheme_ScaleStatus(in *v1beta2.ScaleStatus, out *scheme.ScaleStatus, s conversion.Scope) error {
^
staging/src/k8s.io/client-go/scale/scheme/autoscalingv1/conversion.go:28:6: ST1003: should not use underscores in Go names; func Convert_scheme_ScaleStatus_To_v1_ScaleStatus should be ConvertSchemeScaleStatusToV1ScaleStatus (stylecheck)
func Convert_scheme_ScaleStatus_To_v1_ScaleStatus(in *scheme.ScaleStatus, out *v1.ScaleStatus, s conversion.Scope) error {
^
staging/src/k8s.io/client-go/scale/scheme/autoscalingv1/conversion.go:42:6: ST1003: should not use underscores in Go names; func Convert_v1_ScaleStatus_To_scheme_ScaleStatus should be ConvertV1ScaleStatusToSchemeScaleStatus (stylecheck)
func Convert_v1_ScaleStatus_To_scheme_ScaleStatus(in *v1.ScaleStatus, out *scheme.ScaleStatus, s conversion.Scope) error {
^
staging/src/k8s.io/client-go/scale/scheme/extensionsv1beta1/conversion.go:28:6: ST1003: should not use underscores in Go names; func Convert_scheme_ScaleStatus_To_v1beta1_ScaleStatus should be ConvertSchemeScaleStatusToV1beta1ScaleStatus (stylecheck)
func Convert_scheme_ScaleStatus_To_v1beta1_ScaleStatus(in *scheme.ScaleStatus, out *v1beta1.ScaleStatus, s conversion.Scope) error {
^
staging/src/k8s.io/client-go/scale/scheme/extensionsv1beta1/conversion.go:47:6: ST1003: should not use underscores in Go names; func Convert_v1beta1_ScaleStatus_To_scheme_ScaleStatus should be ConvertV1beta1ScaleStatusToSchemeScaleStatus (stylecheck)
func Convert_v1beta1_ScaleStatus_To_scheme_ScaleStatus(in *v1beta1.ScaleStatus, out *scheme.ScaleStatus, s conversion.Scope) error {
^
staging/src/k8s.io/client-go/discovery/discovery_client_test.go:2035:3: ST1003: struct field coreHttpStatus should be coreHTTPStatus (stylecheck)
coreHttpStatus int
^
staging/src/k8s.io/client-go/discovery/discovery_client_test.go:2037:3: ST1003: struct field apisHttpStatus should be apisHTTPStatus (stylecheck)
apisHttpStatus int
^
staging/src/k8s.io/client-go/rest/url_utils.go:82:6: ST1003: func defaultServerUrlFor should be defaultServerURLFor (stylecheck)
func defaultServerUrlFor(config *Config) (*url.URL, string, error) {
^
staging/src/k8s.io/client-go/rest/urlbackoff.go:36:16: ST1003: interface method parameter actualUrl should be actualURL (stylecheck)
UpdateBackoff(actualUrl *url.URL, err error, responseCode int)
^
staging/src/k8s.io/client-go/rest/urlbackoff.go:37:19: ST1003: interface method parameter actualUrl should be actualURL (stylecheck)
CalculateBackoff(actualUrl *url.URL) time.Duration
^
staging/src/k8s.io/client-go/rest/urlbackoff.go:52:35: ST1003: method parameter actualUrl should be actualURL (stylecheck)
func (n *NoBackoff) UpdateBackoff(actualUrl *url.URL, err error, responseCode int) {
^
staging/src/k8s.io/client-go/rest/urlbackoff.go:56:38: ST1003: method parameter actualUrl should be actualURL (stylecheck)
func (n *NoBackoff) CalculateBackoff(actualUrl *url.URL) time.Duration {
^
staging/src/k8s.io/client-go/rest/urlbackoff.go:73:22: ST1003: method baseUrlKey should be baseURLKey (stylecheck)
func (b *URLBackoff) baseUrlKey(rawurl *url.URL) string {
^
staging/src/k8s.io/client-go/rest/urlbackoff.go:86:36: ST1003: method parameter actualUrl should be actualURL (stylecheck)
func (b *URLBackoff) UpdateBackoff(actualUrl *url.URL, err error, responseCode int) {
^
staging/src/k8s.io/client-go/rest/urlbackoff.go:101:39: ST1003: method parameter actualUrl should be actualURL (stylecheck)
func (b *URLBackoff) CalculateBackoff(actualUrl *url.URL) time.Duration {
^
staging/src/k8s.io/client-go/rest/client_test.go:340:2: ST1003: var theUrl should be theURL (stylecheck)
theUrl, _ := url.Parse("http://localhost")
^
staging/src/k8s.io/client-go/rest/request_test.go:1548:44: ST1003: method parameter actualUrl should be actualURL (stylecheck)
func (b *testBackoffManager) UpdateBackoff(actualUrl *url.URL, err error, responseCode int) {
^
staging/src/k8s.io/client-go/rest/request_test.go:1551:47: ST1003: method parameter actualUrl should be actualURL (stylecheck)
func (b *testBackoffManager) CalculateBackoff(actualUrl *url.URL) time.Duration {
^
staging/src/k8s.io/client-go/rest/request_test.go:3026:69: ST1003: method parameter actualUrl should be actualURL (stylecheck)
func (lb *withRateLimiterBackoffManagerAndMetrics) CalculateBackoff(actualUrl *url.URL) time.Duration {
^
staging/src/k8s.io/client-go/rest/request_test.go:3034:66: ST1003: method parameter actualUrl should be actualURL (stylecheck)
func (lb *withRateLimiterBackoffManagerAndMetrics) UpdateBackoff(actualUrl *url.URL, err error, responseCode int) {
^
staging/src/k8s.io/client-go/rest/urlbackoff_test.go:28:2: ST1003: var theUrl should be theURL (stylecheck)
theUrl, _ := url.Parse(raw)
^
staging/src/k8s.io/client-go/tools/cache/delta_fifo.go:306:21: ST1003: should not use underscores in Go names; method hasSynced_locked should be hasSyncedLocked (stylecheck)
func (f *DeltaFIFO) hasSynced_locked() bool {
^
staging/src/k8s.io/client-go/tools/cache/fifo.go:158:16: ST1003: should not use underscores in Go names; method hasSynced_locked should be hasSyncedLocked (stylecheck)
func (f *FIFO) hasSynced_locked() bool {
^
staging/src/k8s.io/client-go/tools/clientcmd/client_config.go:616:27: ST1003: func parameter masterUrl should be masterURL (stylecheck)
func BuildConfigFromFlags(masterUrl, kubeconfigPath string) (*restclient.Config, error) {
^
staging/src/k8s.io/client-go/tools/clientcmd/client_config.go:632:38: ST1003: func parameter masterUrl should be masterURL (stylecheck)
func BuildConfigFromKubeconfigGetter(masterUrl string, kubeconfigGetter KubeconfigGetter) (*restclient.Config, error) {
^
running ( cd /nvme/gopath/src/k8s.io/kubernetes/staging/src/k8s.io/cli-runtime; env LOGCHECK_CONFIG=/nvme/gopath/src/k8s.io/kubernetes/hack/logcheck.conf /nvme/gopath/src/k8s.io/kubernetes/_output/local/bin/golangci-lint run --config=/nvme/gopath/src/k8s.io/kubernetes/hack/golangci-strict.yaml --path-prefix staging/src/k8s.io/cli-runtime ./... )
staging/src/k8s.io/cli-runtime/pkg/printers/json_test.go:87:18: Error return value of `printer.PrintObj` is not checked (errcheck)
printer.PrintObj(obj, buf)
^
staging/src/k8s.io/cli-runtime/pkg/printers/tableprinter.go:222:18: Error return value is not checked (errcheck)
WriteEscaped(output, print)
^
staging/src/k8s.io/cli-runtime/pkg/printers/tableprinter.go:227:18: Error return value is not checked (errcheck)
WriteEscaped(output, fmt.Sprint(val))
^
staging/src/k8s.io/cli-runtime/pkg/printers/tableprinter.go:431:14: Error return value is not checked (errcheck)
printHeader(headers, output)
^
staging/src/k8s.io/cli-runtime/pkg/printers/tableprinter.go:489:18: Error return value of `output.Write` is not checked (errcheck)
output.Write([]byte("\t"))
^
staging/src/k8s.io/cli-runtime/pkg/printers/tableprinter.go:490:18: Error return value of `output.Write` is not checked (errcheck)
output.Write([]byte(value))
^
staging/src/k8s.io/cli-runtime/pkg/printers/tableprinter.go:495:15: Error return value of `output.Write` is not checked (errcheck)
output.Write([]byte("\n"))
^
staging/src/k8s.io/cli-runtime/pkg/printers/tableprinter_test.go:91:19: Error return value of `printer.PrintObj` is not checked (errcheck)
printer.PrintObj(table, out)
^
staging/src/k8s.io/cli-runtime/pkg/printers/tableprinter_test.go:190:19: Error return value of `printer.PrintObj` is not checked (errcheck)
printer.PrintObj(table, out)
^
staging/src/k8s.io/cli-runtime/pkg/printers/tableprinter_test.go:287:19: Error return value of `printer.PrintObj` is not checked (errcheck)
printer.PrintObj(table, out)
^
staging/src/k8s.io/cli-runtime/pkg/printers/tableprinter_test.go:333:19: Error return value of `printer.PrintObj` is not checked (errcheck)
printer.PrintObj(table, out)
^
staging/src/k8s.io/cli-runtime/pkg/printers/tableprinter_test.go:378:19: Error return value of `printer.PrintObj` is not checked (errcheck)
printer.PrintObj(table, out)
^
staging/src/k8s.io/cli-runtime/pkg/printers/tableprinter_test.go:465:19: Error return value of `printer.PrintObj` is not checked (errcheck)
printer.PrintObj(table, out)
^
staging/src/k8s.io/cli-runtime/pkg/printers/tableprinter_test.go:524:19: Error return value of `printer.PrintObj` is not checked (errcheck)
printer.PrintObj(test.object, out)
^
staging/src/k8s.io/cli-runtime/pkg/printers/tableprinter_test.go:592:19: Error return value of `printer.PrintObj` is not checked (errcheck)
printer.PrintObj(event, out)
^
staging/src/k8s.io/cli-runtime/pkg/printers/tableprinter_test.go:694:19: Error return value of `printer.PrintObj` is not checked (errcheck)
printer.PrintObj(test.object, out)
^
staging/src/k8s.io/cli-runtime/pkg/printers/tableprinter_test.go:797:19: Error return value of `printer.PrintObj` is not checked (errcheck)
printer.PrintObj(table, out)
^
staging/src/k8s.io/cli-runtime/pkg/resource/builder_test.go:71:13: Error return value of `enc.Encode` is not checked (errcheck)
enc.Encode(&e)
^
staging/src/k8s.io/cli-runtime/pkg/resource/builder_test.go:147:10: Error return value of `w.Write` is not checked (errcheck)
w.Write([]byte(runtime.EncodeOrDie(corev1Codec, pods)))
^
staging/src/k8s.io/cli-runtime/pkg/resource/builder_test.go:148:10: Error return value of `w.Write` is not checked (errcheck)
w.Write([]byte(runtime.EncodeOrDie(corev1Codec, svc)))
^
staging/src/k8s.io/cli-runtime/pkg/resource/builder_test.go:174:10: Error return value of `w.Write` is not checked (errcheck)
w.Write(JSONToYAMLOrDie([]byte(runtime.EncodeOrDie(corev1Codec, pods))))
^
staging/src/k8s.io/cli-runtime/pkg/resource/builder_test.go:175:10: Error return value of `w.Write` is not checked (errcheck)
w.Write([]byte("\n---\n"))
^
staging/src/k8s.io/cli-runtime/pkg/resource/builder_test.go:176:10: Error return value of `w.Write` is not checked (errcheck)
w.Write(JSONToYAMLOrDie([]byte(runtime.EncodeOrDie(corev1Codec, svc))))
^
staging/src/k8s.io/cli-runtime/pkg/resource/builder_test.go:185:10: Error return value of `w.Write` is not checked (errcheck)
w.Write([]byte(runtime.EncodeOrDie(corev1Codec, obj)))
^
staging/src/k8s.io/cli-runtime/pkg/resource/builder_test.go:404:10: Error return value of `w.Write` is not checked (errcheck)
w.Write([]byte(runtime.EncodeOrDie(corev1Codec, node)))
^
staging/src/k8s.io/cli-runtime/pkg/resource/builder_test.go:863:10: Error return value of `w.Write` is not checked (errcheck)
w.Write([]byte(runtime.EncodeOrDie(corev1Codec, &v1.Pod{ObjectMeta: metav1.ObjectMeta{Namespace: "foo", Name: "test"}})))
^
staging/src/k8s.io/cli-runtime/pkg/resource/builder_test.go:893:10: Error return value of `w.Write` is not checked (errcheck)
w.Write([]byte(runtime.EncodeOrDie(corev1Codec, &v1.Pod{ObjectMeta: metav1.ObjectMeta{Namespace: "foo", Name: "test"}})))
^
staging/src/k8s.io/cli-runtime/pkg/resource/builder_test.go:894:10: Error return value of `w.Write` is not checked (errcheck)
w.Write([]byte(runtime.EncodeOrDie(corev1Codec, &v1.Pod{ObjectMeta: metav1.ObjectMeta{Namespace: "foo", Name: "test1"}})))
^
staging/src/k8s.io/cli-runtime/pkg/resource/builder_test.go:923:10: Error return value of `w.Write` is not checked (errcheck)
w.Write([]byte(runtime.EncodeOrDie(corev1Codec, &v1.Pod{ObjectMeta: metav1.ObjectMeta{Namespace: "foo", Name: "test"}})))
^
staging/src/k8s.io/cli-runtime/pkg/resource/builder_test.go:1791:10: Error return value of `w.Write` is not checked (errcheck)
w.Write([]byte(`{}`))
^
staging/src/k8s.io/cli-runtime/pkg/resource/builder_test.go:1792:10: Error return value of `w.Write` is not checked (errcheck)
w.Write([]byte(runtime.EncodeOrDie(corev1Codec, &pods.Items[0])))
^
staging/src/k8s.io/cli-runtime/pkg/resource/builder_test.go:1798:11: Error return value of `w2.Write` is not checked (errcheck)
w2.Write([]byte(`{}`))
^
staging/src/k8s.io/cli-runtime/pkg/resource/builder_test.go:1799:11: Error return value of `w2.Write` is not checked (errcheck)
w2.Write([]byte(runtime.EncodeOrDie(corev1Codec, &svc.Items[0])))
^
staging/src/k8s.io/cli-runtime/pkg/resource/helper_test.go:848:34: Error return value of `metadataAccessor.SetContinue` is not checked (errcheck)
metadataAccessor.SetContinue(&obj, "abc")
^
staging/src/k8s.io/cli-runtime/pkg/resource/helper_test.go:850:34: Error return value of `metadataAccessor.SetContinue` is not checked (errcheck)
metadataAccessor.SetContinue(&obj, "def")
^
staging/src/k8s.io/cli-runtime/pkg/resource/helper_test.go:852:30: Error return value of `metadataAccessor.SetKind` is not checked (errcheck)
metadataAccessor.SetKind(&obj, "ListComplete")
^
staging/src/k8s.io/cli-runtime/pkg/resource/helper_test.go:866:34: Error return value of `metadataAccessor.SetContinue` is not checked (errcheck)
metadataAccessor.SetContinue(&obj, "abc")
^
staging/src/k8s.io/cli-runtime/pkg/resource/helper_test.go:870:30: Error return value of `metadataAccessor.SetKind` is not checked (errcheck)
metadataAccessor.SetKind(&obj, "ListComplete")
^
staging/src/k8s.io/cli-runtime/pkg/resource/kustomizevisitor_test.go:136:16: Error return value of `fSys.WriteFile` is not checked (errcheck)
fSys.WriteFile(
^
staging/src/k8s.io/cli-runtime/pkg/resource/kustomizevisitor_test.go:139:16: Error return value of `fSys.WriteFile` is not checked (errcheck)
fSys.WriteFile("deployment.yaml", []byte(deploymentContent))
^
staging/src/k8s.io/cli-runtime/pkg/resource/kustomizevisitor_test.go:140:16: Error return value of `fSys.WriteFile` is not checked (errcheck)
fSys.WriteFile("namespace.yaml", []byte(namespaceContent))
^
staging/src/k8s.io/cli-runtime/pkg/resource/kustomizevisitor_test.go:141:16: Error return value of `fSys.WriteFile` is not checked (errcheck)
fSys.WriteFile("jsonpatch.json", []byte(jsonpatchContent))
^
staging/src/k8s.io/cli-runtime/pkg/resource/visitor.go:610:24: Error return value is not checked (errcheck)
UpdateObjectNamespace(info, nil)
^
staging/src/k8s.io/cli-runtime/pkg/resource/visitor.go:627:25: Error return value is not checked (errcheck)
UpdateObjectNamespace(info, nil)
^
staging/src/k8s.io/cli-runtime/pkg/resource/visitor.go:647:25: Error return value is not checked (errcheck)
UpdateObjectNamespace(info, nil)
^
staging/src/k8s.io/cli-runtime/pkg/genericclioptions/filename_flags.go:76:22: Error return value of `flags.SetAnnotation` is not checked (errcheck)
flags.SetAnnotation("filename", cobra.BashCompFilenameExt, annotations)
^
staging/src/k8s.io/cli-runtime/pkg/genericclioptions/jsonpath_flags.go:123:21: Error return value of `c.MarkFlagFilename` is not checked (errcheck)
c.MarkFlagFilename("template")
^
staging/src/k8s.io/cli-runtime/pkg/genericclioptions/kube_template_flags.go:68:21: Error return value of `c.MarkFlagFilename` is not checked (errcheck)
c.MarkFlagFilename("template")
^
staging/src/k8s.io/cli-runtime/pkg/genericclioptions/record_flags.go:96:29: Error return value of `(*github.com/spf13/pflag.FlagSet).MarkDeprecated` is not checked (errcheck)
cmd.Flags().MarkDeprecated("record", "--record will be removed in the future")
^
staging/src/k8s.io/cli-runtime/pkg/genericclioptions/template_flags.go:119:21: Error return value of `c.MarkFlagFilename` is not checked (errcheck)
c.MarkFlagFilename("template")
^
staging/src/k8s.io/cli-runtime/pkg/printers/name.go:46:2: singleCaseSwitch: should rewrite switch statement to if statement (gocritic)
switch castObj := obj.(type) {
^
staging/src/k8s.io/cli-runtime/pkg/printers/tableprinter.go:475:11: elseif: can replace 'else {if cond {}}' with 'else if cond {}' (gocritic)
} else {
^
staging/src/k8s.io/cli-runtime/pkg/resource/builder.go:1018:10: elseif: can replace 'else {if cond {}}' with 'else if cond {}' (gocritic)
} else {
^
staging/src/k8s.io/cli-runtime/pkg/resource/builder.go:1081:9: elseif: can replace 'else {if cond {}}' with 'else if cond {}' (gocritic)
} else {
^
staging/src/k8s.io/cli-runtime/pkg/resource/crd_finder.go:51:23: underef: could simplify (*list).Items to list.Items (gocritic)
for _, crd := range (*list).Items {
^
staging/src/k8s.io/cli-runtime/pkg/resource/builder_test.go:481:10: elseif: can replace 'else {if cond {}}' with 'else if cond {}' (gocritic)
} else {
^
staging/src/k8s.io/cli-runtime/pkg/resource/builder_test.go:501:73: wrapperFunc: use strings.ReplaceAll method in `strings.Replace(aPod, "{id}", "0", -1)` (gocritic)
writeTestFile(t, fmt.Sprintf("%s/recursive/pod/busybox.json", tmpDir), strings.Replace(aPod, "{id}", "0", -1))
^
staging/src/k8s.io/cli-runtime/pkg/resource/builder_test.go:505:74: wrapperFunc: use strings.ReplaceAll method in `strings.Replace(aPod, "{id}", "0", -1)` (gocritic)
writeTestFile(t, fmt.Sprintf("%s/inode/hardlink/busybox.json", tmpDir), strings.Replace(aPod, "{id}", "0", -1))
^
staging/src/k8s.io/cli-runtime/pkg/resource/builder_test.go:567:77: wrapperFunc: use strings.ReplaceAll method in `strings.Replace(aPod, "{id}", "0", -1)` (gocritic)
writeTestFile(t, fmt.Sprintf("%s/inode/symlink/pod/busybox.json", tmpDir), strings.Replace(aPod, "{id}", "0", -1))
^
staging/src/k8s.io/cli-runtime/pkg/resource/builder_test.go:502:79: wrapperFunc: use strings.ReplaceAll method in `strings.Replace(aPod, "{id}", "1", -1)` (gocritic)
writeTestFile(t, fmt.Sprintf("%s/recursive/pod/pod_1/busybox.json", tmpDir), strings.Replace(aPod, "{id}", "1", -1))
^
staging/src/k8s.io/cli-runtime/pkg/resource/builder_test.go:503:72: wrapperFunc: use strings.ReplaceAll method in `strings.Replace(aRC, "{id}", "0", -1)` (gocritic)
writeTestFile(t, fmt.Sprintf("%s/recursive/rc/busybox.json", tmpDir), strings.Replace(aRC, "{id}", "0", -1))
^
staging/src/k8s.io/cli-runtime/pkg/resource/builder_test.go:504:77: wrapperFunc: use strings.ReplaceAll method in `strings.Replace(aRC, "{id}", "1", -1)` (gocritic)
writeTestFile(t, fmt.Sprintf("%s/recursive/rc/rc_1/busybox.json", tmpDir), strings.Replace(aRC, "{id}", "1", -1))
^
staging/src/k8s.io/cli-runtime/pkg/resource/visitor_test.go:340:5: singleCaseSwitch: should rewrite switch statement to if statement (gocritic)
switch e := err.(type) {
^
staging/src/k8s.io/cli-runtime/pkg/genericclioptions/jsonpath_flags.go:71:4: assignOp: replace `format = format + "="` with `format += "="` (gocritic)
format = format + "="
^
staging/src/k8s.io/cli-runtime/pkg/genericclioptions/record_flags.go:184:4: assignOp: replace `flags = flags + "=CLASSIFIED"` with `flags += "=CLASSIFIED"` (gocritic)
flags = flags + "=CLASSIFIED"
^
staging/src/k8s.io/cli-runtime/pkg/genericclioptions/template_flags.go:72:4: assignOp: replace `format = format + "="` with `format += "="` (gocritic)
format = format + "="
^
staging/src/k8s.io/cli-runtime/pkg/genericclioptions/record_flags.go:188:2: S1021: should merge variable declaration with assignment on next line (gosimple)
var err error
^
staging/src/k8s.io/cli-runtime/pkg/resource/builder_test.go:1727:2: S1000: should use a simple channel send/receive instead of `select` with a single case (gosimple)
select {
^
staging/src/k8s.io/cli-runtime/pkg/genericclioptions/io_options.go:22:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
staging/src/k8s.io/cli-runtime/pkg/genericclioptions/jsonpath_flags.go:21:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
staging/src/k8s.io/cli-runtime/pkg/genericclioptions/template_flags.go:21:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
staging/src/k8s.io/cli-runtime/pkg/genericclioptions/jsonpath_flags_test.go:22:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
staging/src/k8s.io/cli-runtime/pkg/genericclioptions/template_flags_test.go:22:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
staging/src/k8s.io/cli-runtime/pkg/resource/result.go:147:14: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
versions := sets.String{}
^
staging/src/k8s.io/cli-runtime/pkg/resource/builder_test.go:24:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
staging/src/k8s.io/cli-runtime/pkg/resource/helper_test.go:24:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
staging/src/k8s.io/cli-runtime/pkg/resource/visitor_test.go:25:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
staging/src/k8s.io/cli-runtime/pkg/printers/jsonpath.go:144:10: ST1005: error strings should not end with punctuation or newlines (stylecheck)
return fmt.Errorf("error executing jsonpath %q: %v\n", j.rawTemplate, buf.String())
^
staging/src/k8s.io/cli-runtime/pkg/resource/builder.go:116:28: ST1005: error strings should not be capitalized (stylecheck)
var missingResourceError = fmt.Errorf(`You must provide one or more resources by argument or filename.
^
staging/src/k8s.io/cli-runtime/pkg/resource/helper.go:156:11: ST1005: error strings should not be capitalized (stylecheck)
return fmt.Errorf("Unable to list %q: %v", subj, err)
^
staging/src/k8s.io/cli-runtime/pkg/resource/helper.go:158:10: ST1005: error strings should not be capitalized (stylecheck)
return fmt.Errorf("Unable to find %q that match label selector %q, field selector %q: %v",
^
staging/src/k8s.io/cli-runtime/pkg/resource/visitor.go:651:11: ST1005: error strings should not end with punctuation or newlines (stylecheck)
return fmt.Errorf("the namespace from the provided object %q does not match the namespace %q. You must pass '--namespace=%s' to perform this operation.", info.Namespace, namespace, info.Namespace)
^
staging/src/k8s.io/cli-runtime/pkg/resource/builder.go:123:5: ST1012: error var LocalResourceError should have name of the form ErrFoo (stylecheck)
var LocalResourceError = errors.New(`error: you must specify resources by --filename when --local is set.
^
staging/src/k8s.io/cli-runtime/pkg/resource/builder.go:128:5: ST1012: error var StdinMultiUseError should have name of the form ErrFoo (stylecheck)
var StdinMultiUseError = errors.New("standard input cannot be used for multiple arguments")
^
staging/src/k8s.io/cli-runtime/pkg/resource/builder.go:48:7: ST1003: const defaultHttpGetAttempts should be defaultHTTPGetAttempts (stylecheck)
const defaultHttpGetAttempts = 3
^
staging/src/k8s.io/cli-runtime/pkg/resource/visitor.go:245:2: ST1003: struct field HttpAttemptCount should be HTTPAttemptCount (stylecheck)
HttpAttemptCount int
^
staging/src/k8s.io/cli-runtime/pkg/resource/visitor.go:259:6: ST1003: func readHttpWithRetries should be readHTTPWithRetries (stylecheck)
func readHttpWithRetries(get httpget, duration time.Duration, u string, attempts int) (io.ReadCloser, error) {
^
staging/src/k8s.io/cli-runtime/pkg/resource/helper_test.go:88:3: ST1003: struct field HttpErr should be HTTPErr (stylecheck)
HttpErr error
^
staging/src/k8s.io/cli-runtime/pkg/resource/helper_test.go:175:3: ST1003: struct field HttpErr should be HTTPErr (stylecheck)
HttpErr error
^
staging/src/k8s.io/cli-runtime/pkg/resource/helper_test.go:276:3: ST1003: struct field HttpErr should be HTTPErr (stylecheck)
HttpErr error
^
staging/src/k8s.io/cli-runtime/pkg/resource/helper_test.go:383:3: ST1003: struct field HttpErr should be HTTPErr (stylecheck)
HttpErr error
^
staging/src/k8s.io/cli-runtime/pkg/resource/helper_test.go:569:3: ST1003: struct field HttpErr should be HTTPErr (stylecheck)
HttpErr error
^
running ( cd /nvme/gopath/src/k8s.io/kubernetes/staging/src/k8s.io/cloud-provider; env LOGCHECK_CONFIG=/nvme/gopath/src/k8s.io/kubernetes/hack/logcheck.conf /nvme/gopath/src/k8s.io/kubernetes/_output/local/bin/golangci-lint run --config=/nvme/gopath/src/k8s.io/kubernetes/hack/golangci-strict.yaml --path-prefix staging/src/k8s.io/cloud-provider ./... )
staging/src/k8s.io/cloud-provider/options/kubecloudshared.go:55:19: Error return value of `fs.MarkDeprecated` is not checked (errcheck)
fs.MarkDeprecated("allow-untagged-cloud", "This flag is deprecated and will be removed in a future release. A cluster-id will be required on cloud instances.")
^
staging/src/k8s.io/cloud-provider/options/kubecloudshared.go:68:19: Error return value of `fs.MarkDeprecated` is not checked (errcheck)
fs.MarkDeprecated("node-sync-period", "This flag is currently no-op and will be deleted.")
^
staging/src/k8s.io/cloud-provider/controllers/node/node_controller.go:144:45: Error return value of `(k8s.io/client-go/tools/cache.SharedInformer).AddEventHandler` is not checked (errcheck)
cnc.nodeInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{
^
staging/src/k8s.io/cloud-provider/controllers/node/node_controller_test.go:1665:32: Error return value of `cloudNodeController.syncNode` is not checked (errcheck)
cloudNodeController.syncNode(context.TODO(), test.existingNode.Name)
^
staging/src/k8s.io/cloud-provider/controllers/node/node_controller_test.go:1749:30: Error return value of `cloudNodeController.syncNode` is not checked (errcheck)
cloudNodeController.syncNode(context.TODO(), existingNode.Name)
^
staging/src/k8s.io/cloud-provider/controllers/node/node_controller_test.go:1837:30: Error return value of `cloudNodeController.syncNode` is not checked (errcheck)
cloudNodeController.syncNode(context.TODO(), existingNode.Name)
^
staging/src/k8s.io/cloud-provider/controllers/node/node_controller_test.go:2537:40: Error return value of `cloudNodeController.UpdateNodeStatus` is not checked (errcheck)
cloudNodeController.UpdateNodeStatus(context.TODO())
^
staging/src/k8s.io/cloud-provider/controllers/service/controller.go:128:60: Error return value of `(k8s.io/client-go/tools/cache.SharedInformer).AddEventHandlerWithResyncPeriod` is not checked (errcheck)
serviceInformer.Informer().AddEventHandlerWithResyncPeriod(
^
staging/src/k8s.io/cloud-provider/controllers/service/controller.go:153:57: Error return value of `(k8s.io/client-go/tools/cache.SharedInformer).AddEventHandlerWithResyncPeriod` is not checked (errcheck)
nodeInformer.Informer().AddEventHandlerWithResyncPeriod(
^
staging/src/k8s.io/cloud-provider/controllers/service/controller_test.go:2031:68: Error return value of `(k8s.io/client-go/tools/cache.Store).Add` is not checked (errcheck)
fakeInformerFactory.Core().V1().Nodes().Informer().GetStore().Add(node)
^
staging/src/k8s.io/cloud-provider/app/webhooks.go:184:18: Error return value of `bodybuf.ReadFrom` is not checked (errcheck)
bodybuf.ReadFrom(r.Body)
^
staging/src/k8s.io/cloud-provider/volume/helpers/zones.go:221:3: assignOp: replace `numReplicas = numReplicas - 1` with `numReplicas--` (gocritic)
numReplicas = numReplicas - 1
^
staging/src/k8s.io/cloud-provider/config/v1alpha1/defaults_test.go:59:17: unslice: could simplify eJSONBytes[:] to eJSONBytes (gocritic)
name: string(eJSONBytes[:]),
^
staging/src/k8s.io/cloud-provider/cloud.go:90:2: commentFormatting: put a space between `//` and comment text (gocritic)
//GCE requires that the name of a load balancer starts with a lower case letter.
^
staging/src/k8s.io/cloud-provider/cloud.go:93:2: commentFormatting: put a space between `//` and comment text (gocritic)
//AWS requires that the name of a load balancer is shorter than 32 bytes.
^
staging/src/k8s.io/cloud-provider/cloud.go:58:2: deprecatedComment: use `Deprecated: ` (note the casing) instead of `DEPRECATED: ` (gocritic)
// DEPRECATED: Zones is deprecated in favor of retrieving zone/region information from InstancesV2.
^
staging/src/k8s.io/cloud-provider/cloud.go:261:1: deprecatedComment: use `Deprecated: ` (note the casing) instead of `DEPRECATED: ` (gocritic)
// DEPRECATED: Zones is deprecated in favor of retrieving zone/region information from InstancesV2.
^
staging/src/k8s.io/cloud-provider/cloud.go:92:8: wrapperFunc: use strings.ReplaceAll method in `strings.Replace(ret, "-", "", -1)` (gocritic)
ret = strings.Replace(ret, "-", "", -1)
^
staging/src/k8s.io/cloud-provider/controllers/service/controller_test.go:1057:2: commentFormatting: put a space between `//` and comment text (gocritic)
//A pair of old and new loadbalancer IP address
^
staging/src/k8s.io/cloud-provider/controllers/service/controller_test.go:1064:44: commentFormatting: put a space between `//` and comment text (gocritic)
updateFn func(*v1.Service) *v1.Service //Manipulate the structure
^
staging/src/k8s.io/cloud-provider/controllers/service/controller_test.go:1066:45: commentFormatting: put a space between `//` and comment text (gocritic)
expectedFn func(*v1.Service, error) error //Error comparison function
^
staging/src/k8s.io/cloud-provider/controllers/service/controller_test.go:1213:32: commentFormatting: put a space between `//` and comment text (gocritic)
updateFn func() //Function to manipulate the controller element to simulate error
^
staging/src/k8s.io/cloud-provider/controllers/service/controller_test.go:1214:32: commentFormatting: put a space between `//` and comment text (gocritic)
expectedFn func(error) error //Expected function if returns nil then test passed, failed otherwise
^
staging/src/k8s.io/cloud-provider/controllers/service/controller_test.go:1225:5: commentFormatting: put a space between `//` and comment text (gocritic)
//Error should be unexpected key format: "invalid/key/string"
^
staging/src/k8s.io/cloud-provider/controllers/service/controller_test.go:1258:5: commentFormatting: put a space between `//` and comment text (gocritic)
//error should be nil
^
staging/src/k8s.io/cloud-provider/controllers/service/controller_test.go:1274:3: commentFormatting: put a space between `//` and comment text (gocritic)
//expected matches obtained ??.
^
staging/src/k8s.io/cloud-provider/controllers/service/controller_test.go:1279:3: commentFormatting: put a space between `//` and comment text (gocritic)
//Post processing, the element should not be in the sync queue.
^
staging/src/k8s.io/cloud-provider/controllers/service/controller_test.go:1359:3: commentFormatting: put a space between `//` and comment text (gocritic)
//Create a new controller.
^
staging/src/k8s.io/cloud-provider/controllers/service/controller_test.go:1445:30: commentFormatting: put a space between `//` and comment text (gocritic)
testName string //Name of the test case
^
staging/src/k8s.io/cloud-provider/controllers/service/controller_test.go:1446:30: commentFormatting: put a space between `//` and comment text (gocritic)
updateFn func() //Function to update the service object
^
staging/src/k8s.io/cloud-provider/controllers/service/controller_test.go:1447:30: commentFormatting: put a space between `//` and comment text (gocritic)
expectedNeedsUpdate bool //needsupdate always returns bool
^
staging/src/k8s.io/cloud-provider/controllers/service/controller_test.go:1669:2: commentFormatting: put a space between `//` and comment text (gocritic)
//ServiceCache a common service cache for all the test cases
^
staging/src/k8s.io/cloud-provider/controllers/service/controller_test.go:1684:5: commentFormatting: put a space between `//` and comment text (gocritic)
//There must be exactly one element
^
staging/src/k8s.io/cloud-provider/controllers/service/controller_test.go:1698:5: commentFormatting: put a space between `//` and comment text (gocritic)
//Now it should have no element
^
staging/src/k8s.io/cloud-provider/controllers/service/controller_test.go:1711:5: commentFormatting: put a space between `//` and comment text (gocritic)
//Now it should have one element
^
staging/src/k8s.io/cloud-provider/controllers/service/controller_test.go:1725:5: commentFormatting: put a space between `//` and comment text (gocritic)
//Add one more entry here
^
staging/src/k8s.io/cloud-provider/controllers/service/controller_test.go:1729:5: commentFormatting: put a space between `//` and comment text (gocritic)
//It should have two elements
^
staging/src/k8s.io/cloud-provider/controllers/service/controller_test.go:1739:21: commentFormatting: put a space between `//` and comment text (gocritic)
setCacheFn: nil, //Nothing to set
^
staging/src/k8s.io/cloud-provider/controllers/service/controller_test.go:1741:5: commentFormatting: put a space between `//` and comment text (gocritic)
//It should have two elements
^
staging/src/k8s.io/cloud-provider/controllers/service/controller_test.go:1751:21: commentFormatting: put a space between `//` and comment text (gocritic)
setCacheFn: nil, //Nothing to set
^
staging/src/k8s.io/cloud-provider/controllers/service/controller_test.go:1753:5: commentFormatting: put a space between `//` and comment text (gocritic)
//It should return two elements
^
staging/src/k8s.io/cloud-provider/app/testing/testserver.go:119:3: ifElseChain: rewrite if-else to switch statement (gocritic)
if strings.HasPrefix(arg, "--secure-port=") || strings.HasPrefix(arg, "--cert-dir=") {
^
staging/src/k8s.io/cloud-provider/controllers/route/route_controller_test.go:503:2: S1008: should use 'return len(seen) == len(list1)' instead of 'if len(seen) == len(list1) { return true }; return false' (gosimple)
if len(seen) == len(list1) {
^
staging/src/k8s.io/cloud-provider/app/webhooks.go:146:8: S1039: unnecessary use of fmt.Sprintf (gosimple)
e := fmt.Sprintf("admission response cannot be nil")
^
staging/src/k8s.io/cloud-provider/app/testing/testserver.go:186:8: SA1019: wait.Poll is deprecated: This method does not return errors from context, use PollWithContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
err = wait.Poll(100*time.Millisecond, 30*time.Second, func() (bool, error) {
^
staging/src/k8s.io/cloud-provider/app/testing/testserver.go:22:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
staging/src/k8s.io/cloud-provider/config/v1alpha1/defaults.go:66:30: SA1019: utilpointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
obj.ConfigureCloudRoutes = utilpointer.BoolPtr(true)
^
staging/src/k8s.io/cloud-provider/controllers/service/controller.go:645:42: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
func serviceKeys(services []*v1.Service) sets.String {
^
staging/src/k8s.io/cloud-provider/controllers/service/controller.go:654:34: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
func nodeNames(nodes []*v1.Node) sets.String {
^
staging/src/k8s.io/cloud-provider/controllers/service/controller.go:687:66: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
func (c *Controller) syncNodes(ctx context.Context, workers int) sets.String {
^
staging/src/k8s.io/cloud-provider/controllers/service/controller.go:733:121: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
func (c *Controller) updateLoadBalancerHosts(ctx context.Context, services []*v1.Service, workers int) (servicesToRetry sets.String) {
^
staging/src/k8s.io/cloud-provider/controllers/service/controller_test.go:253:25: SA1019: utilpointer.StringPtr is deprecated: Use String instead. (staticcheck)
LoadBalancerClass: utilpointer.StringPtr("custom-loadbalancer"),
^
staging/src/k8s.io/cloud-provider/controllers/service/controller_test.go:960:25: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
expectedRetryServices sets.String
^
staging/src/k8s.io/cloud-provider/volume/helpers/zones.go:33:47: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
func LabelZonesToSet(labelZonesValue string) (sets.String, error) {
^
staging/src/k8s.io/cloud-provider/volume/helpers/zones.go:38:34: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
func ZonesSetToLabelValue(strSet sets.String) string {
^
staging/src/k8s.io/cloud-provider/volume/helpers/zones.go:43:38: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
func ZonesToSet(zonesString string) (sets.String, error) {
^
staging/src/k8s.io/cloud-provider/volume/helpers/zones.go:52:42: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
func stringToSet(str, delimiter string) (sets.String, error) {
^
staging/src/k8s.io/cloud-provider/volume/helpers/zones.go:54:19: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
zonesSet := make(sets.String)
^
staging/src/k8s.io/cloud-provider/volume/helpers/zones.go:58:16: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
return make(sets.String), fmt.Errorf(
^
staging/src/k8s.io/cloud-provider/volume/helpers/zones.go:91:129: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
func SelectZoneForVolume(zoneParameterPresent, zonesParameterPresent bool, zoneParameter string, zonesParameter, zonesWithNodes sets.String, node *v1.Node, allowedTopologies []v1.TopologySelectorTerm, pvcName string) (string, error) {
^
staging/src/k8s.io/cloud-provider/volume/helpers/zones.go:106:130: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
func SelectZonesForVolume(zoneParameterPresent, zonesParameterPresent bool, zoneParameter string, zonesParameter, zonesWithNodes sets.String, node *v1.Node, allowedTopologies []v1.TopologySelectorTerm, pvcName string, numReplicas uint32) (sets.String, error) {
^
staging/src/k8s.io/cloud-provider/volume/helpers/zones.go:187:79: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
func ZonesFromAllowedTopologies(allowedTopologies []v1.TopologySelectorTerm) (sets.String, error) {
^
staging/src/k8s.io/cloud-provider/volume/helpers/zones.go:188:16: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
zones := make(sets.String)
^
staging/src/k8s.io/cloud-provider/volume/helpers/zones.go:206:46: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
func chooseZonesForVolumeIncludingZone(zones sets.String, pvcName, zoneToInclude string, numReplicas uint32) (sets.String, error) {
^
staging/src/k8s.io/cloud-provider/volume/helpers/zones.go:231:33: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
func ChooseZonesForVolume(zones sets.String, pvcName string, numZones uint32) sets.String {
^
staging/src/k8s.io/cloud-provider/volume/helpers/zones_test.go:40:9: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
want sets.String
^
staging/src/k8s.io/cloud-provider/volume/helpers/zones_test.go:44:11: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
want: sets.String{"us-east-1a": sets.Empty{}},
^
staging/src/k8s.io/cloud-provider/volume/helpers/zones_test.go:48:10: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
want: sets.String{
^
staging/src/k8s.io/cloud-provider/volume/helpers/zones_test.go:71:14: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
Zones sets.String
^
staging/src/k8s.io/cloud-provider/volume/helpers/zones_test.go:74:14: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
Expected sets.String
^
staging/src/k8s.io/cloud-provider/volume/helpers/zones_test.go:759:39: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
var zonesParameter, zonesWithNodes sets.String
^
staging/src/k8s.io/cloud-provider/volume/helpers/zones_test.go:1421:38: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
var zonesParameter, zonesWithNodes sets.String
^
staging/src/k8s.io/cloud-provider/app/testing/testserver.go:101:10: ST1005: error strings should not be capitalized (stylecheck)
panic(fmt.Errorf("Cloud provider could not be initialized: %v", err))
^
staging/src/k8s.io/cloud-provider/controllers/node/node_controller.go:772:33: ST1005: error strings should not be capitalized (stylecheck)
return cloudprovider.Zone{}, fmt.Errorf("Zone: Error fetching by providerID: %v Error fetching by NodeName: %v", providerIDErr, err)
^
staging/src/k8s.io/cloud-provider/controllers/service/controller.go:833:23: ST1005: error strings should not be capitalized (stylecheck)
runtime.HandleError(fmt.Errorf("Unable to retrieve service %v from store: %v", key, err))
^
staging/src/k8s.io/cloud-provider/options/webhook.go:144:33: ST1005: error strings should not end with punctuation or newlines (stylecheck)
allErrors = append(allErrors, fmt.Errorf("--webhook-secure-port %v must be between 0 and 65535, inclusive. A value of 0 disables the webhook endpoint entirely.", o.BindPort))
^
staging/src/k8s.io/cloud-provider/volume/helpers/zones.go:125:17: ST1005: error strings should not be capitalized (stylecheck)
return nil, fmt.Errorf("Either %s or %s Label for node missing", v1.LabelTopologyZone, v1.LabelFailureDomainBetaZone)
^
staging/src/k8s.io/cloud-provider/cloud.go:248:2: ST1012: error var DiskNotFound should have name of the form ErrFoo (stylecheck)
DiskNotFound = errors.New("disk is not found")
^
staging/src/k8s.io/cloud-provider/cloud.go:249:2: ST1012: error var ImplementedElsewhere should have name of the form ErrFoo (stylecheck)
ImplementedElsewhere = errors.New("implemented by alternate to cloud provider")
^
staging/src/k8s.io/cloud-provider/cloud.go:250:2: ST1012: error var InstanceNotFound should have name of the form ErrFoo (stylecheck)
InstanceNotFound = errors.New("instance not found")
^
staging/src/k8s.io/cloud-provider/cloud.go:251:2: ST1012: error var NotImplemented should have name of the form ErrFoo (stylecheck)
NotImplemented = errors.New("unimplemented")
^
staging/src/k8s.io/cloud-provider/controllers/node/config/v1alpha1/conversion.go:32:6: ST1003: should not use underscores in Go names; func Convert_config_NodeControllerConfiguration_To_v1alpha1_NodeControllerConfiguration should be ConvertConfigNodeControllerConfigurationToV1alpha1NodeControllerConfiguration (stylecheck)
func Convert_config_NodeControllerConfiguration_To_v1alpha1_NodeControllerConfiguration(in *config.NodeControllerConfiguration, out *NodeControllerConfiguration, s conversion.Scope) error {
^
staging/src/k8s.io/cloud-provider/controllers/node/config/v1alpha1/conversion.go:37:6: ST1003: should not use underscores in Go names; func Convert_v1alpha1_NodeControllerConfiguration_To_config_NodeControllerConfiguration should be ConvertV1alpha1NodeControllerConfigurationToConfigNodeControllerConfiguration (stylecheck)
func Convert_v1alpha1_NodeControllerConfiguration_To_config_NodeControllerConfiguration(in *NodeControllerConfiguration, out *config.NodeControllerConfiguration, s conversion.Scope) error {
^
staging/src/k8s.io/cloud-provider/controllers/service/config/v1alpha1/conversion.go:32:6: ST1003: should not use underscores in Go names; func Convert_v1alpha1_ServiceControllerConfiguration_To_config_ServiceControllerConfiguration should be ConvertV1alpha1ServiceControllerConfigurationToConfigServiceControllerConfiguration (stylecheck)
func Convert_v1alpha1_ServiceControllerConfiguration_To_config_ServiceControllerConfiguration(in *ServiceControllerConfiguration, out *serviceconfig.ServiceControllerConfiguration, s conversion.Scope) error {
^
staging/src/k8s.io/cloud-provider/controllers/service/config/v1alpha1/conversion.go:37:6: ST1003: should not use underscores in Go names; func Convert_config_ServiceControllerConfiguration_To_v1alpha1_ServiceControllerConfiguration should be ConvertConfigServiceControllerConfigurationToV1alpha1ServiceControllerConfiguration (stylecheck)
func Convert_config_ServiceControllerConfiguration_To_v1alpha1_ServiceControllerConfiguration(in *serviceconfig.ServiceControllerConfiguration, out *ServiceControllerConfiguration, s conversion.Scope) error {
^
staging/src/k8s.io/cloud-provider/config/v1alpha1/conversion.go:32:6: ST1003: should not use underscores in Go names; func Convert_v1alpha1_KubeCloudSharedConfiguration_To_config_KubeCloudSharedConfiguration should be ConvertV1alpha1KubeCloudSharedConfigurationToConfigKubeCloudSharedConfiguration (stylecheck)
func Convert_v1alpha1_KubeCloudSharedConfiguration_To_config_KubeCloudSharedConfiguration(in *KubeCloudSharedConfiguration, out *cpconfig.KubeCloudSharedConfiguration, s conversion.Scope) error {
^
staging/src/k8s.io/cloud-provider/config/v1alpha1/conversion.go:37:6: ST1003: should not use underscores in Go names; func Convert_config_KubeCloudSharedConfiguration_To_v1alpha1_KubeCloudSharedConfiguration should be ConvertConfigKubeCloudSharedConfigurationToV1alpha1KubeCloudSharedConfiguration (stylecheck)
func Convert_config_KubeCloudSharedConfiguration_To_v1alpha1_KubeCloudSharedConfiguration(in *cpconfig.KubeCloudSharedConfiguration, out *KubeCloudSharedConfiguration, s conversion.Scope) error {
^
staging/src/k8s.io/cloud-provider/config/v1alpha1/conversion.go:42:6: ST1003: should not use underscores in Go names; func Convert_v1alpha1_CloudProviderConfiguration_To_config_CloudProviderConfiguration should be ConvertV1alpha1CloudProviderConfigurationToConfigCloudProviderConfiguration (stylecheck)
func Convert_v1alpha1_CloudProviderConfiguration_To_config_CloudProviderConfiguration(in *CloudProviderConfiguration, out *cpconfig.CloudProviderConfiguration, s conversion.Scope) error {
^
staging/src/k8s.io/cloud-provider/config/v1alpha1/conversion.go:47:6: ST1003: should not use underscores in Go names; func Convert_config_CloudProviderConfiguration_To_v1alpha1_CloudProviderConfiguration should be ConvertConfigCloudProviderConfigurationToV1alpha1CloudProviderConfiguration (stylecheck)
func Convert_config_CloudProviderConfiguration_To_v1alpha1_CloudProviderConfiguration(in *cpconfig.CloudProviderConfiguration, out *CloudProviderConfiguration, s conversion.Scope) error {
^
staging/src/k8s.io/cloud-provider/config/v1alpha1/defaults.go:34:6: ST1003: should not use underscores in Go names; func SetDefaults_CloudControllerManagerConfiguration should be SetDefaultsCloudControllerManagerConfiguration (stylecheck)
func SetDefaults_CloudControllerManagerConfiguration(obj *CloudControllerManagerConfiguration) {
^
staging/src/k8s.io/cloud-provider/config/v1alpha1/defaults.go:57:6: ST1003: should not use underscores in Go names; func SetDefaults_KubeCloudSharedConfiguration should be SetDefaultsKubeCloudSharedConfiguration (stylecheck)
func SetDefaults_KubeCloudSharedConfiguration(obj *KubeCloudSharedConfiguration) {
^
running ( cd /nvme/gopath/src/k8s.io/kubernetes/staging/src/k8s.io/cluster-bootstrap; env LOGCHECK_CONFIG=/nvme/gopath/src/k8s.io/kubernetes/hack/logcheck.conf /nvme/gopath/src/k8s.io/kubernetes/_output/local/bin/golangci-lint run --config=/nvme/gopath/src/k8s.io/kubernetes/hack/golangci-strict.yaml --path-prefix staging/src/k8s.io/cluster-bootstrap ./... )
running ( cd /nvme/gopath/src/k8s.io/kubernetes/staging/src/k8s.io/code-generator; env LOGCHECK_CONFIG=/nvme/gopath/src/k8s.io/kubernetes/hack/logcheck.conf /nvme/gopath/src/k8s.io/kubernetes/_output/local/bin/golangci-lint run --config=/nvme/gopath/src/k8s.io/kubernetes/hack/golangci-strict.yaml --path-prefix staging/src/k8s.io/code-generator ./... )
staging/src/k8s.io/code-generator/cmd/client-gen/args/gvpackages.go:41:7: Error return value of `v.Set` is not checked (errcheck)
v.Set(def)
^
staging/src/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/generator.go:741:9: Error return value of `w.Write` is not checked (errcheck)
w.Write(f.Header)
^
staging/src/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/generator.go:765:9: Error return value of `w.Write` is not checked (errcheck)
w.Write(f.Body.Bytes())
^
staging/src/k8s.io/code-generator/cmd/register-gen/main.go:33:10: Error return value of `flag.Set` is not checked (errcheck)
flag.Set("logtostderr", "true")
^
staging/src/k8s.io/code-generator/cmd/lister-gen/main.go:40:10: Error return value of `flag.Set` is not checked (errcheck)
flag.Set("logtostderr", "true")
^
staging/src/k8s.io/code-generator/cmd/conversion-gen/generators/conversion.go:307:18: Error return value of `context.AddDir` is not checked (errcheck)
context.AddDir(pp)
^
staging/src/k8s.io/code-generator/cmd/prerelease-lifecycle-gen/main.go:52:10: Error return value of `flag.Set` is not checked (errcheck)
flag.Set("logtostderr", "true")
^
staging/src/k8s.io/code-generator/cmd/defaulter-gen/main.go:60:10: Error return value of `flag.Set` is not checked (errcheck)
flag.Set("logtostderr", "true")
^
staging/src/k8s.io/code-generator/cmd/informer-gen/main.go:43:10: Error return value of `flag.Set` is not checked (errcheck)
flag.Set("logtostderr", "true")
^
staging/src/k8s.io/code-generator/cmd/deepcopy-gen/main.go:64:10: Error return value of `flag.Set` is not checked (errcheck)
flag.Set("logtostderr", "true")
^
staging/src/k8s.io/code-generator/cmd/go-to-protobuf/main.go:34:12: Error return value of `goflag.Set` is not checked (errcheck)
goflag.Set("logtostderr", "true")
^
staging/src/k8s.io/code-generator/cmd/conversion-gen/main.go:113:10: Error return value of `flag.Set` is not checked (errcheck)
flag.Set("logtostderr", "true")
^
staging/src/k8s.io/code-generator/cmd/openapi-gen/main.go:41:10: Error return value of `flag.Set` is not checked (errcheck)
flag.Set("logtostderr", "true")
^
staging/src/k8s.io/code-generator/cmd/client-gen/main.go:41:10: Error return value of `flag.Set` is not checked (errcheck)
flag.Set("logtostderr", "true")
^
staging/src/k8s.io/code-generator/cmd/client-gen/types/helpers.go:119:1: commentFormatting: put a space between `//` and comment text (gocritic)
//func NormalizeGroupVersion(gv GroupVersion) GroupVersion {
^
staging/src/k8s.io/code-generator/cmd/client-gen/args/gvpackages.go:132:36: appendAssign: append result not assigned to the same slice (gocritic)
seenGroups[gv.Group].Versions = append(group.Versions, versionPkg)
^
staging/src/k8s.io/code-generator/cmd/prerelease-lifecycle-gen/prerelease-lifecycle-generators/status.go:162:3: commentFormatting: put a space between `//` and comment text (gocritic)
//v := ""
^
staging/src/k8s.io/code-generator/cmd/prerelease-lifecycle-gen/prerelease-lifecycle-generators/status.go:167:3: commentFormatting: put a space between `//` and comment text (gocritic)
//case "register":
^
staging/src/k8s.io/code-generator/cmd/prerelease-lifecycle-gen/prerelease-lifecycle-generators/status.go:166:3: singleCaseSwitch: found switch with default case only (gocritic)
switch k {
^
staging/src/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/cmd.go:258:10: appendAssign: append result not assigned to the same slice (gocritic)
args := append(searchArgs, fmt.Sprintf("--gogo_out=%s", g.OutputBase))
^
staging/src/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/cmd.go:417:2: commentFormatting: put a space between `//` and comment text (gocritic)
//for _, n := range sorted {
^
staging/src/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/cmd.go:477:2: valSwap: can re-write as `o.elements[i], o.elements[j] = o.elements[j], o.elements[i]` (gocritic)
x := o.elements[i]
^
staging/src/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/generator.go:227:2: singleCaseSwitch: should rewrite switch statement to if statement (gocritic)
switch {
^
staging/src/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/generator.go:582:14: wrapperFunc: use strings.ReplaceAll method in `strings.Replace(prefix, ".", "/", -1)` (gocritic)
Path: strings.Replace(prefix, ".", "/", -1),
^
staging/src/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/namer.go:97:9: wrapperFunc: use strings.ReplaceAll method in `strings.Replace(name, "/", ".", -1)` (gocritic)
pkg := strings.Replace(name, "/", ".", -1)
^
staging/src/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/namer.go:98:9: wrapperFunc: use strings.ReplaceAll method in `strings.Replace(pkg, "-", "_", -1)` (gocritic)
return strings.Replace(pkg, "-", "_", -1)
^
staging/src/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/parser.go:114:2: singleCaseSwitch: should rewrite switch statement to if statement (gocritic)
switch t := decl.(type) {
^
staging/src/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/parser.go:153:2: singleCaseSwitch: should rewrite switch statement to if statement (gocritic)
switch t := n.(type) {
^
staging/src/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/parser.go:198:4: singleCaseSwitch: should rewrite switch statement to if statement (gocritic)
switch rhs := t.Rhs[0].(type) {
^
staging/src/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/parser.go:203:7: singleCaseSwitch: should rewrite switch statement to if statement (gocritic)
switch arg := rhs.Args[0].(type) {
^
staging/src/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/parser.go:215:3: singleCaseSwitch: should rewrite switch statement to if statement (gocritic)
switch cond := t.Cond.(type) {
^
staging/src/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/parser.go:228:4: singleCaseSwitch: should rewrite switch statement to if statement (gocritic)
switch s := t.Init.(type) {
^
staging/src/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/parser.go:305:2: singleCaseSwitch: should rewrite switch statement to if statement (gocritic)
switch t := decl.(type) {
^
staging/src/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/parser.go:312:4: singleCaseSwitch: should rewrite switch statement to if statement (gocritic)
switch spec := s.(type) {
^
staging/src/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/parser.go:332:2: singleCaseSwitch: should rewrite switch statement to if statement (gocritic)
switch t := decl.(type) {
^
staging/src/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/parser.go:339:4: singleCaseSwitch: should rewrite switch statement to if statement (gocritic)
switch spec := s.(type) {
^
staging/src/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/parser_test.go:110:11: elseif: can replace 'else {if cond {}}' with 'else if cond {}' (gocritic)
} else {
^
staging/src/k8s.io/code-generator/cmd/applyconfiguration-gen/generators/applyconfiguration.go:213:4: ifElseChain: rewrite if-else to switch statement (gocritic)
if structMember.Embedded {
^
staging/src/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_type.go:303:9: wrapperFunc: use strings.ReplaceAll method in `strings.Replace(template, " "+strings.Title(verbType), " "+name, -1)` (gocritic)
return strings.Replace(template, " "+strings.Title(verbType), " "+name, -1)
^
staging/src/k8s.io/code-generator/cmd/informer-gen/generators/packages.go:104:32: badCall: suspicious Join on 1 argument (gocritic)
internalVersionPackagePath := filepath.Join(arguments.OutputPackagePath)
^
staging/src/k8s.io/code-generator/cmd/informer-gen/generators/packages.go:105:32: badCall: suspicious Join on 1 argument (gocritic)
externalVersionPackagePath := filepath.Join(arguments.OutputPackagePath)
^
staging/src/k8s.io/code-generator/cmd/conversion-gen/generators/conversion.go:556:14: appendAssign: append result not assigned to the same slice (gocritic)
comments := append(t.SecondClosestCommentLines, t.CommentLines...)
^
staging/src/k8s.io/code-generator/cmd/client-gen/generators/generator_for_type.go:348:9: wrapperFunc: use strings.ReplaceAll method in `strings.Replace(template, " "+strings.Title(verbType), " "+name, -1)` (gocritic)
return strings.Replace(template, " "+strings.Title(verbType), " "+name, -1)
^
staging/src/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_type.go:80:6: S1002: should omit comparison to bool constant, can be simplified to `m.Embedded` (gosimple)
if m.Embedded == true && m.Name == "ObjectMeta" {
^
staging/src/k8s.io/code-generator/cmd/register-gen/generators/packages.go:96:41: S1002: should omit comparison to bool constant, can be simplified to `typeMember.Embedded` (gosimple)
if typeMember.Name == "TypeMeta" && typeMember.Embedded == true {
^
staging/src/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/generator.go:143:5: S1002: should omit comparison to bool constant, can be simplified to `!extractBoolTagOrDie("protobuf.nullable", t.CommentLines)` (gosimple)
if extractBoolTagOrDie("protobuf.nullable", t.CommentLines) == false {
^
staging/src/k8s.io/code-generator/cmd/applyconfiguration-gen/generators/refgraph.go:174:2: S1008: should use 'return hasJSONTaggedMembers' instead of 'if !hasJSONTaggedMembers { return false }; return true' (gosimple)
if !hasJSONTaggedMembers {
^
staging/src/k8s.io/code-generator/cmd/conversion-gen/generators/conversion.go:697:3: S1008: should use 'return g.manualConversions[pairs[i]].Name.Name < g.manualConversions[pairs[j]].Name.Name' instead of 'if g.manualConversions[pairs[i]].Name.Name < g.manualConversions[pairs[j]].Name.Name { return true }; return false' (gosimple)
if g.manualConversions[pairs[i]].Name.Name < g.manualConversions[pairs[j]].Name.Name {
^
staging/src/k8s.io/code-generator/cmd/client-gen/generators/generator_for_type.go:123:109: SA1019: strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead. (staticcheck)
updatedVerbtemplate = e.VerbName + "(" + strings.TrimPrefix(subresourceDefaultVerbTemplates[e.VerbType], strings.Title(e.VerbType)+"(")
^
staging/src/k8s.io/code-generator/cmd/client-gen/generators/generator_for_type.go:125:98: SA1019: strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead. (staticcheck)
updatedVerbtemplate = e.VerbName + "(" + strings.TrimPrefix(defaultVerbTemplates[e.VerbType], strings.Title(e.VerbType)+"(")
^
staging/src/k8s.io/code-generator/cmd/conversion-gen/generators/conversion.go:1090:25: ST1003: method generateFromUrlValues should be generateFromURLValues (stylecheck)
func (g *genConversion) generateFromUrlValues(inType, outType *types.Type, sw *generator.SnippetWriter) {
^
staging/src/k8s.io/code-generator/cmd/lister-gen/generators/lister.go:272:5: ST1003: should not use underscores in Go names; var typeListerInterface_NonNamespaced should be typeListerInterfaceNonNamespaced (stylecheck)
var typeListerInterface_NonNamespaced = `
^
staging/src/k8s.io/code-generator/cmd/lister-gen/generators/lister.go:300:5: ST1003: should not use underscores in Go names; var typeLister_List should be typeListerList (stylecheck)
var typeLister_List = `
^
staging/src/k8s.io/code-generator/cmd/lister-gen/generators/lister.go:310:5: ST1003: should not use underscores in Go names; var typeLister_NamespaceLister should be typeListerNamespaceLister (stylecheck)
var typeLister_NamespaceLister = `
^
staging/src/k8s.io/code-generator/cmd/lister-gen/generators/lister.go:317:5: ST1003: should not use underscores in Go names; var typeLister_NonNamespacedGet should be typeListerNonNamespacedGet (stylecheck)
var typeLister_NonNamespacedGet = `
^
staging/src/k8s.io/code-generator/cmd/lister-gen/generators/lister.go:354:5: ST1003: should not use underscores in Go names; var namespaceLister_List should be namespaceListerList (stylecheck)
var namespaceLister_List = `
^
staging/src/k8s.io/code-generator/cmd/lister-gen/generators/lister.go:364:5: ST1003: should not use underscores in Go names; var namespaceLister_Get should be namespaceListerGet (stylecheck)
var namespaceLister_Get = `
^
staging/src/k8s.io/code-generator/cmd/prerelease-lifecycle-gen/prerelease-lifecycle-generators/status.go:111:29: ST1005: error strings should not be capitalized (stylecheck)
return "", "", "", false, fmt.Errorf("Found %d %s tags: %q", len(tagVals), replacementTagName, tagVals)
^
staging/src/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/generator.go:557:10: ST1005: error strings should not end with punctuation or newlines (stylecheck)
return fmt.Errorf("member %q of %q malformed 'protobuf' tag, not enough segments\n", m.Name, t.Name)
^
staging/src/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/generator.go:561:10: ST1005: error strings should not end with punctuation or newlines (stylecheck)
return fmt.Errorf("member %q of %q malformed 'protobuf' tag, field ID is %q which is not an integer: %v\n", m.Name, t.Name, parts[1], err)
^
staging/src/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/generator.go:601:11: ST1005: error strings should not end with punctuation or newlines (stylecheck)
return fmt.Errorf("member %q of %q malformed 'protobuf' tag, tag %d should be key=value, got %q\n", m.Name, t.Name, i+4, extra)
^
running ( cd /nvme/gopath/src/k8s.io/kubernetes/staging/src/k8s.io/component-base; env LOGCHECK_CONFIG=/nvme/gopath/src/k8s.io/kubernetes/hack/logcheck.conf /nvme/gopath/src/k8s.io/kubernetes/_output/local/bin/golangci-lint run --config=/nvme/gopath/src/k8s.io/kubernetes/hack/golangci-strict.yaml --path-prefix staging/src/k8s.io/component-base ./... )
staging/src/k8s.io/component-base/metrics/prometheus/slis/metrics.go:58:19: Error return value of `registry.Register` is not checked (errcheck)
registry.Register(healthcheck)
^
staging/src/k8s.io/component-base/metrics/prometheus/slis/metrics.go:59:19: Error return value of `registry.Register` is not checked (errcheck)
registry.Register(healthchecksTotal)
^
staging/src/k8s.io/component-base/metrics/prometheusextension/weighted_histogram_test.go:118:19: Error return value of `whAsMetric.Write` is not checked (errcheck)
whAsMetric.Write(&metric)
^
staging/src/k8s.io/component-base/metrics/http.go:72:18: Error return value of `io.WriteString` is not checked (errcheck)
io.WriteString(w, "metrics reset\n")
^
staging/src/k8s.io/component-base/featuregate/testing/feature_gate_test.go:27:10: Error return value of `gate.Add` is not checked (errcheck)
gate.Add(map[featuregate.Feature]featuregate.FeatureSpec{
^
staging/src/k8s.io/component-base/featuregate/testing/feature_gate_test.go:43:10: Error return value of `gate.Set` is not checked (errcheck)
gate.Set("alpha_default_on_set_off=false")
^
staging/src/k8s.io/component-base/featuregate/testing/feature_gate_test.go:44:10: Error return value of `gate.Set` is not checked (errcheck)
gate.Set("beta_default_on_set_off=false")
^
staging/src/k8s.io/component-base/featuregate/testing/feature_gate_test.go:45:10: Error return value of `gate.Set` is not checked (errcheck)
gate.Set("stable_default_on_set_off=false")
^
staging/src/k8s.io/component-base/featuregate/testing/feature_gate_test.go:46:10: Error return value of `gate.Set` is not checked (errcheck)
gate.Set("alpha_default_off_set_on=true")
^
staging/src/k8s.io/component-base/featuregate/testing/feature_gate_test.go:47:10: Error return value of `gate.Set` is not checked (errcheck)
gate.Set("beta_default_off_set_on=true")
^
staging/src/k8s.io/component-base/featuregate/testing/feature_gate_test.go:48:10: Error return value of `gate.Set` is not checked (errcheck)
gate.Set("stable_default_off_set_on=true")
^
staging/src/k8s.io/component-base/featuregate/feature_gate_test.go:213:9: Error return value of `f.Add` is not checked (errcheck)
f.Add(map[Feature]FeatureSpec{
^
staging/src/k8s.io/component-base/featuregate/feature_gate_test.go:242:7: Error return value of `f.Add` is not checked (errcheck)
f.Add(map[Feature]FeatureSpec{
^
staging/src/k8s.io/component-base/featuregate/feature_gate_test.go:247:7: Error return value of `f.Set` is not checked (errcheck)
f.Set("TestAlpha=true,TestBeta=true")
^
staging/src/k8s.io/component-base/featuregate/feature_gate_test.go:255:7: Error return value of `f.Set` is not checked (errcheck)
f.Set("TestAlpha=false")
^
staging/src/k8s.io/component-base/featuregate/feature_gate_test.go:271:7: Error return value of `f.Add` is not checked (errcheck)
f.Add(map[Feature]FeatureSpec{
^
staging/src/k8s.io/component-base/featuregate/feature_gate_test.go:295:7: Error return value of `f.Add` is not checked (errcheck)
f.Add(map[Feature]FeatureSpec{
^
staging/src/k8s.io/component-base/featuregate/feature_gate_test.go:402:9: Error return value of `f.Add` is not checked (errcheck)
f.Add(map[Feature]FeatureSpec{
^
staging/src/k8s.io/component-base/featuregate/feature_gate_test.go:453:7: Error return value of `f.Add` is not checked (errcheck)
f.Add(fMap)
^
staging/src/k8s.io/component-base/featuregate/feature_gate_test.go:454:14: Error return value of `f.SetFromMap` is not checked (errcheck)
f.SetFromMap(map[string]bool{"TestAlphaEnabled": true, "TestBetaDisabled": false})
^
staging/src/k8s.io/component-base/featuregate/feature_gate_test.go:502:9: Error return value of `f.Add` is not checked (errcheck)
f.Add(featuremap)
^
staging/src/k8s.io/component-base/featuregate/feature_gate_test.go:503:16: Error return value of `f.SetFromMap` is not checked (errcheck)
f.SetFromMap(test.setmap)
^
staging/src/k8s.io/component-base/tracing/tracing_test.go:36:50: Error return value of `.Set` is not checked (errcheck)
flag.CommandLine.Lookup("logtostderr").Value.Set("false")
^
staging/src/k8s.io/component-base/logs/json/register/register_test.go:146:12: Error return value of `fs.Parse` is not checked (errcheck)
fs.Parse(tc.args)
^
staging/src/k8s.io/component-base/logs/api/v1/options_test.go:74:12: Error return value of `fs.Parse` is not checked (errcheck)
fs.Parse(tc.args)
^
staging/src/k8s.io/component-base/logs/api/v1/options_test.go:182:17: Error return value is not checked (errcheck)
AddFeatureGates(featureGate)
^
staging/src/k8s.io/component-base/logs/api/v1/registry.go:80:19: Error return value of `registry.register` is not checked (errcheck)
registry.register("text", logFormat{feature: LoggingStableOptions})
^
staging/src/k8s.io/component-base/logs/example/cmd/logger.go:69:25: Error return value of `logsapi.AddFeatureGates` is not checked (errcheck)
logsapi.AddFeatureGates(featureGate)
^
staging/src/k8s.io/component-base/logs/logreduction/logreduction.go:24:15: unlambda: replace `func() time.Time { return time.Now() }` with `time.Now` (gocritic)
var nowfunc = func() time.Time { return time.Now() }
^
staging/src/k8s.io/component-base/logs/datapol/datapol.go:33:4: commentFormatting: put a space between `//` and comment text (gocritic)
//TODO maybe export a metric
^
staging/src/k8s.io/component-base/metrics/legacyregistry/registry.go:75:2: commentFormatting: put a space between `//` and comment text (gocritic)
//TODO(RainbowMango): Maybe we can wrap this error by error wrapping.(Golang 1.13)
^
staging/src/k8s.io/component-base/config/testing/apigroup.go:197:9: wrapperFunc: use strings.ReplaceAll method in `strings.Replace(strings.ToLower(str), "-", "", -1)` (gocritic)
return strings.Replace(strings.ToLower(str), "-", "", -1)
^
staging/src/k8s.io/component-base/config/testing/helpers.go:87:9: elseif: can replace 'else {if cond {}}' with 'else if cond {}' (gocritic)
} else {
^
staging/src/k8s.io/component-base/metrics/prometheusextension/weighted_histogram_test.go:83:4: ifElseChain: rewrite if-else to switch statement (gocritic)
if idx > 0 {
^
staging/src/k8s.io/component-base/cli/flag/flags.go:32:31: wrapperFunc: use strings.ReplaceAll method in `strings.Replace(name, "_", "-", -1)` (gocritic)
return pflag.NormalizedName(strings.Replace(name, "_", "-", -1))
^
staging/src/k8s.io/component-base/cli/flag/flags.go:40:12: wrapperFunc: use strings.ReplaceAll method in `strings.Replace(name, "_", "-", -1)` (gocritic)
nname := strings.Replace(name, "_", "-", -1)
^
staging/src/k8s.io/component-base/metrics/testutil/metrics.go:134:4: assignOp: replace `aSample.Value = aSample.Value - bSample.Value` with `aSample.Value -= bSample.Value` (gocritic)
aSample.Value = aSample.Value - bSample.Value
^
staging/src/k8s.io/component-base/metrics/desc.go:184:26: newDeref: replace `*new(sync.Once)` with `sync.Once{}` (gocritic)
d.markDeprecationOnce = *new(sync.Once)
^
staging/src/k8s.io/component-base/metrics/desc.go:185:17: newDeref: replace `*new(sync.Once)` with `sync.Once{}` (gocritic)
d.createOnce = *new(sync.Once)
^
staging/src/k8s.io/component-base/metrics/desc.go:186:20: newDeref: replace `*new(sync.Once)` with `sync.Once{}` (gocritic)
d.deprecateOnce = *new(sync.Once)
^
staging/src/k8s.io/component-base/metrics/desc.go:187:15: newDeref: replace `*new(sync.Once)` with `sync.Once{}` (gocritic)
d.hideOnce = *new(sync.Once)
^
staging/src/k8s.io/component-base/metrics/desc.go:188:19: newDeref: replace `*new(sync.Once)` with `sync.Once{}` (gocritic)
d.annotateOnce = *new(sync.Once)
^
staging/src/k8s.io/component-base/metrics/summary.go:35:1: deprecatedComment: use `Deprecated: ` (note the casing) instead of `DEPRECATED: ` (gocritic)
// DEPRECATED: as per the metrics overhaul KEP
^
staging/src/k8s.io/component-base/metrics/summary.go:46:1: deprecatedComment: use `Deprecated: ` (note the casing) instead of `DEPRECATED: ` (gocritic)
// DEPRECATED: as per the metrics overhaul KEP
^
staging/src/k8s.io/component-base/metrics/summary.go:93:1: deprecatedComment: use `Deprecated: ` (note the casing) instead of `DEPRECATED: ` (gocritic)
// DEPRECATED: as per the metrics overhaul KEP
^
staging/src/k8s.io/component-base/metrics/summary.go:107:1: deprecatedComment: use `Deprecated: ` (note the casing) instead of `DEPRECATED: ` (gocritic)
// DEPRECATED: as per the metrics overhaul KEP
^
staging/src/k8s.io/component-base/metrics/registry_test.go:377:22: newDeref: replace `*new(sync.Once)` with `sync.Once{}` (gocritic)
showHiddenOnce = *new(sync.Once)
^
staging/src/k8s.io/component-base/metrics/registry_test.go:459:22: newDeref: replace `*new(sync.Once)` with `sync.Once{}` (gocritic)
showHiddenOnce = *new(sync.Once)
^
staging/src/k8s.io/component-base/metrics/prometheus/restclient/metrics.go:110:11: S1024: should use time.Until instead of t.Sub(time.Now()) (gosimple)
return execPluginCertTTLAdapter.e.Sub(time.Now()).Seconds()
^
staging/src/k8s.io/component-base/cli/flag/tristate.go:59:2: S1008: should use 'return f != Unset' instead of 'if f != Unset { return true }; return false' (gosimple)
if f != Unset {
^
staging/src/k8s.io/component-base/metrics/collector.go:161:2: S1008: should use 'return len(bsc.registerable) > 0' instead of 'if len(bsc.registerable) > 0 { return true }; return false' (gosimple)
if len(bsc.registerable) > 0 {
^
staging/src/k8s.io/component-base/cli/run.go:89:2: SA1019: rand.Seed has been deprecated since Go 1.20 and an alternative has been available since Go 1.0: Programs that call Seed and then expect a specific sequence of results from the global random source (using functions such as Int) can be broken when a dependency changes how much it consumes from the global random source. To avoid such breakages, programs that need a specific result sequence should use NewRand(NewSource(seed)) to obtain a random generator that other packages cannot access. (staticcheck)
rand.Seed(time.Now().UnixNano())
^
staging/src/k8s.io/component-base/config/v1alpha1/defaults.go:52:21: SA1019: utilpointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
obj.LeaderElect = utilpointer.BoolPtr(true)
^
staging/src/k8s.io/component-base/config/v1alpha1/defaults.go:88:25: SA1019: utilpointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
obj.EnableProfiling = utilpointer.BoolPtr(true) // profile debugging is cheap to have exposed and standard on kube binaries
^
staging/src/k8s.io/component-base/config/testing/apigroup.go:41:30: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
SkipTests sets.String
^
staging/src/k8s.io/component-base/config/testing/apigroup.go:204:13: SA1019: strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead. (staticcheck)
result += strings.Title(segment)
^
staging/src/k8s.io/component-base/metrics/opts.go:313:30: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
labelToAllowList map[string]sets.String
^
staging/src/k8s.io/component-base/metrics/opts.go:349:40: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
labelToAllowList := make(map[string]sets.String)
^
staging/src/k8s.io/component-base/metrics/opts_test.go:67:32: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
labelToAllowList: map[string]sets.String{
^
staging/src/k8s.io/component-base/metrics/opts_test.go:100:32: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
labelToAllowList: map[string]sets.String{
^
staging/src/k8s.io/component-base/metrics/testutil/metrics_test.go:34:16: SA1019: pointer.Float64Ptr is deprecated: Use Float64 instead. (staticcheck)
SampleSum: pointer.Float64Ptr(0.0),
^
staging/src/k8s.io/component-base/metrics/testutil/metrics_test.go:40:21: SA1019: pointer.Float64Ptr is deprecated: Use Float64 instead. (staticcheck)
UpperBound: pointer.Float64Ptr(ub),
^
staging/src/k8s.io/component-base/metrics/testutil/metrics_test.go:162:19: SA1019: pointer.Float64Ptr is deprecated: Use Float64 instead. (staticcheck)
SampleSum: pointer.Float64Ptr(0.0),
^
staging/src/k8s.io/component-base/metrics/testutil/metrics_test.go:172:19: SA1019: pointer.Float64Ptr is deprecated: Use Float64 instead. (staticcheck)
SampleSum: pointer.Float64Ptr(1.0),
^
staging/src/k8s.io/component-base/metrics/testutil/metrics_test.go:185:19: SA1019: pointer.Float64Ptr is deprecated: Use Float64 instead. (staticcheck)
SampleSum: pointer.Float64Ptr(1.0),
^
staging/src/k8s.io/component-base/metrics/testutil/metrics_test.go:198:19: SA1019: pointer.Float64Ptr is deprecated: Use Float64 instead. (staticcheck)
SampleSum: pointer.Float64Ptr(1.0),
^
staging/src/k8s.io/component-base/metrics/testutil/metrics_test.go:200:20: SA1019: pointer.Float64Ptr is deprecated: Use Float64 instead. (staticcheck)
{UpperBound: pointer.Float64Ptr(-1.0)},
^
staging/src/k8s.io/component-base/metrics/testutil/metrics_test.go:238:12: SA1019: pointer.StringPtr is deprecated: Use String instead. (staticcheck)
{Name: pointer.StringPtr("a"), Value: pointer.StringPtr("1")},
^
staging/src/k8s.io/component-base/metrics/testutil/metrics_test.go:239:12: SA1019: pointer.StringPtr is deprecated: Use String instead. (staticcheck)
{Name: pointer.StringPtr("b"), Value: pointer.StringPtr("2")},
^
staging/src/k8s.io/component-base/metrics/testutil/metrics_test.go:240:12: SA1019: pointer.StringPtr is deprecated: Use String instead. (staticcheck)
{Name: pointer.StringPtr("c"), Value: pointer.StringPtr("3")},
^
staging/src/k8s.io/component-base/metrics/testutil/metrics_test.go:248:12: SA1019: pointer.StringPtr is deprecated: Use String instead. (staticcheck)
{Name: pointer.StringPtr("a"), Value: pointer.StringPtr("1")},
^
staging/src/k8s.io/component-base/metrics/testutil/metrics_test.go:249:12: SA1019: pointer.StringPtr is deprecated: Use String instead. (staticcheck)
{Name: pointer.StringPtr("b"), Value: pointer.StringPtr("2")},
^
staging/src/k8s.io/component-base/metrics/testutil/metrics_test.go:250:12: SA1019: pointer.StringPtr is deprecated: Use String instead. (staticcheck)
{Name: pointer.StringPtr("c"), Value: pointer.StringPtr("3")},
^
staging/src/k8s.io/component-base/metrics/testutil/metrics_test.go:257:12: SA1019: pointer.StringPtr is deprecated: Use String instead. (staticcheck)
{Name: pointer.StringPtr("a"), Value: pointer.StringPtr("1")},
^
staging/src/k8s.io/component-base/metrics/testutil/metrics_test.go:258:12: SA1019: pointer.StringPtr is deprecated: Use String instead. (staticcheck)
{Name: pointer.StringPtr("b"), Value: pointer.StringPtr("2")},
^
staging/src/k8s.io/component-base/metrics/testutil/metrics_test.go:266:12: SA1019: pointer.StringPtr is deprecated: Use String instead. (staticcheck)
{Name: pointer.StringPtr("aa"), Value: pointer.StringPtr("11")},
^
staging/src/k8s.io/component-base/metrics/testutil/metrics_test.go:267:12: SA1019: pointer.StringPtr is deprecated: Use String instead. (staticcheck)
{Name: pointer.StringPtr("bb"), Value: pointer.StringPtr("22")},
^
staging/src/k8s.io/component-base/metrics/testutil/metrics_test.go:268:12: SA1019: pointer.StringPtr is deprecated: Use String instead. (staticcheck)
{Name: pointer.StringPtr("cc"), Value: pointer.StringPtr("33")},
^
staging/src/k8s.io/component-base/metrics/testutil/metrics_test.go:276:12: SA1019: pointer.StringPtr is deprecated: Use String instead. (staticcheck)
{Name: pointer.StringPtr("a"), Value: pointer.StringPtr("1")},
^
staging/src/k8s.io/component-base/metrics/testutil/metrics_test.go:277:12: SA1019: pointer.StringPtr is deprecated: Use String instead. (staticcheck)
{Name: pointer.StringPtr("b"), Value: pointer.StringPtr("2")},
^
staging/src/k8s.io/component-base/metrics/testutil/metrics_test.go:278:12: SA1019: pointer.StringPtr is deprecated: Use String instead. (staticcheck)
{Name: pointer.StringPtr("c"), Value: pointer.StringPtr("3")},
^
staging/src/k8s.io/component-base/metrics/testutil/metrics_test.go:286:12: SA1019: pointer.StringPtr is deprecated: Use String instead. (staticcheck)
{Name: pointer.StringPtr("a"), Value: pointer.StringPtr("1")},
^
staging/src/k8s.io/component-base/metrics/testutil/metrics_test.go:287:12: SA1019: pointer.StringPtr is deprecated: Use String instead. (staticcheck)
{Name: pointer.StringPtr("b"), Value: pointer.StringPtr("2")},
^
staging/src/k8s.io/component-base/metrics/testutil/metrics_test.go:288:12: SA1019: pointer.StringPtr is deprecated: Use String instead. (staticcheck)
{Name: pointer.StringPtr("c"), Value: pointer.StringPtr("33")},
^
staging/src/k8s.io/component-base/metrics/testutil/metrics_test.go:289:12: SA1019: pointer.StringPtr is deprecated: Use String instead. (staticcheck)
{Name: pointer.StringPtr("d"), Value: pointer.StringPtr("4")},
^
staging/src/k8s.io/component-base/metrics/testutil/metrics_test.go:303:12: SA1019: pointer.StringPtr is deprecated: Use String instead. (staticcheck)
{Name: pointer.StringPtr("a"), Value: pointer.StringPtr("1")},
^
staging/src/k8s.io/component-base/metrics/testutil/metrics_test.go:304:12: SA1019: pointer.StringPtr is deprecated: Use String instead. (staticcheck)
{Name: pointer.StringPtr("b"), Value: pointer.StringPtr("2")},
^
staging/src/k8s.io/component-base/metrics/testutil/metrics_test.go:330:69: SA1019: pointer.Float64Ptr is deprecated: Use Float64 instead. (staticcheck)
&Histogram{&dto.Histogram{SampleCount: uint64Ptr(0), SampleSum: pointer.Float64Ptr(0.0)}},
^
staging/src/k8s.io/component-base/metrics/testutil/metrics_test.go:337:69: SA1019: pointer.Float64Ptr is deprecated: Use Float64 instead. (staticcheck)
&Histogram{&dto.Histogram{SampleCount: uint64Ptr(1), SampleSum: pointer.Float64Ptr(2.0)}},
^
staging/src/k8s.io/component-base/metrics/testutil/metrics_test.go:338:69: SA1019: pointer.Float64Ptr is deprecated: Use Float64 instead. (staticcheck)
&Histogram{&dto.Histogram{SampleCount: uint64Ptr(2), SampleSum: pointer.Float64Ptr(4.0)}},
^
staging/src/k8s.io/component-base/metrics/testutil/metrics_test.go:339:69: SA1019: pointer.Float64Ptr is deprecated: Use Float64 instead. (staticcheck)
&Histogram{&dto.Histogram{SampleCount: uint64Ptr(4), SampleSum: pointer.Float64Ptr(8.0)}},
^
staging/src/k8s.io/component-base/metrics/testutil/metrics_test.go:346:69: SA1019: pointer.Float64Ptr is deprecated: Use Float64 instead. (staticcheck)
&Histogram{&dto.Histogram{SampleCount: uint64Ptr(1), SampleSum: pointer.Float64Ptr(2.0)}},
^
staging/src/k8s.io/component-base/metrics/testutil/metrics_test.go:347:69: SA1019: pointer.Float64Ptr is deprecated: Use Float64 instead. (staticcheck)
&Histogram{&dto.Histogram{SampleCount: uint64Ptr(0), SampleSum: pointer.Float64Ptr(0.0)}},
^
staging/src/k8s.io/component-base/metrics/testutil/metrics_test.go:348:69: SA1019: pointer.Float64Ptr is deprecated: Use Float64 instead. (staticcheck)
&Histogram{&dto.Histogram{SampleCount: uint64Ptr(2), SampleSum: pointer.Float64Ptr(4.0)}},
^
staging/src/k8s.io/component-base/metrics/testutil/metrics_test.go:376:69: SA1019: pointer.Float64Ptr is deprecated: Use Float64 instead. (staticcheck)
&Histogram{&dto.Histogram{SampleCount: uint64Ptr(0), SampleSum: pointer.Float64Ptr(0.0)}},
^
staging/src/k8s.io/component-base/metrics/testutil/metrics_test.go:383:69: SA1019: pointer.Float64Ptr is deprecated: Use Float64 instead. (staticcheck)
&Histogram{&dto.Histogram{SampleCount: uint64Ptr(1), SampleSum: pointer.Float64Ptr(2.0)}},
^
staging/src/k8s.io/component-base/metrics/testutil/metrics_test.go:384:69: SA1019: pointer.Float64Ptr is deprecated: Use Float64 instead. (staticcheck)
&Histogram{&dto.Histogram{SampleCount: uint64Ptr(2), SampleSum: pointer.Float64Ptr(4.0)}},
^
staging/src/k8s.io/component-base/metrics/testutil/metrics_test.go:385:69: SA1019: pointer.Float64Ptr is deprecated: Use Float64 instead. (staticcheck)
&Histogram{&dto.Histogram{SampleCount: uint64Ptr(4), SampleSum: pointer.Float64Ptr(8.0)}},
^
staging/src/k8s.io/component-base/metrics/testutil/metrics_test.go:392:69: SA1019: pointer.Float64Ptr is deprecated: Use Float64 instead. (staticcheck)
&Histogram{&dto.Histogram{SampleCount: uint64Ptr(1), SampleSum: pointer.Float64Ptr(2.0)}},
^
staging/src/k8s.io/component-base/metrics/testutil/metrics_test.go:393:69: SA1019: pointer.Float64Ptr is deprecated: Use Float64 instead. (staticcheck)
&Histogram{&dto.Histogram{SampleCount: uint64Ptr(0), SampleSum: pointer.Float64Ptr(0.0)}},
^
staging/src/k8s.io/component-base/metrics/testutil/metrics_test.go:394:69: SA1019: pointer.Float64Ptr is deprecated: Use Float64 instead. (staticcheck)
&Histogram{&dto.Histogram{SampleCount: uint64Ptr(2), SampleSum: pointer.Float64Ptr(4.0)}},
^
staging/src/k8s.io/component-base/config/v1alpha1/conversion.go:31:6: ST1003: should not use underscores in Go names; func Convert_v1alpha1_ClientConnectionConfiguration_To_config_ClientConnectionConfiguration should be ConvertV1alpha1ClientConnectionConfigurationToConfigClientConnectionConfiguration (stylecheck)
func Convert_v1alpha1_ClientConnectionConfiguration_To_config_ClientConnectionConfiguration(in *ClientConnectionConfiguration, out *config.ClientConnectionConfiguration, s conversion.Scope) error {
^
staging/src/k8s.io/component-base/config/v1alpha1/conversion.go:35:6: ST1003: should not use underscores in Go names; func Convert_config_ClientConnectionConfiguration_To_v1alpha1_ClientConnectionConfiguration should be ConvertConfigClientConnectionConfigurationToV1alpha1ClientConnectionConfiguration (stylecheck)
func Convert_config_ClientConnectionConfiguration_To_v1alpha1_ClientConnectionConfiguration(in *config.ClientConnectionConfiguration, out *ClientConnectionConfiguration, s conversion.Scope) error {
^
staging/src/k8s.io/component-base/config/v1alpha1/conversion.go:39:6: ST1003: should not use underscores in Go names; func Convert_v1alpha1_DebuggingConfiguration_To_config_DebuggingConfiguration should be ConvertV1alpha1DebuggingConfigurationToConfigDebuggingConfiguration (stylecheck)
func Convert_v1alpha1_DebuggingConfiguration_To_config_DebuggingConfiguration(in *DebuggingConfiguration, out *config.DebuggingConfiguration, s conversion.Scope) error {
^
staging/src/k8s.io/component-base/config/v1alpha1/conversion.go:43:6: ST1003: should not use underscores in Go names; func Convert_config_DebuggingConfiguration_To_v1alpha1_DebuggingConfiguration should be ConvertConfigDebuggingConfigurationToV1alpha1DebuggingConfiguration (stylecheck)
func Convert_config_DebuggingConfiguration_To_v1alpha1_DebuggingConfiguration(in *config.DebuggingConfiguration, out *DebuggingConfiguration, s conversion.Scope) error {
^
staging/src/k8s.io/component-base/config/v1alpha1/conversion.go:47:6: ST1003: should not use underscores in Go names; func Convert_v1alpha1_LeaderElectionConfiguration_To_config_LeaderElectionConfiguration should be ConvertV1alpha1LeaderElectionConfigurationToConfigLeaderElectionConfiguration (stylecheck)
func Convert_v1alpha1_LeaderElectionConfiguration_To_config_LeaderElectionConfiguration(in *LeaderElectionConfiguration, out *config.LeaderElectionConfiguration, s conversion.Scope) error {
^
staging/src/k8s.io/component-base/config/v1alpha1/conversion.go:51:6: ST1003: should not use underscores in Go names; func Convert_config_LeaderElectionConfiguration_To_v1alpha1_LeaderElectionConfiguration should be ConvertConfigLeaderElectionConfigurationToV1alpha1LeaderElectionConfiguration (stylecheck)
func Convert_config_LeaderElectionConfiguration_To_v1alpha1_LeaderElectionConfiguration(in *config.LeaderElectionConfiguration, out *LeaderElectionConfiguration, s conversion.Scope) error {
^
staging/src/k8s.io/component-base/cli/flag/ciphersuites_flag_test.go:29:3: ST1003: should not use underscores in Go names; struct field expected_error should be expectedError (stylecheck)
expected_error bool
^
staging/src/k8s.io/component-base/cli/flag/ciphersuites_flag.go:107:16: ST1005: error strings should not be capitalized (stylecheck)
return nil, fmt.Errorf("Cipher suite %s not supported or doesn't exist", cipher)
^
staging/src/k8s.io/component-base/config/testing/apigroup.go:176:10: ST1005: error strings should not be capitalized (stylecheck)
return fmt.Errorf("Kind %s not registered in the scheme, registered kinds are %v", expectedKind, registeredKinds.List())
^
staging/src/k8s.io/component-base/featuregate/feature_gate_test.go:241:8: ST1023: should omit type *featureGate from declaration; it will be inferred from the right-hand side (stylecheck)
var f *featureGate = NewFeatureGate()
^
staging/src/k8s.io/component-base/featuregate/feature_gate_test.go:270:8: ST1023: should omit type *featureGate from declaration; it will be inferred from the right-hand side (stylecheck)
var f *featureGate = NewFeatureGate()
^
staging/src/k8s.io/component-base/featuregate/feature_gate_test.go:294:8: ST1023: should omit type *featureGate from declaration; it will be inferred from the right-hand side (stylecheck)
var f *featureGate = NewFeatureGate()
^
staging/src/k8s.io/component-base/metrics/timing_histogram_test.go:131:11: ST1023: should omit type float64 from declaration; it will be inferred from the right-hand side (stylecheck)
var v2 float64 = 1e6
^
staging/src/k8s.io/component-base/metrics/prometheusextension/timing_histogram_test.go:85:9: ST1023: should omit type float64 from declaration; it will be inferred from the right-hand side (stylecheck)
var v1 float64 = 0.75
^
staging/src/k8s.io/component-base/metrics/prometheusextension/timing_histogram_test.go:89:9: ST1023: should omit type float64 from declaration; it will be inferred from the right-hand side (stylecheck)
var d2 float64 = 0.5
^
staging/src/k8s.io/component-base/metrics/registry.go:234:25: ST1016: methods on the same type should have the same receiver name (seen 15x "kr", 1x "r") (stylecheck)
func (kr *kubeRegistry) CustomMustRegister(cs ...StableCollector) {
^
running ( cd /nvme/gopath/src/k8s.io/kubernetes/staging/src/k8s.io/component-helpers; env LOGCHECK_CONFIG=/nvme/gopath/src/k8s.io/kubernetes/hack/logcheck.conf /nvme/gopath/src/k8s.io/kubernetes/_output/local/bin/golangci-lint run --config=/nvme/gopath/src/k8s.io/kubernetes/hack/golangci-strict.yaml --path-prefix staging/src/k8s.io/component-helpers ./... )
staging/src/k8s.io/component-helpers/node/util/ips.go:54:2: ifElseChain: rewrite if-else to switch statement (gocritic)
if len(nodeIPs) > 2 || (len(nodeIPs) == 2 && netutils.IsIPv6(nodeIPs[0]) == netutils.IsIPv6(nodeIPs[1])) {
^
staging/src/k8s.io/component-helpers/storage/volume/pv_helpers.go:77:2: commentFormatting: put a space between `//` and comment text (gocritic)
//PVDeletionProtectionFinalizer is the finalizer added by the external-provisioner on the PV
^
staging/src/k8s.io/component-helpers/node/topology/helpers.go:42:3: S1005: unnecessary assignment to the blank identifier (gosimple)
zone, _ = labels[v1.LabelTopologyZone]
^
staging/src/k8s.io/component-helpers/node/topology/helpers.go:47:3: S1005: unnecessary assignment to the blank identifier (gosimple)
region, _ = labels[v1.LabelTopologyRegion]
^
staging/src/k8s.io/component-helpers/apimachinery/lease/controller.go:221:27: SA1019: pointer.StringPtr is deprecated: Use String instead. (staticcheck)
HolderIdentity: pointer.StringPtr(c.holderIdentity),
^
staging/src/k8s.io/component-helpers/apimachinery/lease/controller.go:222:27: SA1019: pointer.Int32Ptr is deprecated: Use Int32 instead. (staticcheck)
LeaseDurationSeconds: pointer.Int32Ptr(c.leaseDurationSeconds),
^
staging/src/k8s.io/component-helpers/apimachinery/lease/controller_test.go:75:28: SA1019: pointer.StringPtr is deprecated: Use String instead. (staticcheck)
HolderIdentity: pointer.StringPtr(node.Name),
^
staging/src/k8s.io/component-helpers/apimachinery/lease/controller_test.go:76:28: SA1019: pointer.Int32Ptr is deprecated: Use Int32 instead. (staticcheck)
LeaseDurationSeconds: pointer.Int32Ptr(10),
^
staging/src/k8s.io/component-helpers/apimachinery/lease/controller_test.go:105:28: SA1019: pointer.StringPtr is deprecated: Use String instead. (staticcheck)
HolderIdentity: pointer.StringPtr(node.Name),
^
staging/src/k8s.io/component-helpers/apimachinery/lease/controller_test.go:106:28: SA1019: pointer.Int32Ptr is deprecated: Use Int32 instead. (staticcheck)
LeaseDurationSeconds: pointer.Int32Ptr(10),
^
staging/src/k8s.io/component-helpers/apimachinery/lease/controller_test.go:125:28: SA1019: pointer.StringPtr is deprecated: Use String instead. (staticcheck)
HolderIdentity: pointer.StringPtr(node.Name),
^
staging/src/k8s.io/component-helpers/apimachinery/lease/controller_test.go:126:28: SA1019: pointer.Int32Ptr is deprecated: Use Int32 instead. (staticcheck)
LeaseDurationSeconds: pointer.Int32Ptr(10),
^
staging/src/k8s.io/component-helpers/apimachinery/lease/controller_test.go:144:28: SA1019: pointer.StringPtr is deprecated: Use String instead. (staticcheck)
HolderIdentity: pointer.StringPtr(node.Name),
^
staging/src/k8s.io/component-helpers/apimachinery/lease/controller_test.go:145:28: SA1019: pointer.Int32Ptr is deprecated: Use Int32 instead. (staticcheck)
LeaseDurationSeconds: pointer.Int32Ptr(10),
^
staging/src/k8s.io/component-helpers/apimachinery/lease/controller_test.go:172:28: SA1019: pointer.StringPtr is deprecated: Use String instead. (staticcheck)
HolderIdentity: pointer.StringPtr(node.Name),
^
staging/src/k8s.io/component-helpers/apimachinery/lease/controller_test.go:173:28: SA1019: pointer.Int32Ptr is deprecated: Use Int32 instead. (staticcheck)
LeaseDurationSeconds: pointer.Int32Ptr(10),
^
staging/src/k8s.io/component-helpers/apimachinery/lease/controller_test.go:191:28: SA1019: pointer.StringPtr is deprecated: Use String instead. (staticcheck)
HolderIdentity: pointer.StringPtr(node.Name),
^
staging/src/k8s.io/component-helpers/apimachinery/lease/controller_test.go:192:28: SA1019: pointer.Int32Ptr is deprecated: Use Int32 instead. (staticcheck)
LeaseDurationSeconds: pointer.Int32Ptr(10),
^
running ( cd /nvme/gopath/src/k8s.io/kubernetes/staging/src/k8s.io/controller-manager; env LOGCHECK_CONFIG=/nvme/gopath/src/k8s.io/kubernetes/hack/logcheck.conf /nvme/gopath/src/k8s.io/kubernetes/_output/local/bin/golangci-lint run --config=/nvme/gopath/src/k8s.io/kubernetes/hack/golangci-strict.yaml --path-prefix staging/src/k8s.io/controller-manager ./... )
staging/src/k8s.io/controller-manager/pkg/leadermigration/config/config_test.go:126:4: ifElseChain: rewrite if-else to switch statement (gocritic)
if tc.expectErr && err == nil {
^
staging/src/k8s.io/controller-manager/pkg/clientbuilder/client_builder_dynamic.go:220:14: S1024: should use time.Until instead of t.Sub(time.Now()) (gosimple)
lifetime := retTokenRequest.Status.ExpirationTimestamp.Time.Sub(time.Now())
^
staging/src/k8s.io/controller-manager/pkg/clientbuilder/client_builder_dynamic.go:203:24: SA1019: utilpointer.Int64Ptr is deprecated: Use Int64 instead. (staticcheck)
ExpirationSeconds: utilpointer.Int64Ptr(ts.expirationSeconds),
^
staging/src/k8s.io/controller-manager/app/helper.go:35:9: SA1019: wait.PollImmediate is deprecated: This method does not return errors from context, use PollWithContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
err := wait.PollImmediate(time.Second, timeout, func() (bool, error) {
^
staging/src/k8s.io/controller-manager/app/helper.go:60:68: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
func IsControllerEnabled(name string, disabledByDefaultControllers sets.String, controllers []string) bool {
^
staging/src/k8s.io/controller-manager/config/v1/conversion.go:59:6: ST1003: should not use underscores in Go names; func Convert_config_LeaderMigrationConfiguration_To_v1_LeaderMigrationConfiguration should be ConvertConfigLeaderMigrationConfigurationToV1LeaderMigrationConfiguration (stylecheck)
func Convert_config_LeaderMigrationConfiguration_To_v1_LeaderMigrationConfiguration(in *config.LeaderMigrationConfiguration, out *LeaderMigrationConfiguration, s conversion.Scope) error {
^
staging/src/k8s.io/controller-manager/config/v1/conversion.go:65:6: ST1003: should not use underscores in Go names; func Convert_v1_LeaderMigrationConfiguration_To_config_LeaderMigrationConfiguration should be ConvertV1LeaderMigrationConfigurationToConfigLeaderMigrationConfiguration (stylecheck)
func Convert_v1_LeaderMigrationConfiguration_To_config_LeaderMigrationConfiguration(in *LeaderMigrationConfiguration, out *config.LeaderMigrationConfiguration, s conversion.Scope) error {
^
staging/src/k8s.io/controller-manager/config/v1/conversion.go:72:6: ST1003: should not use underscores in Go names; func Convert_v1_ControllerLeaderConfiguration_To_config_ControllerLeaderConfiguration should be ConvertV1ControllerLeaderConfigurationToConfigControllerLeaderConfiguration (stylecheck)
func Convert_v1_ControllerLeaderConfiguration_To_config_ControllerLeaderConfiguration(in *ControllerLeaderConfiguration, out *config.ControllerLeaderConfiguration, s conversion.Scope) error {
^
staging/src/k8s.io/controller-manager/config/v1/conversion.go:78:6: ST1003: should not use underscores in Go names; func Convert_config_ControllerLeaderConfiguration_To_v1_ControllerLeaderConfiguration should be ConvertConfigControllerLeaderConfigurationToV1ControllerLeaderConfiguration (stylecheck)
func Convert_config_ControllerLeaderConfiguration_To_v1_ControllerLeaderConfiguration(in *config.ControllerLeaderConfiguration, out *ControllerLeaderConfiguration, s conversion.Scope) error {
^
staging/src/k8s.io/controller-manager/config/v1alpha1/conversion.go:32:6: ST1003: should not use underscores in Go names; func Convert_v1alpha1_GenericControllerManagerConfiguration_To_config_GenericControllerManagerConfiguration should be ConvertV1alpha1GenericControllerManagerConfigurationToConfigGenericControllerManagerConfiguration (stylecheck)
func Convert_v1alpha1_GenericControllerManagerConfiguration_To_config_GenericControllerManagerConfiguration(in *GenericControllerManagerConfiguration, out *cmconfig.GenericControllerManagerConfiguration, s conversion.Scope) error {
^
staging/src/k8s.io/controller-manager/config/v1alpha1/conversion.go:37:6: ST1003: should not use underscores in Go names; func Convert_config_GenericControllerManagerConfiguration_To_v1alpha1_GenericControllerManagerConfiguration should be ConvertConfigGenericControllerManagerConfigurationToV1alpha1GenericControllerManagerConfiguration (stylecheck)
func Convert_config_GenericControllerManagerConfiguration_To_v1alpha1_GenericControllerManagerConfiguration(in *cmconfig.GenericControllerManagerConfiguration, out *GenericControllerManagerConfiguration, s conversion.Scope) error {
^
running ( cd /nvme/gopath/src/k8s.io/kubernetes/staging/src/k8s.io/cri-api; env LOGCHECK_CONFIG=/nvme/gopath/src/k8s.io/kubernetes/hack/logcheck.conf /nvme/gopath/src/k8s.io/kubernetes/_output/local/bin/golangci-lint run --config=/nvme/gopath/src/k8s.io/kubernetes/hack/golangci-strict.yaml --path-prefix staging/src/k8s.io/cri-api ./... )
staging/src/k8s.io/cri-api/pkg/apis/testing/fake_runtime_service.go:118:30: ST1016: methods on the same type should have the same receiver name (seen 1x "f", 38x "r") (stylecheck)
func (r *FakeRuntimeService) AssertCalls(calls []string) error {
^
running ( cd /nvme/gopath/src/k8s.io/kubernetes/staging/src/k8s.io/csi-translation-lib; env LOGCHECK_CONFIG=/nvme/gopath/src/k8s.io/kubernetes/hack/logcheck.conf /nvme/gopath/src/k8s.io/kubernetes/_output/local/bin/golangci-lint run --config=/nvme/gopath/src/k8s.io/kubernetes/hack/golangci-strict.yaml --path-prefix staging/src/k8s.io/csi-translation-lib ./... )
staging/src/k8s.io/csi-translation-lib/plugins/in_tree_volume.go:191:18: Error return value is not checked (errcheck)
replaceTopology(pv, zoneLabel, csiTopologyKey)
^
staging/src/k8s.io/csi-translation-lib/plugins/in_tree_volume.go:197:16: Error return value is not checked (errcheck)
addTopology(pv, csiTopologyKey, zones)
^
staging/src/k8s.io/csi-translation-lib/plugins/in_tree_volume.go:208:19: Error return value is not checked (errcheck)
replaceTopology(pv, regionLabel, v1.LabelTopologyRegion)
^
staging/src/k8s.io/csi-translation-lib/plugins/vsphere_volume.go:239:18: Error return value is not checked (errcheck)
replaceTopology(pv, zoneLabel, csiTopologyKeyZone)
^
staging/src/k8s.io/csi-translation-lib/plugins/vsphere_volume.go:244:16: Error return value is not checked (errcheck)
addTopology(pv, csiTopologyKeyZone, []string{label})
^
staging/src/k8s.io/csi-translation-lib/plugins/vsphere_volume.go:252:18: Error return value is not checked (errcheck)
replaceTopology(pv, regionLabel, csiTopologyKeyRegion)
^
staging/src/k8s.io/csi-translation-lib/plugins/vsphere_volume.go:257:16: Error return value is not checked (errcheck)
addTopology(pv, csiTopologyKeyRegion, []string{label})
^
staging/src/k8s.io/csi-translation-lib/plugins/aws_ebs.go:84:2: ifElseChain: rewrite if-else to switch statement (gocritic)
if len(generatedTopologies) > 0 && len(sc.AllowedTopologies) > 0 {
^
staging/src/k8s.io/csi-translation-lib/plugins/aws_ebs.go:289:3: ifElseChain: rewrite if-else to switch statement (gocritic)
if (len(splitZone) == 3 || len(splitZone) == 4) && len(splitZone[len(splitZone)-1]) == 2 {
^
staging/src/k8s.io/csi-translation-lib/plugins/azure_disk.go:79:2: ifElseChain: rewrite if-else to switch statement (gocritic)
if len(generatedTopologies) > 0 && len(sc.AllowedTopologies) > 0 {
^
staging/src/k8s.io/csi-translation-lib/plugins/azure_file.go:138:9: elseif: can replace 'else {if cond {}}' with 'else if cond {}' (gocritic)
} else {
^
staging/src/k8s.io/csi-translation-lib/plugins/gce_pd.go:100:2: ifElseChain: rewrite if-else to switch statement (gocritic)
if len(generatedTopologies) > 0 && len(sc.AllowedTopologies) > 0 {
^
staging/src/k8s.io/csi-translation-lib/plugins/gce_pd.go:225:2: ifElseChain: rewrite if-else to switch statement (gocritic)
if len(zones) == 1 && len(zones[0]) != 0 {
^
staging/src/k8s.io/csi-translation-lib/translate.go:147:2: ifElseChain: rewrite if-else to switch statement (gocritic)
if pv != nil {
^
staging/src/k8s.io/csi-translation-lib/plugins/aws_ebs.go:280:13: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
regions := sets.String{}
^
staging/src/k8s.io/csi-translation-lib/plugins/gce_pd.go:383:13: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
regions := sets.String{}
^
staging/src/k8s.io/csi-translation-lib/plugins/in_tree_volume.go:136:19: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
filteredZones := sets.String{}
^
staging/src/k8s.io/csi-translation-lib/plugins/gce_pd_test.go:306:3: ST1003: struct field wantVolId should be wantVolID (stylecheck)
wantVolId string
^
staging/src/k8s.io/csi-translation-lib/plugins/aws_ebs.go:261:14: ST1005: error strings should not be capitalized (stylecheck)
return "", fmt.Errorf("Invalid disk name (%s): %v", kubernetesID, err)
^
staging/src/k8s.io/csi-translation-lib/plugins/aws_ebs.go:264:14: ST1005: error strings should not be capitalized (stylecheck)
return "", fmt.Errorf("Invalid scheme for AWS volume (%s)", kubernetesID)
^
staging/src/k8s.io/csi-translation-lib/plugins/aws_ebs.go:273:14: ST1005: error strings should not be capitalized (stylecheck)
return "", fmt.Errorf("Invalid format for AWS volume (%s)", kubernetesID)
^
staging/src/k8s.io/csi-translation-lib/plugins/aws_ebs.go:297:15: ST1005: error strings should not be capitalized (stylecheck)
return "", fmt.Errorf("Unexpected zone format: %v is not a valid AWS zone", zone)
^
staging/src/k8s.io/csi-translation-lib/plugins/gce_pd.go:289:16: ST1005: error strings should not be capitalized (stylecheck)
return nil, fmt.Errorf("Failed to convert partition %v to integer: %v", partition, err)
^
staging/src/k8s.io/csi-translation-lib/plugins/in_tree_volume.go:281:10: ST1005: error strings should not be capitalized (stylecheck)
return fmt.Errorf("Failed to replace CSI topology to Kubernetes topology, error: %v", err)
^
staging/src/k8s.io/csi-translation-lib/plugins/in_tree_volume.go:289:11: ST1005: error strings should not be capitalized (stylecheck)
return fmt.Errorf("Failed to handle region topology. error: %v", err)
^
running ( cd /nvme/gopath/src/k8s.io/kubernetes/staging/src/k8s.io/dynamic-resource-allocation; env LOGCHECK_CONFIG=/nvme/gopath/src/k8s.io/kubernetes/hack/logcheck.conf /nvme/gopath/src/k8s.io/kubernetes/_output/local/bin/golangci-lint run --config=/nvme/gopath/src/k8s.io/kubernetes/hack/golangci-strict.yaml --path-prefix staging/src/k8s.io/dynamic-resource-allocation ./... )
staging/src/k8s.io/dynamic-resource-allocation/leaderelection/leaderelection.go:230:3: assignOp: replace `name = name + "X"` with `name += "X"` (gocritic)
name = name + "X"
^
staging/src/k8s.io/dynamic-resource-allocation/kubeletplugin/nonblockinggrpcserver.go:89:5: sloppyLen: len(interceptors) >= 0 is always true (gocritic)
if len(interceptors) >= 0 {
^
running ( cd /nvme/gopath/src/k8s.io/kubernetes/staging/src/k8s.io/kms; env LOGCHECK_CONFIG=/nvme/gopath/src/k8s.io/kubernetes/hack/logcheck.conf /nvme/gopath/src/k8s.io/kubernetes/_output/local/bin/golangci-lint run --config=/nvme/gopath/src/k8s.io/kubernetes/hack/golangci-strict.yaml --path-prefix staging/src/k8s.io/kms ./... )
staging/src/k8s.io/kms/internal/mock_ratelimit_remote_service_test.go:51:12: elseif: can replace 'else {if cond {}}' with 'else if cond {}' (gocritic)
} else {
^
staging/src/k8s.io/kms/pkg/service/grpc_service_test.go:67:12: SA1019: wait.PollImmediateUntilWithContext is deprecated: This method does not return errors from context, use PollWithContextCancel. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
if err := wait.PollImmediateUntilWithContext(ctx, time.Second, func(ctx context.Context) (bool, error) {
^
staging/src/k8s.io/kms/pkg/service/grpc_service_test.go:137:3: SA1019: grpc.WithDialer is deprecated: use WithContextDialer instead. Will be supported throughout 1.x. (staticcheck)
grpc.WithDialer(func(addr string, t time.Duration) (net.Conn, error) {
^
running ( cd /nvme/gopath/src/k8s.io/kubernetes/staging/src/k8s.io/kube-aggregator; env LOGCHECK_CONFIG=/nvme/gopath/src/k8s.io/kubernetes/hack/logcheck.conf /nvme/gopath/src/k8s.io/kubernetes/_output/local/bin/golangci-lint run --config=/nvme/gopath/src/k8s.io/kubernetes/hack/golangci-strict.yaml --path-prefix staging/src/k8s.io/kube-aggregator ./... )
staging/src/k8s.io/kube-aggregator/pkg/controllers/openapi/aggregator/downloader_test.go:47:9: Error return value of `w.Write` is not checked (errcheck)
w.Write(h.data)
^
staging/src/k8s.io/kube-aggregator/pkg/controllers/openapi/aggregator/downloader_test.go:73:9: Error return value of `w.Write` is not checked (errcheck)
w.Write(h.data)
^
staging/src/k8s.io/kube-aggregator/pkg/controllers/openapiv3/aggregator/aggregator.go:93:25: Error return value of `s.UpdateAPIServiceSpec` is not checked (errcheck)
s.UpdateAPIServiceSpec(apiServiceName)
^
staging/src/k8s.io/kube-aggregator/pkg/controllers/openapiv3/aggregator/aggregator.go:100:63: Error return value of `s.openAPIV2ConverterHandler.RegisterOpenAPIV3VersionedService` is not checked (errcheck)
s.openAPIV2ConverterHandler.RegisterOpenAPIV3VersionedService("/openapi/v3", openAPIV2ConverterMux)
^
staging/src/k8s.io/kube-aggregator/pkg/controllers/openapiv3/aggregator/aggregator.go:167:31: Error return value of `s.updateAPIServiceSpecLocked` is not checked (errcheck)
s.updateAPIServiceSpecLocked(openAPIV2Converter)
^
staging/src/k8s.io/kube-aggregator/pkg/controllers/openapiv3/aggregator/aggregator_test.go:56:10: Error return value of `w.Write` is not checked (errcheck)
w.Write(j)
^
staging/src/k8s.io/kube-aggregator/pkg/controllers/openapiv3/aggregator/aggregator_test.go:71:10: Error return value of `w.Write` is not checked (errcheck)
w.Write(h.data)
^
staging/src/k8s.io/kube-aggregator/pkg/controllers/openapiv3/aggregator/aggregator_test.go:82:10: Error return value of `w.Write` is not checked (errcheck)
w.Write([]byte(`{"swagger":"2.0","info":{"title":"Kubernetes","version":"unversioned"}}`))
^
staging/src/k8s.io/kube-aggregator/pkg/controllers/openapiv3/aggregator/aggregator_test.go:105:34: Error return value of `specProxier.UpdateAPIServiceSpec` is not checked (errcheck)
specProxier.UpdateAPIServiceSpec("v1.group.example.com")
^
staging/src/k8s.io/kube-aggregator/pkg/controllers/openapiv3/aggregator/aggregator_test.go:153:34: Error return value of `specProxier.UpdateAPIServiceSpec` is not checked (errcheck)
specProxier.UpdateAPIServiceSpec("v1.group.example.com")
^
staging/src/k8s.io/kube-aggregator/pkg/controllers/openapiv3/aggregator/aggregator_test.go:198:34: Error return value of `specProxier.UpdateAPIServiceSpec` is not checked (errcheck)
specProxier.UpdateAPIServiceSpec("v1.group.example.com")
^
staging/src/k8s.io/kube-aggregator/pkg/controllers/openapiv3/aggregator/downloader_test.go:48:10: Error return value of `w.Write` is not checked (errcheck)
w.Write(j)
^
staging/src/k8s.io/kube-aggregator/pkg/controllers/openapiv3/aggregator/downloader_test.go:63:10: Error return value of `w.Write` is not checked (errcheck)
w.Write(h.data)
^
staging/src/k8s.io/kube-aggregator/pkg/controllers/autoregister/autoregister_controller.go:104:47: Error return value of `(k8s.io/client-go/tools/cache.SharedInformer).AddEventHandler` is not checked (errcheck)
apiServiceInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{
^
staging/src/k8s.io/kube-aggregator/pkg/controllers/autoregister/autoregister_controller_test.go:328:25: Error return value of `apiServiceIndexer.Add` is not checked (errcheck)
apiServiceIndexer.Add(obj)
^
staging/src/k8s.io/kube-aggregator/pkg/controllers/autoregister/autoregister_controller_test.go:332:28: Error return value of `apiServiceIndexer.Update` is not checked (errcheck)
apiServiceIndexer.Update(obj)
^
staging/src/k8s.io/kube-aggregator/pkg/controllers/autoregister/autoregister_controller_test.go:347:20: Error return value of `c.checkAPIService` is not checked (errcheck)
c.checkAPIService(test.apiServiceName)
^
staging/src/k8s.io/kube-aggregator/pkg/controllers/status/available_controller_test.go:122:24: Error return value of `apiServiceIndexer.Add` is not checked (errcheck)
apiServiceIndexer.Add(o)
^
staging/src/k8s.io/kube-aggregator/pkg/controllers/status/available_controller_test.go:199:10: Error return value of `c.sync` is not checked (errcheck)
c.sync(tc.apiServiceName)
^
staging/src/k8s.io/kube-aggregator/pkg/controllers/status/available_controller_test.go:248:11: Error return value of `c.sync` is not checked (errcheck)
c.sync(apiService.Name)
^
staging/src/k8s.io/kube-aggregator/pkg/controllers/status/available_controller_test.go:424:26: Error return value of `apiServiceIndexer.Add` is not checked (errcheck)
apiServiceIndexer.Add(obj)
^
staging/src/k8s.io/kube-aggregator/pkg/controllers/status/available_controller_test.go:427:23: Error return value of `serviceIndexer.Add` is not checked (errcheck)
serviceIndexer.Add(obj)
^
staging/src/k8s.io/kube-aggregator/pkg/controllers/status/available_controller_test.go:430:25: Error return value of `endpointsIndexer.Add` is not checked (errcheck)
endpointsIndexer.Add(obj)
^
staging/src/k8s.io/kube-aggregator/pkg/controllers/status/available_controller_test.go:451:10: Error return value of `c.sync` is not checked (errcheck)
c.sync(tc.apiServiceName)
^
staging/src/k8s.io/kube-aggregator/pkg/controllers/status/available_controller_test.go:504:26: Error return value of `c.updateAPIServiceStatus` is not checked (errcheck)
c.updateAPIServiceStatus(foo, foo)
^
staging/src/k8s.io/kube-aggregator/pkg/controllers/status/available_controller_test.go:510:26: Error return value of `c.updateAPIServiceStatus` is not checked (errcheck)
c.updateAPIServiceStatus(foo, bar)
^
staging/src/k8s.io/kube-aggregator/pkg/apiserver/apiserver.go:359:30: Error return value of `wait.PollImmediateUntil` is not checked (errcheck)
go wait.PollImmediateUntil(10*time.Minute, func() (bool, error) {
^
staging/src/k8s.io/kube-aggregator/pkg/apiserver/apiserver.go:370:27: Error return value of `wait.PollImmediateUntil` is not checked (errcheck)
wait.PollImmediateUntil(1*time.Second, func() (bool, error) {
^
staging/src/k8s.io/kube-aggregator/pkg/apiserver/apiservice_controller.go:68:47: Error return value of `(k8s.io/client-go/tools/cache.SharedInformer).AddEventHandler` is not checked (errcheck)
apiServiceInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{
^
staging/src/k8s.io/kube-aggregator/pkg/apiserver/handler_apis_test.go:307:15: Error return value of `indexer.Add` is not checked (errcheck)
indexer.Add(o)
^
staging/src/k8s.io/kube-aggregator/pkg/apiserver/handler_apis_test.go:489:15: Error return value of `indexer.Add` is not checked (errcheck)
indexer.Add(o)
^
staging/src/k8s.io/kube-aggregator/pkg/apiserver/handler_discovery.go:426:16: Error return value of `wait.PollUntil` is not checked (errcheck)
wait.PollUntil(1*time.Minute, func() (done bool, err error) {
^
staging/src/k8s.io/kube-aggregator/pkg/apiserver/handler_discovery_test.go:649:21: Error return value of `runtime.DecodeInto` is not checked (errcheck)
runtime.DecodeInto(scheme.Codecs.UniversalDecoder(), bytes, decoded)
^
staging/src/k8s.io/kube-aggregator/pkg/apiserver/handler_proxy_test.go:531:12: Error return value of `ws.Read` is not checked (errcheck)
ws.Read(body)
^
staging/src/k8s.io/kube-aggregator/pkg/apiserver/handler_proxy_test.go:532:13: Error return value of `ws.Write` is not checked (errcheck)
ws.Write([]byte("hello " + string(body)))
^
staging/src/k8s.io/kube-aggregator/pkg/controllers/autoregister/autoregister_controller_test.go:349:3: commentFormatting: put a space between `//` and comment text (gocritic)
//compare the expected results
^
staging/src/k8s.io/kube-aggregator/pkg/controllers/openapiv3/controller.go:137:2: singleCaseSwitch: should rewrite switch statement to if statement (gocritic)
switch {
^
staging/src/k8s.io/kube-aggregator/pkg/apiserver/handler_discovery_test.go:340:3: ifElseChain: rewrite if-else to switch statement (gocritic)
if r.URL.Path == "/apis/stable.example.com" {
^
staging/src/k8s.io/kube-aggregator/pkg/apiserver/handler_discovery_test.go:493:3: ifElseChain: rewrite if-else to switch statement (gocritic)
if r.URL.Path == "/apis/stable.example.com" {
^
staging/src/k8s.io/kube-aggregator/pkg/controllers/openapiv3/aggregator/aggregator_test.go:123:5: S1004: should use !bytes.Equal(gotSpecJSON, expectedV3Bytes) instead (gosimple)
if bytes.Compare(gotSpecJSON, expectedV3Bytes) != 0 {
^
staging/src/k8s.io/kube-aggregator/pkg/controllers/openapiv3/aggregator/aggregator_test.go:165:5: S1004: should use !bytes.Equal(gotSpecJSON, specJSON) instead (gosimple)
if bytes.Compare(gotSpecJSON, specJSON) != 0 {
^
staging/src/k8s.io/kube-aggregator/pkg/apis/apiregistration/v1/defaults.go:31:14: SA1019: utilpointer.Int32Ptr is deprecated: Use Int32 instead. (staticcheck)
obj.Port = utilpointer.Int32Ptr(443)
^
staging/src/k8s.io/kube-aggregator/pkg/apis/apiregistration/v1beta1/defaults.go:31:14: SA1019: utilpointer.Int32Ptr is deprecated: Use Int32 instead. (staticcheck)
obj.Port = utilpointer.Int32Ptr(443)
^
staging/src/k8s.io/kube-aggregator/pkg/apiserver/apiserver.go:137:16: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
handledGroups sets.String
^
staging/src/k8s.io/kube-aggregator/pkg/apiserver/apiserver.go:218:31: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
handledGroups: sets.String{},
^
staging/src/k8s.io/kube-aggregator/pkg/apiserver/apiserver.go:339:14: SA1019: wait.PollImmediateUntil is deprecated: This method does not return errors from context, use PollWithContextCancel. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
if err := wait.PollImmediateUntil(100*time.Millisecond, func() (bool, error) {
^
staging/src/k8s.io/kube-aggregator/pkg/apiserver/apiservice_controller.go:105:12: SA1019: wait.PollImmediateUntil is deprecated: This method does not return errors from context, use PollWithContextCancel. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
if err := wait.PollImmediateUntil(time.Second, func() (bool, error) {
^
staging/src/k8s.io/kube-aggregator/pkg/apiserver/apiservice_controller.go:118:21: SA1019: wait.ErrWaitTimeout is deprecated: This type will be made private in favor of Interrupted() for checking errors or ErrorInterrupted(err) for returning a wrapped error. (staticcheck)
}, stopCh); err == wait.ErrWaitTimeout {
^
staging/src/k8s.io/kube-aggregator/pkg/apiserver/handler_apis.go:45:37: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
func discoveryGroup(enabledVersions sets.String) metav1.APIGroup {
^
staging/src/k8s.io/kube-aggregator/pkg/apiserver/handler_apis_test.go:41:15: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
enabled sets.String
^
staging/src/k8s.io/kube-aggregator/pkg/apiserver/handler_proxy_test.go:133:55: SA1019: pointer.Int32Ptr is deprecated: Use Int32 instead. (staticcheck)
Service: &apiregistration.ServiceReference{Port: pointer.Int32Ptr(443)},
^
staging/src/k8s.io/kube-aggregator/pkg/apiserver/handler_proxy_test.go:155:69: SA1019: pointer.Int32Ptr is deprecated: Use Int32 instead. (staticcheck)
Service: &apiregistration.ServiceReference{Port: pointer.Int32Ptr(443)},
^
staging/src/k8s.io/kube-aggregator/pkg/apiserver/handler_proxy_test.go:187:100: SA1019: pointer.Int32Ptr is deprecated: Use Int32 instead. (staticcheck)
Service: &apiregistration.ServiceReference{Name: "test-service", Namespace: "test-ns", Port: pointer.Int32Ptr(443)},
^
staging/src/k8s.io/kube-aggregator/pkg/apiserver/handler_proxy_test.go:219:100: SA1019: pointer.Int32Ptr is deprecated: Use Int32 instead. (staticcheck)
Service: &apiregistration.ServiceReference{Name: "test-service", Namespace: "test-ns", Port: pointer.Int32Ptr(443)},
^
staging/src/k8s.io/kube-aggregator/pkg/apiserver/handler_proxy_test.go:242:99: SA1019: pointer.Int32Ptr is deprecated: Use Int32 instead. (staticcheck)
Service: &apiregistration.ServiceReference{Name: "bad-service", Namespace: "test-ns", Port: pointer.Int32Ptr(443)},
^
staging/src/k8s.io/kube-aggregator/pkg/apiserver/handler_proxy_test.go:264:55: SA1019: pointer.Int32Ptr is deprecated: Use Int32 instead. (staticcheck)
Service: &apiregistration.ServiceReference{Port: pointer.Int32Ptr(443)},
^
staging/src/k8s.io/kube-aggregator/pkg/apiserver/handler_proxy_test.go:285:100: SA1019: pointer.Int32Ptr is deprecated: Use Int32 instead. (staticcheck)
Service: &apiregistration.ServiceReference{Name: "test-service", Namespace: "test-ns", Port: pointer.Int32Ptr(443)},
^
staging/src/k8s.io/kube-aggregator/pkg/apiserver/handler_proxy_test.go:433:100: SA1019: pointer.Int32Ptr is deprecated: Use Int32 instead. (staticcheck)
Service: &apiregistration.ServiceReference{Name: "test-service", Namespace: "test-ns", Port: pointer.Int32Ptr(443)},
^
staging/src/k8s.io/kube-aggregator/pkg/apiserver/handler_proxy_test.go:450:119: SA1019: pointer.Int32Ptr is deprecated: Use Int32 instead. (staticcheck)
Service: &apiregistration.ServiceReference{Name: "invalid-service", Namespace: "invalid-ns", Port: pointer.Int32Ptr(443)},
^
staging/src/k8s.io/kube-aggregator/pkg/apiserver/handler_proxy_test.go:467:106: SA1019: pointer.Int32Ptr is deprecated: Use Int32 instead. (staticcheck)
Service: &apiregistration.ServiceReference{Name: "invalid-service", Namespace: "invalid-ns", Port: pointer.Int32Ptr(443)},
^
staging/src/k8s.io/kube-aggregator/pkg/apiserver/handler_proxy_test.go:484:100: SA1019: pointer.Int32Ptr is deprecated: Use Int32 instead. (staticcheck)
Service: &apiregistration.ServiceReference{Name: "test-service", Namespace: "test-ns", Port: pointer.Int32Ptr(443)},
^
staging/src/k8s.io/kube-aggregator/pkg/apiserver/handler_proxy_test.go:502:100: SA1019: pointer.Int32Ptr is deprecated: Use Int32 instead. (staticcheck)
Service: &apiregistration.ServiceReference{Name: "test-service", Namespace: "test-ns", Port: pointer.Int32Ptr(443)},
^
staging/src/k8s.io/kube-aggregator/pkg/apiserver/handler_proxy_test.go:863:99: SA1019: pointer.Int32Ptr is deprecated: Use Int32 instead. (staticcheck)
Service: &apiregistration.ServiceReference{Name: "test-service2", Namespace: "test-ns", Port: pointer.Int32Ptr(443)},
^
staging/src/k8s.io/kube-aggregator/pkg/controllers/status/available_controller_test.go:104:16: SA1019: pointer.Int32Ptr is deprecated: Use Int32 instead. (staticcheck)
Port: pointer.Int32Ptr(testServicePort),
^
staging/src/k8s.io/kube-aggregator/pkg/controllers/cache.go:35:27: ST1005: error strings should not be capitalized (stylecheck)
utilruntime.HandleError(fmt.Errorf("Unable to sync caches for %s controller", controllerName))
^
staging/src/k8s.io/kube-aggregator/pkg/apiserver/handler_discovery.go:43:1: ST1022: comment on exported var APIRegistrationGroupPriority should be of the form "APIRegistrationGroupPriority ..." (stylecheck)
// Maximum is 20000. Set to higher than that so apiregistration always is listed
^
staging/src/k8s.io/kube-aggregator/pkg/apis/apiregistration/v1/defaults.go:29:6: ST1003: should not use underscores in Go names; func SetDefaults_ServiceReference should be SetDefaultsServiceReference (stylecheck)
func SetDefaults_ServiceReference(obj *ServiceReference) {
^
staging/src/k8s.io/kube-aggregator/pkg/apis/apiregistration/v1beta1/defaults.go:29:6: ST1003: should not use underscores in Go names; func SetDefaults_ServiceReference should be SetDefaultsServiceReference (stylecheck)
func SetDefaults_ServiceReference(obj *ServiceReference) {
^
running ( cd /nvme/gopath/src/k8s.io/kubernetes/staging/src/k8s.io/kube-controller-manager; env LOGCHECK_CONFIG=/nvme/gopath/src/k8s.io/kubernetes/hack/logcheck.conf /nvme/gopath/src/k8s.io/kubernetes/_output/local/bin/golangci-lint run --config=/nvme/gopath/src/k8s.io/kubernetes/hack/golangci-strict.yaml --path-prefix staging/src/k8s.io/kube-controller-manager ./... )
running ( cd /nvme/gopath/src/k8s.io/kubernetes/staging/src/k8s.io/kubectl; env LOGCHECK_CONFIG=/nvme/gopath/src/k8s.io/kubernetes/hack/logcheck.conf /nvme/gopath/src/k8s.io/kubernetes/_output/local/bin/golangci-lint run --config=/nvme/gopath/src/k8s.io/kubernetes/hack/golangci-strict.yaml --path-prefix staging/src/k8s.io/kubectl ./... )
staging/src/k8s.io/kubectl/pkg/generate/generate_test.go:168:17: Error return value of `(*github.com/spf13/pflag.FlagSet).Set` is not checked (errcheck)
cmd.Flags().Set("baz", "blah")
^
staging/src/k8s.io/kubectl/pkg/util/term/term.go:135:23: Error return value of `term.RestoreTerminal` is not checked (errcheck)
term.RestoreTerminal(inFd, state)
^
staging/src/k8s.io/kubectl/pkg/util/term/term_writer.go:132:18: Error return value of `m.writer.Write` is not checked (errcheck)
m.writer.Write([]byte{'\n'})
^
staging/src/k8s.io/kubectl/pkg/proxy/proxy_server.go:246:12: Error return value of `util.Umask` is not checked (errcheck)
util.Umask(oldmask)
^
staging/src/k8s.io/kubectl/pkg/util/templates/markdown.go:50:12: Error return value of `w.Write` is not checked (errcheck)
w.Write([]byte(" "))
^
staging/src/k8s.io/kubectl/pkg/util/templates/markdown.go:52:11: Error return value of `w.Write` is not checked (errcheck)
w.Write([]byte(trimmed))
^
staging/src/k8s.io/kubectl/pkg/util/templates/markdown.go:55:10: Error return value of `w.Write` is not checked (errcheck)
w.Write([]byte(linebreak + "----------" + linebreak))
^
staging/src/k8s.io/kubectl/pkg/util/templates/markdown.go:57:10: Error return value of `w.Write` is not checked (errcheck)
w.Write([]byte(linebreak))
^
staging/src/k8s.io/kubectl/pkg/util/templates/markdown.go:64:10: Error return value of `w.Write` is not checked (errcheck)
w.Write([]byte(strings.Join(lines, linebreak)))
^
staging/src/k8s.io/kubectl/pkg/util/templates/markdown.go:66:10: Error return value of `w.Write` is not checked (errcheck)
w.Write(node.LinkData.Destination)
^
staging/src/k8s.io/kubectl/pkg/util/templates/markdown.go:68:10: Error return value of `w.Write` is not checked (errcheck)
w.Write([]byte(" "))
^
staging/src/k8s.io/kubectl/pkg/util/templates/markdown.go:69:10: Error return value of `w.Write` is not checked (errcheck)
w.Write(node.LinkData.Destination)
^
staging/src/k8s.io/kubectl/pkg/util/templates/markdown.go:72:11: Error return value of `w.Write` is not checked (errcheck)
w.Write([]byte(linebreak))
^
staging/src/k8s.io/kubectl/pkg/util/templates/markdown.go:76:11: Error return value of `w.Write` is not checked (errcheck)
w.Write([]byte(linebreak))
^
staging/src/k8s.io/kubectl/pkg/util/templates/markdown.go:86:12: Error return value of `w.Write` is not checked (errcheck)
w.Write([]byte(r.Indentation))
^
staging/src/k8s.io/kubectl/pkg/util/templates/markdown.go:89:12: Error return value of `w.Write` is not checked (errcheck)
w.Write([]byte(fmt.Sprintf("%d. ", r.listItemCount)))
^
staging/src/k8s.io/kubectl/pkg/util/templates/markdown.go:91:12: Error return value of `w.Write` is not checked (errcheck)
w.Write([]byte("* "))
^
staging/src/k8s.io/kubectl/pkg/util/templates/markdown.go:94:11: Error return value of `w.Write` is not checked (errcheck)
w.Write([]byte(linebreak))
^
staging/src/k8s.io/kubectl/pkg/util/templates/markdown.go:103:9: Error return value of `w.Write` is not checked (errcheck)
w.Write([]byte(strings.Trim(string(text), " \n\t")))
^
staging/src/k8s.io/kubectl/pkg/util/templates/markdown.go:113:16: Error return value of `io.WriteString` is not checked (errcheck)
io.WriteString(w, "\n")
^
staging/src/k8s.io/kubectl/pkg/cmd/options/options.go:42:13: Error return value of `cmd.Usage` is not checked (errcheck)
cmd.Usage()
^
staging/src/k8s.io/kubectl/pkg/cmd/help/help.go:55:19: Error return value of `(*github.com/spf13/cobra.Command).Usage` is not checked (errcheck)
cmd.Root().Usage()
^
staging/src/k8s.io/kubectl/pkg/cmd/help/help.go:74:20: Error return value of `(*github.com/spf13/cobra.Command).Usage` is not checked (errcheck)
cmd.Root().Usage()
^
staging/src/k8s.io/kubectl/pkg/explain/formatter_test.go:32:9: Error return value of `f.Write` is not checked (errcheck)
f.Write("Lorem ipsum dolor sit amet, consectetur adipiscing elit.")
^
staging/src/k8s.io/kubectl/pkg/explain/formatter_test.go:34:19: Error return value of `(*k8s.io/kubectl/pkg/explain.Formatter).Write` is not checked (errcheck)
f.Indent(5).Write("Morbi at turpis faucibus, gravida dolor ut, fringilla velit.")
^
staging/src/k8s.io/kubectl/pkg/explain/formatter_test.go:36:19: Error return value of `(*k8s.io/kubectl/pkg/explain.Formatter).Write` is not checked (errcheck)
f.Indent(2).Write("Etiam maximus urna at tellus faucibus mattis.")
^
staging/src/k8s.io/kubectl/pkg/explain/formatter_test.go:55:16: Error return value of `f.WriteWrapped` is not checked (errcheck)
f.WriteWrapped("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi at turpis faucibus, gravida dolor ut, fringilla velit.")
^
staging/src/k8s.io/kubectl/pkg/explain/formatter_test.go:56:27: Error return value of `(*k8s.io/kubectl/pkg/explain.Formatter).WriteWrapped` is not checked (errcheck)
f.Indent(10).WriteWrapped("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi at turpis faucibus, gravida dolor ut, fringilla velit.")
^
staging/src/k8s.io/kubectl/pkg/explain/formatter_test.go:58:27: Error return value of `(*k8s.io/kubectl/pkg/explain.Formatter).WriteWrapped` is not checked (errcheck)
f.Indent(20).WriteWrapped("Lorem ipsum dolor sit amet, consectetur adipiscing elit. ThisIsAVeryLongWordThatDoesn'tFitOnALineOnItsOwn. Morbi at turpis faucibus, gravida dolor ut, fringilla velit.")
^
staging/src/k8s.io/kubectl/pkg/explain/formatter_test.go:60:26: Error return value of `(*k8s.io/kubectl/pkg/explain.Formatter).WriteWrapped` is not checked (errcheck)
f.Indent(4).WriteWrapped(`
^
staging/src/k8s.io/kubectl/pkg/explain/formatter_test.go:127:16: Error return value of `f.WriteWrapped` is not checked (errcheck)
f.WriteWrapped("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi at turpis faucibus, gravida dolor ut, fringilla velit. Etiam maximus urna at tellus faucibus mattis.")
^
staging/src/k8s.io/kubectl/pkg/explain/model_printer.go:102:17: Error return value of `m.Writer.Write` is not checked (errcheck)
m.Writer.Write("RESOURCE: %s <%s>\n", m.Name, m.Type)
^
staging/src/k8s.io/kubectl/pkg/explain/recursive_fields_printer.go:45:17: Error return value of `f.Writer.Write` is not checked (errcheck)
f.Writer.Write("%s\t<%s>", key, GetTypeName(v))
^
staging/src/k8s.io/kubectl/pkg/cmd/util/factory_client_access.go:104:23: Error return value is not checked (errcheck)
setKubernetesDefaults(clientConfig)
^
staging/src/k8s.io/kubectl/pkg/cmd/util/helpers.go:462:21: Error return value of `flags.SetAnnotation` is not checked (errcheck)
flags.SetAnnotation("filename", cobra.BashCompFilenameExt, annotations)
^
staging/src/k8s.io/kubectl/pkg/cmd/util/helpers.go:722:22: Error return value of `printFlags.Complete` is not checked (errcheck)
printFlags.Complete("%s (dry run)")
^
staging/src/k8s.io/kubectl/pkg/cmd/util/helpers.go:724:22: Error return value of `printFlags.Complete` is not checked (errcheck)
printFlags.Complete("%s (server dry run)")
^
staging/src/k8s.io/kubectl/pkg/cmd/util/helpers.go:807:9: Error return value of `c.Help` is not checked (errcheck)
c.Help()
^
staging/src/k8s.io/kubectl/pkg/cmd/util/helpers.go:867:23: Error return value is not checked (errcheck)
setKubernetesDefaults(clientConfig)
^
staging/src/k8s.io/kubectl/pkg/cmd/util/helpers_test.go:468:22: Error return value of `syscall.Unlink` is not checked (errcheck)
defer syscall.Unlink(tempFile.Name())
^
staging/src/k8s.io/kubectl/pkg/cmd/util/helpers_test.go:574:19: Error return value of `(*github.com/spf13/pflag.FlagSet).Set` is not checked (errcheck)
cmd.Flags().Set("validate", tc.validateFlag)
^
staging/src/k8s.io/kubectl/pkg/cmd/util/kubectl_match_version.go:79:23: Error return value is not checked (errcheck)
setKubernetesDefaults(clientConfig)
^
staging/src/k8s.io/kubectl/pkg/describe/describe.go:153:23: Error return value of `printers.WriteEscaped` is not checked (errcheck)
printers.WriteEscaped(pw.out, output)
^
staging/src/k8s.io/kubectl/pkg/describe/describe.go:158:23: Error return value of `printers.WriteEscaped` is not checked (errcheck)
printers.WriteEscaped(pw.out, output)
^
staging/src/k8s.io/kubectl/pkg/describe/describe_test.go:1211:7: Error return value of `d.Add` is not checked (errcheck)
d.Add(
^
staging/src/k8s.io/kubectl/pkg/describe/describe_test.go:1238:7: Error return value of `d.Add` is not checked (errcheck)
d.Add(
^
staging/src/k8s.io/kubectl/pkg/cmd/completion/completion.go:175:11: Error return value of `out.Write` is not checked (errcheck)
out.Write([]byte(zshHead))
^
staging/src/k8s.io/kubectl/pkg/cmd/plugin/plugin_completion.go:91:12: Error return value of `o.Complete` is not checked (errcheck)
o.Complete(kubectl)
^
staging/src/k8s.io/kubectl/pkg/cmd/util/editor/editoptions.go:165:24: Error return value of `o.RecordFlags.Complete` is not checked (errcheck)
o.RecordFlags.Complete(cmd)
^
staging/src/k8s.io/kubectl/pkg/cmd/util/editor/editoptions.go:175:31: Error return value of `o.editPrinterOptions.Complete` is not checked (errcheck)
o.editPrinterOptions.Complete(o.PrintFlags)
^
staging/src/k8s.io/kubectl/pkg/cmd/util/editor/crlf/crlf.go:41:3: assignOp: replace `next = next + i` with `next += i` (gocritic)
next = next + i
^
staging/src/k8s.io/kubectl/pkg/util/resource/resource.go:79:10: elseif: can replace 'else {if cond {}}' with 'else if cond {}' (gocritic)
} else {
^
staging/src/k8s.io/kubectl/pkg/util/apply.go:122:67: sloppyLen: len(original) <= 0 can be len(original) == 0 (gocritic)
if original, err := GetOriginalConfiguration(obj); err != nil || len(original) <= 0 {
^
staging/src/k8s.io/kubectl/pkg/scale/scale_test.go:640:3: commentFormatting: put a space between `//` and comment text (gocritic)
//scenario 2: a resource name cannot be empty
^
staging/src/k8s.io/kubectl/pkg/proxy/proxy_server.go:198:3: assignOp: replace `host = host + "/"` with `host += "/"` (gocritic)
host = host + "/"
^
staging/src/k8s.io/kubectl/pkg/explain/v2/funcs.go:136:42: assignOp: replace `i = i + 2` with `i += 2` (gocritic)
for i := 0; i+1 < len(keysAndValues); i = i + 2 {
^
staging/src/k8s.io/kubectl/pkg/explain/v2/funcs.go:67:12: unlambda: replace `func(s string, sep string) []string {
return strings.Split(s, sep)
}` with `strings.Split` (gocritic)
"split": func(s string, sep string) []string {
^
staging/src/k8s.io/kubectl/pkg/explain/v2/funcs.go:128:17: wrapperFunc: use strings.ReplaceAll method in `strings.Replace(str, "\n", "\n"+pad, -1)` (gocritic)
return pad + strings.Replace(str, "\n", "\n"+pad, -1)
^
staging/src/k8s.io/kubectl/pkg/cmd/help/help.go:53:2: ifElseChain: rewrite if-else to switch statement (gocritic)
if foundCmd == nil {
^
staging/src/k8s.io/kubectl/pkg/cmd/util/sanity/cmd_sanity.go:139:16: regexpMust: for const patterns like `^[a-z]+[a-z\-]*$`, use regexp.MustCompile (gocritic)
regex, err := regexp.Compile(`^[a-z]+[a-z\-]*$`)
^
staging/src/k8s.io/kubectl/pkg/explain/formatter.go:35:2: assignOp: replace `f.IndentLevel = f.IndentLevel + indent` with `f.IndentLevel += indent` (gocritic)
f.IndentLevel = f.IndentLevel + indent
^
staging/src/k8s.io/kubectl/pkg/explain/formatter.go:50:3: assignOp: replace `indent = indent + " "` with `indent += " "` (gocritic)
indent = indent + " "
^
staging/src/k8s.io/kubectl/pkg/cmd/util/helpers.go:759:3: ifElseChain: rewrite if-else to switch statement (gocritic)
if strings.Contains(pairArg, "=") && pairArg[0] != '=' {
^
staging/src/k8s.io/kubectl/pkg/cmd/util/helpers.go:262:2: singleCaseSwitch: should rewrite switch statement to if statement (gocritic)
switch t := err.(type) {
^
staging/src/k8s.io/kubectl/pkg/cmd/util/helpers.go:265:3: singleCaseSwitch: should rewrite switch statement to if statement (gocritic)
switch {
^
staging/src/k8s.io/kubectl/pkg/cmd/util/helpers.go:304:2: singleCaseSwitch: should rewrite switch statement to if statement (gocritic)
switch t := err.(type) {
^
staging/src/k8s.io/kubectl/pkg/describe/describe.go:1058:3: ifElseChain: rewrite if-else to switch statement (gocritic)
if source.Secret != nil {
^
staging/src/k8s.io/kubectl/pkg/describe/describe.go:4252:3: ifElseChain: rewrite if-else to switch statement (gocritic)
if e.Series != nil {
^
staging/src/k8s.io/kubectl/pkg/describe/describe.go:4533:5: ifElseChain: rewrite if-else to switch statement (gocritic)
if from.PodSelector != nil && from.NamespaceSelector != nil {
^
staging/src/k8s.io/kubectl/pkg/describe/describe.go:4577:5: ifElseChain: rewrite if-else to switch statement (gocritic)
if to.PodSelector != nil && to.NamespaceSelector != nil {
^
staging/src/k8s.io/kubectl/pkg/describe/describe.go:5384:2: ifElseChain: rewrite if-else to switch statement (gocritic)
if denied {
^
staging/src/k8s.io/kubectl/pkg/cmd/plugin/plugin_completion.go:103:24: wrapperFunc: use strings.ReplaceAll method in `strings.Replace(arg, "_", "-", -1)` (gocritic)
args = append(args, strings.Replace(arg, "_", "-", -1))
^
staging/src/k8s.io/kubectl/pkg/cmd/plugin/plugin_completion.go:163:32: wrapperFunc: use strings.ReplaceAll method in `strings.Replace(cmd.CommandPath(), "-", "_", -1)` (gocritic)
pluginName := strings.Replace(strings.Replace(cmd.CommandPath(), "-", "_", -1), " ", "-", -1)
^
staging/src/k8s.io/kubectl/pkg/cmd/plugin/plugin_test.go:159:4: ifElseChain: rewrite if-else to switch statement (gocritic)
if err == nil && len(test.expectErr) > 0 {
^
staging/src/k8s.io/kubectl/pkg/drain/drain.go:302:5: ifElseChain: rewrite if-else to switch statement (gocritic)
if err == nil {
^
staging/src/k8s.io/kubectl/pkg/drain/drain.go:404:4: ifElseChain: rewrite if-else to switch statement (gocritic)
if apierrors.IsNotFound(err) || (p != nil && p.ObjectMeta.UID != pod.ObjectMeta.UID) {
^
staging/src/k8s.io/kubectl/pkg/util/openapi/openapi_getter_test.go:37:2: assignOp: replace `f.Calls = f.Calls + 1` with `f.Calls++` (gocritic)
f.Calls = f.Calls + 1
^
staging/src/k8s.io/kubectl/pkg/polymorphichelpers/attachablepodforobject.go:33:2: singleCaseSwitch: should rewrite switch statement to if statement (gocritic)
switch t := object.(type) {
^
staging/src/k8s.io/kubectl/pkg/polymorphichelpers/rollout_status.go:96:2: commentFormatting: put a space between `//` and comment text (gocritic)
//ignoring revision as DaemonSets does not have history yet
^
staging/src/k8s.io/kubectl/pkg/cmd/events/event_printer.go:90:2: ifElseChain: rewrite if-else to switch statement (gocritic)
if e.Series != nil {
^
staging/src/k8s.io/kubectl/pkg/cmd/events/events_test.go:113:5: dupSubExpr: suspicious identical LHS and RHS for `!=` operator (gocritic)
if err != err {
^
staging/src/k8s.io/kubectl/pkg/cmd/events/events_test.go:151:5: dupSubExpr: suspicious identical LHS and RHS for `!=` operator (gocritic)
if err != err {
^
staging/src/k8s.io/kubectl/pkg/cmd/events/events_test.go:188:5: dupSubExpr: suspicious identical LHS and RHS for `!=` operator (gocritic)
if err != err {
^
staging/src/k8s.io/kubectl/pkg/cmd/auth/whoami.go:191:2: typeSwitchVar: 2 cases can benefit from type switch with assignment (gocritic)
switch obj.(type) {
^
staging/src/k8s.io/kubectl/pkg/cmd/get/customcolumn_flags.go:66:4: assignOp: replace `format = format + "="` with `format += "="` (gocritic)
format = format + "="
^
staging/src/k8s.io/kubectl/pkg/cmd/get/sorter.go:217:3: ifElseChain: rewrite if-else to switch statement (gocritic)
if i.IsNil() && j.IsNil() {
^
staging/src/k8s.io/kubectl/pkg/cmd/get/sorter.go:87:2: singleCaseSwitch: should rewrite switch statement to if statement (gocritic)
switch list := obj.(type) {
^
staging/src/k8s.io/kubectl/pkg/cmd/get/sorter.go:104:3: singleCaseSwitch: should rewrite switch statement to if statement (gocritic)
switch u := item.(type) {
^
staging/src/k8s.io/kubectl/pkg/cmd/get/get_test.go:1242:144: underef: could simplify (*statuses).Items to statuses.Items (gocritic)
Resp: &http.Response{StatusCode: http.StatusOK, Header: cmdtesting.DefaultHeader(), Body: componentStatusTableObjBody(codec, (*statuses).Items...)},
^
staging/src/k8s.io/kubectl/pkg/cmd/set/set_image.go:190:9: elseif: can replace 'else {if cond {}}' with 'else if cond {}' (gocritic)
} else {
^
staging/src/k8s.io/kubectl/pkg/cmd/set/set_resources.go:128:2: commentFormatting: put a space between `//` and comment text (gocritic)
//usage := "Filename, directory, or URL to a file identifying the resource to get from the server"
^
staging/src/k8s.io/kubectl/pkg/cmd/set/set_resources.go:273:3: commentFormatting: put a space between `//` and comment text (gocritic)
//no changes
^
staging/src/k8s.io/kubectl/pkg/cmd/set/set_resources.go:184:9: elseif: can replace 'else {if cond {}}' with 'else if cond {}' (gocritic)
} else {
^
staging/src/k8s.io/kubectl/pkg/cmd/set/set_subject.go:255:3: commentFormatting: put a space between `//` and comment text (gocritic)
//no changes
^
staging/src/k8s.io/kubectl/pkg/cmd/exec/exec.go:178:2: ifElseChain: rewrite if-else to switch statement (gocritic)
if argsLenAtDash > -1 {
^
staging/src/k8s.io/kubectl/pkg/cmd/annotate/annotate_test.go:571:2: commentFormatting: put a space between `//` and comment text (gocritic)
//options := NewAnnotateOptions(iostreams)
^
staging/src/k8s.io/kubectl/pkg/cmd/label/label.go:233:9: elseif: can replace 'else {if cond {}}' with 'else if cond {}' (gocritic)
} else {
^
staging/src/k8s.io/kubectl/pkg/cmd/label/label.go:413:3: ifElseChain: rewrite if-else to switch statement (gocritic)
if strings.Contains(labelSpec, "=") {
^
staging/src/k8s.io/kubectl/pkg/cmd/top/top_node_test.go:261:13: unslice: could simplify metrics.Items[:] to metrics.Items (gocritic)
Items: metrics.Items[:],
^
staging/src/k8s.io/kubectl/pkg/cmd/top/top_node_test.go:347:13: unslice: could simplify metrics.Items[:] to metrics.Items (gocritic)
Items: metrics.Items[:],
^
staging/src/k8s.io/kubectl/pkg/cmd/get/sorter_test.go:706:2: S1021: should merge variable declaration with assignment on next line (gosimple)
var testobj runtime.Object
^
staging/src/k8s.io/kubectl/pkg/drain/filters.go:250:7: S1012: should use `time.Since` instead of `time.Now().Sub` (gosimple)
int(time.Now().Sub(pod.ObjectMeta.GetDeletionTimestamp().Time).Seconds()) > skipDeletedTimeoutSeconds
^
staging/src/k8s.io/kubectl/pkg/cmd/proxy/proxy.go:164:5: S1002: should omit comparison to bool constant, can be simplified to `!o.appendServerPath` (gosimple)
if o.appendServerPath == false {
^
staging/src/k8s.io/kubectl/pkg/cmd/apiresources/apiresources.go:210:5: S1002: should omit comparison to bool constant, can be simplified to `!o.NoHeaders` (gosimple)
if o.NoHeaders == false && o.Output != "name" {
^
staging/src/k8s.io/kubectl/pkg/cmd/wait/wait.go:456:6: S1002: should omit comparison to bool constant, can be simplified to `!conditionCheck` (gosimple)
if conditionCheck == false {
^
staging/src/k8s.io/kubectl/pkg/cmd/set/env/env_parse.go:31:27: S1007: should use raw string (`...`) with regexp.MustCompile to avoid having to escape twice (gosimple)
var argumentEnvironment = regexp.MustCompile("(?ms)^(.+)\\=(.*)$")
^
staging/src/k8s.io/kubectl/pkg/cmd/auth/cani.go:186:11: S1028: should use fmt.Errorf(...) instead of errors.New(fmt.Sprintf(...)) (gosimple)
return errors.New(fmt.Sprintf("%s\n%s", errString, usageString))
^
staging/src/k8s.io/kubectl/pkg/cmd/version/version.go:116:10: S1028: should use fmt.Errorf(...) instead of errors.New(fmt.Sprintf(...)) (gosimple)
return errors.New(fmt.Sprintf("extra arguments: %v", o.args))
^
staging/src/k8s.io/kubectl/pkg/drain/drain.go:355:3: S1000: should use a simple channel send/receive instead of `select` with a single case (gosimple)
select {
^
staging/src/k8s.io/kubectl/pkg/cmd/auth/whoami.go:193:10: S1034(related information): could eliminate this type assertion (gosimple)
return obj.(*authenticationv1alpha1.SelfSubjectReview).Status.UserInfo, nil
^
staging/src/k8s.io/kubectl/pkg/cmd/auth/whoami.go:195:10: S1034(related information): could eliminate this type assertion (gosimple)
return obj.(*authenticationv1beta1.SelfSubjectReview).Status.UserInfo, nil
^
staging/src/k8s.io/kubectl/pkg/cmd/debug/profiles.go:114:22: S1034(related information): could eliminate this type assertion (gosimple)
if asserted, ok := target.(*corev1.Pod); ok {
^
staging/src/k8s.io/kubectl/pkg/polymorphichelpers/rollout_status.go:91:9: S1039: unnecessary use of fmt.Sprintf (gosimple)
return fmt.Sprintf("Waiting for deployment spec update to be observed...\n"), false, nil
^
staging/src/k8s.io/kubectl/pkg/polymorphichelpers/rollout_status.go:116:9: S1039: unnecessary use of fmt.Sprintf (gosimple)
return fmt.Sprintf("Waiting for daemon set spec update to be observed...\n"), false, nil
^
staging/src/k8s.io/kubectl/pkg/polymorphichelpers/history_test.go:78:14: S1039: unnecessary use of fmt.Sprintf (gosimple)
Image: fmt.Sprintf("foo:1"),
^
staging/src/k8s.io/kubectl/pkg/cmd/apply/apply_view_last_applied.go:158:22: S1030: should use jsonBuffer.String() instead of string(jsonBuffer.Bytes()) (gosimple)
fmt.Fprint(o.Out, string(jsonBuffer.Bytes()))
^
staging/src/k8s.io/kubectl/pkg/cmd/create/create_clusterrole_test.go:166:10: S1030: should use buf.String() instead of string(buf.Bytes()) (gosimple)
t.Log(string(buf.Bytes()))
^
staging/src/k8s.io/kubectl/pkg/cmd/label/label_test.go:368:44: S1030: should use buf.String() instead of string(buf.Bytes()) (gosimple)
t.Errorf("buffer should be empty: %s", string(buf.Bytes()))
^
staging/src/k8s.io/kubectl/pkg/cmd/apply/patcher.go:265:12: SA1019: wait.PollImmediate is deprecated: This method does not return errors from context, use PollWithContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
if err := wait.PollImmediate(1*time.Second, p.Timeout, func() (bool, error) {
^
staging/src/k8s.io/kubectl/pkg/cmd/apply/apply_test.go:1920:30: SA1019: utilpointer.Int32Ptr is deprecated: Use Int32 instead. (staticcheck)
rcObj.Spec.Replicas = utilpointer.Int32Ptr(0)
^
staging/src/k8s.io/kubectl/pkg/cmd/config/navigation_step_parser.go:101:47: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
func findNameStep(parts []string, typeOptions sets.String) string {
^
staging/src/k8s.io/kubectl/pkg/cmd/config/navigation_step_parser.go:139:50: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
func findKnownValue(parts []string, valueOptions sets.String) int {
^
staging/src/k8s.io/kubectl/pkg/cmd/debug/profiles_test.go:605:21: SA1019: pointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
Privileged: pointer.BoolPtr(true),
^
staging/src/k8s.io/kubectl/pkg/cmd/debug/profiles_test.go:625:21: SA1019: pointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
Privileged: pointer.BoolPtr(true),
^
staging/src/k8s.io/kubectl/pkg/cmd/debug/profiles_test.go:647:21: SA1019: pointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
Privileged: pointer.BoolPtr(true),
^
staging/src/k8s.io/kubectl/pkg/cmd/drain/drain_test.go:281:26: SA1019: utilpointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
BlockOwnerDeletion: utilpointer.BoolPtr(true),
^
staging/src/k8s.io/kubectl/pkg/cmd/drain/drain_test.go:282:26: SA1019: utilpointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
Controller: utilpointer.BoolPtr(true),
^
staging/src/k8s.io/kubectl/pkg/cmd/drain/drain_test.go:313:26: SA1019: utilpointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
BlockOwnerDeletion: utilpointer.BoolPtr(true),
^
staging/src/k8s.io/kubectl/pkg/cmd/drain/drain_test.go:314:26: SA1019: utilpointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
Controller: utilpointer.BoolPtr(true),
^
staging/src/k8s.io/kubectl/pkg/cmd/drain/drain_test.go:334:26: SA1019: utilpointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
BlockOwnerDeletion: utilpointer.BoolPtr(true),
^
staging/src/k8s.io/kubectl/pkg/cmd/drain/drain_test.go:335:26: SA1019: utilpointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
Controller: utilpointer.BoolPtr(true),
^
staging/src/k8s.io/kubectl/pkg/cmd/drain/drain_test.go:358:26: SA1019: utilpointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
BlockOwnerDeletion: utilpointer.BoolPtr(true),
^
staging/src/k8s.io/kubectl/pkg/cmd/drain/drain_test.go:359:26: SA1019: utilpointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
Controller: utilpointer.BoolPtr(true),
^
staging/src/k8s.io/kubectl/pkg/cmd/drain/drain_test.go:408:26: SA1019: utilpointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
BlockOwnerDeletion: utilpointer.BoolPtr(true),
^
staging/src/k8s.io/kubectl/pkg/cmd/drain/drain_test.go:409:26: SA1019: utilpointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
Controller: utilpointer.BoolPtr(true),
^
staging/src/k8s.io/kubectl/pkg/cmd/drain/drain_test.go:435:26: SA1019: utilpointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
BlockOwnerDeletion: utilpointer.BoolPtr(true),
^
staging/src/k8s.io/kubectl/pkg/cmd/drain/drain_test.go:436:26: SA1019: utilpointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
Controller: utilpointer.BoolPtr(true),
^
staging/src/k8s.io/kubectl/pkg/cmd/drain/drain_test.go:477:26: SA1019: utilpointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
BlockOwnerDeletion: utilpointer.BoolPtr(true),
^
staging/src/k8s.io/kubectl/pkg/cmd/drain/drain_test.go:478:26: SA1019: utilpointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
Controller: utilpointer.BoolPtr(true),
^
staging/src/k8s.io/kubectl/pkg/cmd/get/get.go:630:19: SA1019: utilpointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
outputObjects := utilpointer.BoolPtr(!o.WatchOnly)
^
staging/src/k8s.io/kubectl/pkg/cmd/portforward/portforward.go:225:33: SA1019: sets.Int is deprecated: use generic Set instead. new ways: s1 := Set[int]{} s2 := New[int]() (staticcheck)
func checkUDPPorts(udpOnlyPorts sets.Int, ports []string, obj metav1.Object) error {
^
staging/src/k8s.io/kubectl/pkg/cmd/replace/replace.go:368:10: SA1019: wait.PollImmediate is deprecated: This method does not return errors from context, use PollWithContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
return wait.PollImmediate(1*time.Second, timeout, func() (bool, error) {
^
staging/src/k8s.io/kubectl/pkg/cmd/taint/utils.go:41:41: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
uniqueTaints := map[corev1.TaintEffect]sets.String{}
^
staging/src/k8s.io/kubectl/pkg/cmd/taint/utils.go:65:37: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
uniqueTaints[newTaint.Effect] = sets.String{}
^
staging/src/k8s.io/kubectl/pkg/cmd/wait/wait.go:350:49: SA1019: wait.ErrWaitTimeout is deprecated: This type will be made private in favor of Interrupted() for checking errors or ErrorInterrupted(err) for returning a wrapped error. (staticcheck)
errWaitTimeoutWithName := extendErrWaitTimeout(wait.ErrWaitTimeout, info)
^
staging/src/k8s.io/kubectl/pkg/cmd/wait/wait.go:400:13: SA1019: wait.ErrWaitTimeout is deprecated: This type will be made private in favor of Interrupted() for checking errors or ErrorInterrupted(err) for returning a wrapped error. (staticcheck)
if err == wait.ErrWaitTimeout {
^
staging/src/k8s.io/kubectl/pkg/cmd/wait/wait.go:442:49: SA1019: wait.ErrWaitTimeout is deprecated: This type will be made private in favor of Interrupted() for checking errors or ErrorInterrupted(err) for returning a wrapped error. (staticcheck)
errWaitTimeoutWithName := extendErrWaitTimeout(wait.ErrWaitTimeout, info)
^
staging/src/k8s.io/kubectl/pkg/cmd/wait/wait.go:507:13: SA1019: wait.ErrWaitTimeout is deprecated: This type will be made private in favor of Interrupted() for checking errors or ErrorInterrupted(err) for returning a wrapped error. (staticcheck)
if err == wait.ErrWaitTimeout {
^
staging/src/k8s.io/kubectl/pkg/describe/describe.go:370:11: SA1019: strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead. (staticcheck)
part = strings.Title(part)
^
staging/src/k8s.io/kubectl/pkg/describe/describe.go:1429:149: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
func printCSIPersistentVolumeAttributesMultilineIndent(w PrefixWriter, initialIndent, title, innerIndent string, attributes map[string]string, skip sets.String) {
^
staging/src/k8s.io/kubectl/pkg/describe/describe.go:3342:107: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
func describeServiceAccount(serviceAccount *corev1.ServiceAccount, tokens []corev1.Secret, missingSecrets sets.String, events *corev1.EventList) (string, error) {
^
staging/src/k8s.io/kubectl/pkg/describe/describe.go:5030:126: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
func printLabelsMultilineWithIndent(w PrefixWriter, initialIndent, title, innerIndent string, labels map[string]string, skip sets.String) {
^
staging/src/k8s.io/kubectl/pkg/describe/describe.go:5322:57: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
func formatEndpoints(endpoints *corev1.Endpoints, ports sets.String) string {
^
staging/src/k8s.io/kubectl/pkg/describe/describe_test.go:1270:58: SA1019: utilpointer.Int32Ptr is deprecated: Use Int32 instead. (staticcheck)
Spec: corev1.ReplicationControllerSpec{Replicas: utilpointer.Int32Ptr(1)},
^
staging/src/k8s.io/kubectl/pkg/describe/describe_test.go:2005:17: SA1019: utilpointer.Int32Ptr is deprecated: Use Int32 instead. (staticcheck)
Replicas: utilpointer.Int32Ptr(1),
^
staging/src/k8s.io/kubectl/pkg/describe/describe_test.go:2050:21: SA1019: utilpointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
Controller: utilpointer.BoolPtr(true),
^
staging/src/k8s.io/kubectl/pkg/describe/describe_test.go:2056:17: SA1019: utilpointer.Int32Ptr is deprecated: Use Int32 instead. (staticcheck)
Replicas: utilpointer.Int32Ptr(1),
^
staging/src/k8s.io/kubectl/pkg/describe/describe_test.go:2126:17: SA1019: utilpointer.Int32Ptr is deprecated: Use Int32 instead. (staticcheck)
Replicas: utilpointer.Int32Ptr(2),
^
staging/src/k8s.io/kubectl/pkg/describe/describe_test.go:2178:21: SA1019: utilpointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
Controller: utilpointer.BoolPtr(true),
^
staging/src/k8s.io/kubectl/pkg/describe/describe_test.go:2184:17: SA1019: utilpointer.Int32Ptr is deprecated: Use Int32 instead. (staticcheck)
Replicas: utilpointer.Int32Ptr(2),
^
staging/src/k8s.io/kubectl/pkg/describe/describe_test.go:2235:21: SA1019: utilpointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
Controller: utilpointer.BoolPtr(true),
^
staging/src/k8s.io/kubectl/pkg/describe/describe_test.go:2241:17: SA1019: utilpointer.Int32Ptr is deprecated: Use Int32 instead. (staticcheck)
Replicas: utilpointer.Int32Ptr(1),
^
staging/src/k8s.io/kubectl/pkg/describe/describe_test.go:2386:17: SA1019: utilpointer.Int32Ptr is deprecated: Use Int32 instead. (staticcheck)
Replicas: utilpointer.Int32Ptr(2),
^
staging/src/k8s.io/kubectl/pkg/describe/describe_test.go:2438:21: SA1019: utilpointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
Controller: utilpointer.BoolPtr(true),
^
staging/src/k8s.io/kubectl/pkg/describe/describe_test.go:2444:17: SA1019: utilpointer.Int32Ptr is deprecated: Use Int32 instead. (staticcheck)
Replicas: utilpointer.Int32Ptr(0),
^
staging/src/k8s.io/kubectl/pkg/describe/describe_test.go:2495:21: SA1019: utilpointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
Controller: utilpointer.BoolPtr(true),
^
staging/src/k8s.io/kubectl/pkg/describe/describe_test.go:2501:17: SA1019: utilpointer.Int32Ptr is deprecated: Use Int32 instead. (staticcheck)
Replicas: utilpointer.Int32Ptr(2),
^
staging/src/k8s.io/kubectl/pkg/describe/describe_test.go:2841:14: SA1019: utilpointer.StringPtr is deprecated: Use String instead. (staticcheck)
APIGroup: utilpointer.StringPtr("example.com"),
^
staging/src/k8s.io/kubectl/pkg/util/resource/resource.go:125:13: ST1005: error strings should not be capitalized (stylecheck)
return "", fmt.Errorf("Unsupported container resource : %v", fs.Resource)
^
staging/src/k8s.io/kubectl/pkg/cmd/explain/explain.go:136:10: ST1005: error strings should not end with punctuation or newlines (stylecheck)
return fmt.Errorf("You must specify the type of resource to explain. %s\n", cmdutil.SuggestAPIResources(o.CmdParent))
^
staging/src/k8s.io/kubectl/pkg/cmd/explain/explain.go:139:10: ST1005: error strings should not end with punctuation or newlines (stylecheck)
return fmt.Errorf("We accept only this format: explain RESOURCE\n")
^
staging/src/k8s.io/kubectl/pkg/cmd/scale/scale.go:181:10: ST1005: error strings should not be capitalized (stylecheck)
return fmt.Errorf("The --replicas=COUNT flag is required, and COUNT must be greater than or equal to 0")
^
staging/src/k8s.io/kubectl/pkg/cmd/scale/scale.go:185:10: ST1005: error strings should not be capitalized (stylecheck)
return fmt.Errorf("The --current-replicas must specify an integer of -1 or greater")
^
staging/src/k8s.io/kubectl/pkg/cmd/apply/apply.go:582:11: ST1005: error strings should not be capitalized (stylecheck)
err = fmt.Errorf("Server-side apply not available on the server: (%v)", err)
^
staging/src/k8s.io/kubectl/pkg/cmd/apply/patcher.go:283:10: ST1005: error strings should not be capitalized (stylecheck)
err = fmt.Errorf("An error occurred force-replacing the existing object with the newly provided one:\n\n%v.\n\nAdditionally, an error occurred attempting to restore the original object:\n\n%v", err, recreateErr)
^
staging/src/k8s.io/kubectl/pkg/cmd/config/rename_context.go:95:10: ST1005: error strings should not be capitalized (stylecheck)
return errors.New("You must specify a new non-empty context name")
^
staging/src/k8s.io/kubectl/pkg/cmd/create/create_quota.go:237:16: ST1005: error strings should not be capitalized (stylecheck)
return nil, fmt.Errorf("Invalid argument syntax %v, expected <resource>=<value>", resourceStatement)
^
staging/src/k8s.io/kubectl/pkg/cmd/create/create_secret_tls.go:245:20: ST1005: error strings should not be capitalized (stylecheck)
return []byte{}, fmt.Errorf("Cannot read file %v, %v", file, err)
^
staging/src/k8s.io/kubectl/pkg/cmd/debug/debug.go:269:10: ST1005: error strings should not end with punctuation or newlines (stylecheck)
return fmt.Errorf("you must specify --container or create a new container using --image in order to attach.")
^
staging/src/k8s.io/kubectl/pkg/cmd/debug/debug.go:275:11: ST1005: error strings should not end with punctuation or newlines (stylecheck)
return fmt.Errorf("you must specify --image, --set-image or command arguments.")
^
staging/src/k8s.io/kubectl/pkg/cmd/debug/debug.go:278:11: ST1005: error strings should not end with punctuation or newlines (stylecheck)
return fmt.Errorf("you must specify an existing container or a new image when specifying args.")
^
staging/src/k8s.io/kubectl/pkg/cmd/debug/debug.go:284:11: ST1005: error strings should not end with punctuation or newlines (stylecheck)
return fmt.Errorf("--replace may only be used with --copy-to.")
^
staging/src/k8s.io/kubectl/pkg/cmd/debug/debug.go:286:11: ST1005: error strings should not end with punctuation or newlines (stylecheck)
return fmt.Errorf("--same-node may only be used with --copy-to.")
^
staging/src/k8s.io/kubectl/pkg/cmd/debug/debug.go:288:11: ST1005: error strings should not end with punctuation or newlines (stylecheck)
return fmt.Errorf("--set-image may only be used with --copy-to.")
^
staging/src/k8s.io/kubectl/pkg/cmd/debug/debug.go:290:11: ST1005: error strings should not end with punctuation or newlines (stylecheck)
return fmt.Errorf("you must specify --image when not using --copy-to.")
^
staging/src/k8s.io/kubectl/pkg/cmd/debug/debug.go:322:11: ST1005: error strings should not end with punctuation or newlines (stylecheck)
return fmt.Errorf("--target is incompatible with --copy-to. Use --share-processes instead.")
^
staging/src/k8s.io/kubectl/pkg/cmd/describe/describe.go:119:15: ST1005: error strings should not end with punctuation or newlines (stylecheck)
return nil, fmt.Errorf("You must specify the type of resource to describe. %s\n", cmdutil.SuggestAPIResources(parent))
^
staging/src/k8s.io/kubectl/pkg/cmd/diff/diff.go:268:14: ST1005: error strings should not be capitalized (stylecheck)
return nil, fmt.Errorf("Unknown version: %v", v.Name)
^
staging/src/k8s.io/kubectl/pkg/cmd/get/customcolumn.go:112:15: ST1005: error strings should not end with punctuation or newlines (stylecheck)
return nil, fmt.Errorf("invalid template, missing header line. Expected format is one line of space separated headers, one line of space separated column specs.")
^
staging/src/k8s.io/kubectl/pkg/cmd/get/customcolumn.go:117:15: ST1005: error strings should not end with punctuation or newlines (stylecheck)
return nil, fmt.Errorf("invalid template, missing spec line. Expected format is one line of space separated headers, one line of space separated column specs.")
^
staging/src/k8s.io/kubectl/pkg/cmd/get/customcolumn_flags.go:91:16: ST1005: error strings should not end with punctuation or newlines (stylecheck)
return nil, fmt.Errorf("error reading template %s, %v\n", templateValue, err)
^
staging/src/k8s.io/kubectl/pkg/cmd/get/sorter.go:401:16: ST1005: error strings should not be capitalized (stylecheck)
return nil, fmt.Errorf("Failed to get values for %#v using %s (%#v)", parsedRow, field, err)
^
staging/src/k8s.io/kubectl/pkg/cmd/patch/patch.go:336:18: ST1005: error strings should not be capitalized (stylecheck)
return bytes, fmt.Errorf("Object to be patched is missing field (%s)", key)
^
staging/src/k8s.io/kubectl/pkg/cmd/run/run.go:276:10: ST1005: error strings should not be capitalized (stylecheck)
return fmt.Errorf("Invalid image name %q: %v", o.Image, reference.ErrReferenceInvalidFormat)
^
staging/src/k8s.io/kubectl/pkg/cmd/set/set_env.go:505:30: ST1005: error strings should not end with punctuation or newlines (stylecheck)
allErrs = append(allErrs, fmt.Errorf("error: %s %v\n", name, patch.Err))
^
staging/src/k8s.io/kubectl/pkg/cmd/set/set_image.go:266:30: ST1005: error strings should not end with punctuation or newlines (stylecheck)
allErrs = append(allErrs, fmt.Errorf("error: %s %v\n", name, patch.Err))
^
staging/src/k8s.io/kubectl/pkg/cmd/set/set_resources.go:269:30: ST1005: error strings should not end with punctuation or newlines (stylecheck)
allErrs = append(allErrs, fmt.Errorf("error: %s %v\n", name, patch.Err))
^
staging/src/k8s.io/kubectl/pkg/cmd/set/set_serviceaccount.go:198:34: ST1005: error strings should not end with punctuation or newlines (stylecheck)
patchErrs = append(patchErrs, fmt.Errorf("error: %s %v\n", name, patch.Err))
^
staging/src/k8s.io/kubectl/pkg/cmd/set/set_subject.go:251:30: ST1005: error strings should not end with punctuation or newlines (stylecheck)
allErrs = append(allErrs, fmt.Errorf("error: %s %v\n", name, patch.Err))
^
staging/src/k8s.io/kubectl/pkg/cmd/set/env/env_resolve.go:216:13: ST1005: error strings should not be capitalized (stylecheck)
return "", fmt.Errorf("Unsupported container resource : %v", fs.Resource)
^
staging/src/k8s.io/kubectl/pkg/cmd/top/top_node.go:164:10: ST1005: error strings should not be capitalized (stylecheck)
return errors.New("Metrics API not available")
^
staging/src/k8s.io/kubectl/pkg/cmd/top/top_pod.go:196:10: ST1005: error strings should not be capitalized (stylecheck)
return errors.New("Metrics API not available")
^
staging/src/k8s.io/kubectl/pkg/cmd/util/helpers.go:701:23: ST1005: error strings should not end with punctuation or newlines (stylecheck)
return DryRunNone, fmt.Errorf(`Invalid dry-run value (%v). Must be "none", "server", or "client".`, dryRunFlag)
^
staging/src/k8s.io/kubectl/pkg/generate/generate.go:72:31: ST1005: error strings should not be capitalized (stylecheck)
allErrs = append(allErrs, fmt.Errorf("Parameter: %s is required", paramSpec[ix].Name))
^
staging/src/k8s.io/kubectl/pkg/generate/versioned/run.go:144:16: ST1005: error strings should not be capitalized (stylecheck)
return nil, fmt.Errorf("Invalid argument syntax %v, expected <resource>=<value>", resourceStatement)
^
staging/src/k8s.io/kubectl/pkg/polymorphichelpers/logsforobject.go:108:17: ST1005: error strings should not be capitalized (stylecheck)
return nil, fmt.Errorf("Unable to construct reference to '%#v': %v", t, err)
^
staging/src/k8s.io/kubectl/pkg/util/pod_port.go:35:20: ST1005: error strings should not be capitalized (stylecheck)
return int32(-1), fmt.Errorf("Pod '%s' does not have a named port '%s'", pod.Name, name)
^
staging/src/k8s.io/kubectl/pkg/util/service_port.go:47:15: ST1005: error strings should not be capitalized (stylecheck)
return port, fmt.Errorf("Service %s does not have a service port %d", svc.Name, port)
^
staging/src/k8s.io/kubectl/pkg/util/service_port.go:58:20: ST1005: error strings should not be capitalized (stylecheck)
return int32(-1), fmt.Errorf("Service '%s' does not have a named port '%s'", svc.Name, name)
^
staging/src/k8s.io/kubectl/pkg/util/prune/prune.go:113:27: ST1005: error strings should not be capitalized (stylecheck)
return pruneResources, fmt.Errorf("Unknown namespace scope: %q", namespaceScope)
^
staging/src/k8s.io/kubectl/pkg/util/templates/templater.go:76:11: ST1005: error strings should not end with punctuation or newlines (stylecheck)
return fmt.Errorf("%s\nRun '%s' without flags.", err, c.CommandPath())
^
staging/src/k8s.io/kubectl/pkg/util/templates/templater.go:78:11: ST1005: error strings should not end with punctuation or newlines (stylecheck)
return fmt.Errorf("%s\nSee '%s --help' for usage.", err, c.CommandPath())
^
staging/src/k8s.io/kubectl/pkg/cmd/auth/whoami.go:153:2: ST1012: error var notEnabledErr should have name of the form errFoo (stylecheck)
notEnabledErr = fmt.Errorf(
^
staging/src/k8s.io/kubectl/pkg/cmd/auth/whoami.go:157:2: ST1012: error var forbiddenErr should have name of the form errFoo (stylecheck)
forbiddenErr = fmt.Errorf(
^
staging/src/k8s.io/kubectl/pkg/cmd/logs/logs.go:107:2: ST1011: var SinceSeconds is of type time.Duration; don't use unit-specific suffix "Seconds" (stylecheck)
SinceSeconds time.Duration
^
staging/src/k8s.io/kubectl/pkg/util/templates/templater.go:83:29: ST1016: methods on the same type should have the same receiver name (seen 6x "templater", 7x "t") (stylecheck)
func (templater *templater) ExposeFlags(cmd *cobra.Command, flags ...string) FlagExposer {
^
staging/src/k8s.io/kubectl/pkg/cmd/testing/util.go:170:6: ST1003: func GenResponseWithJsonEncodedBody should be GenResponseWithJSONEncodedBody (stylecheck)
func GenResponseWithJsonEncodedBody(bodyStruct interface{}) (*http.Response, error) {
^
staging/src/k8s.io/kubectl/pkg/cmd/apply/applyset.go:73:2: ST1003: const V1ApplySetIdFormat should be V1ApplySetIDFormat (stylecheck)
V1ApplySetIdFormat = "applyset-%s-v1"
^
running ( cd /nvme/gopath/src/k8s.io/kubernetes/staging/src/k8s.io/kubelet; env LOGCHECK_CONFIG=/nvme/gopath/src/k8s.io/kubernetes/hack/logcheck.conf /nvme/gopath/src/k8s.io/kubernetes/_output/local/bin/golangci-lint run --config=/nvme/gopath/src/k8s.io/kubernetes/hack/golangci-strict.yaml --path-prefix staging/src/k8s.io/kubelet ./... )
running ( cd /nvme/gopath/src/k8s.io/kubernetes/staging/src/k8s.io/kube-proxy; env LOGCHECK_CONFIG=/nvme/gopath/src/k8s.io/kubernetes/hack/logcheck.conf /nvme/gopath/src/k8s.io/kubernetes/_output/local/bin/golangci-lint run --config=/nvme/gopath/src/k8s.io/kubernetes/hack/golangci-strict.yaml --path-prefix staging/src/k8s.io/kube-proxy ./... )
running ( cd /nvme/gopath/src/k8s.io/kubernetes/staging/src/k8s.io/kube-scheduler; env LOGCHECK_CONFIG=/nvme/gopath/src/k8s.io/kubernetes/hack/logcheck.conf /nvme/gopath/src/k8s.io/kubernetes/_output/local/bin/golangci-lint run --config=/nvme/gopath/src/k8s.io/kubernetes/hack/golangci-strict.yaml --path-prefix staging/src/k8s.io/kube-scheduler ./... )
running ( cd /nvme/gopath/src/k8s.io/kubernetes/staging/src/k8s.io/legacy-cloud-providers; env LOGCHECK_CONFIG=/nvme/gopath/src/k8s.io/kubernetes/hack/logcheck.conf /nvme/gopath/src/k8s.io/kubernetes/_output/local/bin/golangci-lint run --config=/nvme/gopath/src/k8s.io/kubernetes/hack/golangci-strict.yaml --path-prefix staging/src/k8s.io/legacy-cloud-providers ./... )
staging/src/k8s.io/legacy-cloud-providers/azure/cache/azure_cache.go:122:13: Error return value of `t.Store.Add` is not checked (errcheck)
t.Store.Add(newEntry)
^
staging/src/k8s.io/legacy-cloud-providers/azure/cache/azure_cache.go:173:13: Error return value of `t.Store.Add` is not checked (errcheck)
t.Store.Add(&AzureCacheEntry{
^
staging/src/k8s.io/legacy-cloud-providers/azure/cache/azure_cache_test.go:137:14: Error return value of `cache.Delete` is not checked (errcheck)
cache.Delete(key)
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/armclient/azure_armclient_test.go:251:10: Error return value of `w.Write` is not checked (errcheck)
w.Write([]byte("{data: testPIP}"))
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/armclient/azure_armclient_test.go:276:10: Error return value of `w.Write` is not checked (errcheck)
w.Write([]byte("{data: testPIP}"))
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/armclient/azure_armclient_test.go:318:12: Error return value of `rw.Write` is not checked (errcheck)
rw.Write([]byte(`{"error":{"code":"InternalServerError"},"status":"Failed"}`))
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/armclient/azure_armclient_test.go:363:12: Error return value of `rw.Write` is not checked (errcheck)
rw.Write([]byte(`{"error":{"code":"InternalServerError"},"status":"Failed"}`))
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/armclient/azure_armclient_test.go:369:12: Error return value of `rw.Write` is not checked (errcheck)
rw.Write([]byte(`{"error":{"code":"InternalServerError"},"status":"Failed"}`))
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/armclient/azure_armclient_test.go:456:12: Error return value of `rw.Write` is not checked (errcheck)
rw.Write([]byte(`{"error":{"code":"InternalServerError"},"status":"Failed"}`))
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/deploymentclient/azure_deploymentclient.go:99:12: Error return value of `mc.Observe` is not checked (errcheck)
mc.Observe(rerr.Error())
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/deploymentclient/azure_deploymentclient.go:160:12: Error return value of `mc.Observe` is not checked (errcheck)
mc.Observe(rerr.Error())
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/deploymentclient/azure_deploymentclient.go:321:12: Error return value of `mc.Observe` is not checked (errcheck)
mc.Observe(rerr.Error())
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/deploymentclient/azure_deploymentclient.go:395:12: Error return value of `mc.Observe` is not checked (errcheck)
mc.Observe(rerr.Error())
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/containerserviceclient/azure_containerserviceclient.go:99:12: Error return value of `mc.Observe` is not checked (errcheck)
mc.Observe(rerr.Error())
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/containerserviceclient/azure_containerserviceclient.go:160:12: Error return value of `mc.Observe` is not checked (errcheck)
mc.Observe(rerr.Error())
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/containerserviceclient/azure_containerserviceclient.go:321:12: Error return value of `mc.Observe` is not checked (errcheck)
mc.Observe(rerr.Error())
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/containerserviceclient/azure_containerserviceclient.go:396:12: Error return value of `mc.Observe` is not checked (errcheck)
mc.Observe(rerr.Error())
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/storageaccountclient/azure_storageaccountclient.go:104:12: Error return value of `mc.Observe` is not checked (errcheck)
mc.Observe(rerr.Error())
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/storageaccountclient/azure_storageaccountclient.go:165:12: Error return value of `mc.Observe` is not checked (errcheck)
mc.Observe(rerr.Error())
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/storageaccountclient/azure_storageaccountclient.go:226:12: Error return value of `mc.Observe` is not checked (errcheck)
mc.Observe(rerr.Error())
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/storageaccountclient/azure_storageaccountclient.go:294:12: Error return value of `mc.Observe` is not checked (errcheck)
mc.Observe(rerr.Error())
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/storageaccountclient/azure_storageaccountclient.go:337:12: Error return value of `mc.Observe` is not checked (errcheck)
mc.Observe(rerr.Error())
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/vmsizeclient/azure_vmsizeclient.go:98:12: Error return value of `mc.Observe` is not checked (errcheck)
mc.Observe(rerr.Error())
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/diskclient/azure_diskclient.go:104:12: Error return value of `mc.Observe` is not checked (errcheck)
mc.Observe(rerr.Error())
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/diskclient/azure_diskclient.go:165:12: Error return value of `mc.Observe` is not checked (errcheck)
mc.Observe(rerr.Error())
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/diskclient/azure_diskclient.go:233:12: Error return value of `mc.Observe` is not checked (errcheck)
mc.Observe(rerr.Error())
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/diskclient/azure_diskclient.go:301:12: Error return value of `mc.Observe` is not checked (errcheck)
mc.Observe(rerr.Error())
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/snapshotclient/azure_snapshotclient.go:99:12: Error return value of `mc.Observe` is not checked (errcheck)
mc.Observe(rerr.Error())
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/snapshotclient/azure_snapshotclient.go:160:12: Error return value of `mc.Observe` is not checked (errcheck)
mc.Observe(rerr.Error())
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/snapshotclient/azure_snapshotclient.go:203:12: Error return value of `mc.Observe` is not checked (errcheck)
mc.Observe(rerr.Error())
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/snapshotclient/azure_snapshotclient.go:271:12: Error return value of `mc.Observe` is not checked (errcheck)
mc.Observe(rerr.Error())
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/vmssvmclient/azure_vmssvmclient.go:100:12: Error return value of `mc.Observe` is not checked (errcheck)
mc.Observe(rerr.Error())
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/vmssvmclient/azure_vmssvmclient.go:163:12: Error return value of `mc.Observe` is not checked (errcheck)
mc.Observe(rerr.Error())
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/vmssvmclient/azure_vmssvmclient.go:237:12: Error return value of `mc.Observe` is not checked (errcheck)
mc.Observe(rerr.Error())
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/vmssvmclient/azure_vmssvmclient.go:397:12: Error return value of `mc.Observe` is not checked (errcheck)
mc.Observe(rerr.Error())
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/vmclient/azure_vmclient.go:99:12: Error return value of `mc.Observe` is not checked (errcheck)
mc.Observe(rerr.Error())
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/vmclient/azure_vmclient.go:160:12: Error return value of `mc.Observe` is not checked (errcheck)
mc.Observe(rerr.Error())
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/vmclient/azure_vmclient.go:233:12: Error return value of `mc.Observe` is not checked (errcheck)
mc.Observe(rerr.Error())
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/vmclient/azure_vmclient.go:394:12: Error return value of `mc.Observe` is not checked (errcheck)
mc.Observe(rerr.Error())
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/vmclient/azure_vmclient.go:463:12: Error return value of `mc.Observe` is not checked (errcheck)
mc.Observe(rerr.Error())
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/vmssclient/azure_vmssclient.go:99:12: Error return value of `mc.Observe` is not checked (errcheck)
mc.Observe(rerr.Error())
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/vmssclient/azure_vmssclient.go:160:12: Error return value of `mc.Observe` is not checked (errcheck)
mc.Observe(rerr.Error())
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/vmssclient/azure_vmssclient.go:231:12: Error return value of `mc.Observe` is not checked (errcheck)
mc.Observe(rerr.Error())
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/vmssclient/azure_vmssclient.go:269:12: Error return value of `mc.Observe` is not checked (errcheck)
mc.Observe(rerr.Error())
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/vmssclient/azure_vmssclient.go:286:12: Error return value of `mc.Observe` is not checked (errcheck)
mc.Observe(err)
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/vmssclient/azure_vmssclient.go:294:12: Error return value of `mc.Observe` is not checked (errcheck)
mc.Observe(err)
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/vmssclient/azure_vmssclient.go:302:12: Error return value of `mc.Observe` is not checked (errcheck)
mc.Observe(err)
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/vmssclient/azure_vmssclient.go:310:12: Error return value of `mc.Observe` is not checked (errcheck)
mc.Observe(err)
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/vmssclient/azure_vmssclient.go:463:12: Error return value of `mc.Observe` is not checked (errcheck)
mc.Observe(rerr.Error())
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/vmssclient/azure_vmssclient.go:515:12: Error return value of `mc.Observe` is not checked (errcheck)
mc.Observe(err)
^
staging/src/k8s.io/legacy-cloud-providers/azure/cache/azure_cache_test.go:47:2: assignOp: replace `fake.called = fake.called + 1` with `fake.called++` (gocritic)
fake.called = fake.called + 1
^
staging/src/k8s.io/legacy-cloud-providers/azure/retry/azure_retry_test.go:145:13: elseif: can replace 'else {if cond {}}' with 'else if cond {}' (gocritic)
} else {
^
staging/src/k8s.io/legacy-cloud-providers/azure/auth/azure_auth.go:221:2: ifElseChain: rewrite if-else to switch statement (gocritic)
if resourceManagerEndpoint != "" {
^
staging/src/k8s.io/legacy-cloud-providers/azure/auth/azure_auth.go:267:35: wrapperFunc: use strings.ReplaceAll method in `strings.Replace(resourceManagerEndpoint, "https://management.", "cloudapp.", -1)` (gocritic)
env.ResourceManagerVMDNSSuffix = strings.Replace(resourceManagerEndpoint, "https://management.", "cloudapp.", -1)
^
staging/src/k8s.io/legacy-cloud-providers/azure/auth/azure_auth.go:265:28: wrapperFunc: use strings.ReplaceAll method in `strings.Replace(resourceManagerEndpoint, "https://management.", "https://portal.", -1)` (gocritic)
env.ManagementPortalURL = strings.Replace(resourceManagerEndpoint, "https://management.", "https://portal.", -1)
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/armclient/interface.go:90:2: commentFormatting: put a space between `//` and comment text (gocritic)
//GetResourceWithDecorators get a resource with decorators by resource ID
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/vmssvmclient/azure_vmssvmclient.go:83:69: captLocal: `VMScaleSetName' should not be capitalized (gocritic)
func (c *Client) Get(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, expand compute.InstanceViewTypes) (compute.VirtualMachineScaleSetVM, *retry.Error) {
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/vmssvmclient/azure_vmssvmclient.go:114:75: captLocal: `VMScaleSetName' should not be capitalized (gocritic)
func (c *Client) getVMSSVM(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, expand compute.InstanceViewTypes) (compute.VirtualMachineScaleSetVM, *retry.Error) {
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/vmssvmclient/azure_vmssvmclient.go:220:72: captLocal: `VMScaleSetName' should not be capitalized (gocritic)
func (c *Client) Update(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, parameters compute.VirtualMachineScaleSetVM, source string) *retry.Error {
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/vmssvmclient/azure_vmssvmclient.go:251:78: captLocal: `VMScaleSetName' should not be capitalized (gocritic)
func (c *Client) updateVMSSVM(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, parameters compute.VirtualMachineScaleSetVM) *retry.Error {
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/vmssvmclient/azure_vmssvmclient.go:380:75: captLocal: `VMScaleSetName' should not be capitalized (gocritic)
func (c *Client) UpdateVMs(ctx context.Context, resourceGroupName string, VMScaleSetName string, instances map[string]compute.VirtualMachineScaleSetVM, source string) *retry.Error {
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/vmssvmclient/azure_vmssvmclient.go:411:79: captLocal: `VMScaleSetName' should not be capitalized (gocritic)
func (c *Client) updateVMSSVMs(ctx context.Context, resourceGroupName string, VMScaleSetName string, instances map[string]compute.VirtualMachineScaleSetVM) *retry.Error {
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/vmssclient/azure_vmssclient.go:82:69: captLocal: `VMScaleSetName' should not be capitalized (gocritic)
func (c *Client) Get(ctx context.Context, resourceGroupName string, VMScaleSetName string) (compute.VirtualMachineScaleSet, *retry.Error) {
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/vmssclient/azure_vmssclient.go:113:73: captLocal: `VMScaleSetName' should not be capitalized (gocritic)
func (c *Client) getVMSS(ctx context.Context, resourceGroupName string, VMScaleSetName string) (compute.VirtualMachineScaleSet, *retry.Error) {
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/vmssclient/azure_vmssclient.go:214:80: captLocal: `VMScaleSetName' should not be capitalized (gocritic)
func (c *Client) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters compute.VirtualMachineScaleSet) *retry.Error {
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/vmssclient/azure_vmssclient.go:245:85: captLocal: `VMScaleSetName' should not be capitalized (gocritic)
func (c *Client) CreateOrUpdateAsync(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters compute.VirtualMachineScaleSet) (*azure.Future, *retry.Error) {
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/vmssclient/azure_vmssclient.go:320:84: captLocal: `VMScaleSetName' should not be capitalized (gocritic)
func (c *Client) createOrUpdateVMSS(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters compute.VirtualMachineScaleSet) *retry.Error {
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/vmclient/azure_vmclient.go:82:69: captLocal: `VMName' should not be capitalized (gocritic)
func (c *Client) Get(ctx context.Context, resourceGroupName string, VMName string, expand compute.InstanceViewTypes) (compute.VirtualMachine, *retry.Error) {
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/vmclient/azure_vmclient.go:113:71: captLocal: `VMName' should not be capitalized (gocritic)
func (c *Client) getVM(ctx context.Context, resourceGroupName string, VMName string, expand compute.InstanceViewTypes) (compute.VirtualMachine, *retry.Error) {
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/vmclient/azure_vmclient.go:216:72: captLocal: `VMName' should not be capitalized (gocritic)
func (c *Client) Update(ctx context.Context, resourceGroupName string, VMName string, parameters compute.VirtualMachineUpdate, source string) *retry.Error {
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/vmclient/azure_vmclient.go:247:74: captLocal: `VMName' should not be capitalized (gocritic)
func (c *Client) updateVM(ctx context.Context, resourceGroupName string, VMName string, parameters compute.VirtualMachineUpdate, source string) *retry.Error {
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/vmclient/azure_vmclient.go:377:80: captLocal: `VMName' should not be capitalized (gocritic)
func (c *Client) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMName string, parameters compute.VirtualMachine, source string) *retry.Error {
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/vmclient/azure_vmclient.go:408:82: captLocal: `VMName' should not be capitalized (gocritic)
func (c *Client) createOrUpdateVM(ctx context.Context, resourceGroupName string, VMName string, parameters compute.VirtualMachine, source string) *retry.Error {
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/vmclient/azure_vmclient.go:446:72: captLocal: `VMName' should not be capitalized (gocritic)
func (c *Client) Delete(ctx context.Context, resourceGroupName string, VMName string) *retry.Error {
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/vmclient/azure_vmclient.go:477:74: captLocal: `VMName' should not be capitalized (gocritic)
func (c *Client) deleteVM(ctx context.Context, resourceGroupName string, VMName string) *retry.Error {
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/publicipclient/azure_publicipclient.go:143:198: captLocal: `IPConfigurationName' should not be capitalized (gocritic)
func (c *Client) GetVirtualMachineScaleSetPublicIPAddress(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, IPConfigurationName string, publicIPAddressName string, expand string) (network.PublicIPAddress, *retry.Error) {
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/publicipclient/azure_publicipclient.go:174:180: captLocal: `IPConfigurationName' should not be capitalized (gocritic)
func (c *Client) getVMSSPublicIPAddress(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, IPConfigurationName string, publicIPAddressName string, expand string) (network.PublicIPAddress, *retry.Error) {
^
staging/src/k8s.io/legacy-cloud-providers/vsphere/vclib/diskmanagers/vmdm.go:139:4: commentFormatting: put a space between `//` and comment text (gocritic)
//Skip error and continue to detach the disk as the disk was already created on the datastore.
^
staging/src/k8s.io/legacy-cloud-providers/vsphere/vclib/diskmanagers/vmdm.go:74:2: ifElseChain: rewrite if-else to switch statement (gocritic)
if vmdisk.volumeOptions.StoragePolicyID != "" {
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure.go:474:9: elseif: can replace 'else {if cond {}}' with 'else if cond {}' (gocritic)
} else {
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_backoff.go:445:63: captLocal: `VMScaleSetName' should not be capitalized (gocritic)
func (az *Cloud) CreateOrUpdateVMSS(resourceGroupName string, VMScaleSetName string, parameters compute.VirtualMachineScaleSet) *retry.Error {
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_blobDiskController.go:554:4: assignOp: replace `countAccounts = countAccounts + 1` with `countAccounts++` (gocritic)
countAccounts = countAccounts + 1
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_blobDiskController.go:363:4: assignOp: replace `counter = counter + 1` with `counter++` (gocritic)
counter = counter + 1
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_blobDiskController.go:553:4: assignOp: replace `totalDiskCounts = totalDiskCounts + dCount` with `totalDiskCounts += dCount` (gocritic)
totalDiskCounts = totalDiskCounts + dCount
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_blobDiskController.go:166:2: assignOp: replace `vhdName = vhdName + ".vhd"` with `vhdName += ".vhd"` (gocritic)
vhdName = vhdName + ".vhd"
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_blobDiskController.go:293:51: captLocal: `SAName' should not be capitalized (gocritic)
func (c *BlobDiskController) getStorageAccountKey(SAName string) (string, error) {
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_blobDiskController.go:321:47: captLocal: `SAName' should not be capitalized (gocritic)
func (c *BlobDiskController) getBlobSvcClient(SAName string) (azstorage.BlobStorageClient, error) {
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_blobDiskController.go:424:43: captLocal: `SAName' should not be capitalized (gocritic)
func (c *BlobDiskController) getDiskCount(SAName string) (int, error) {
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_blobDiskController.go:474:15: underef: could simplify (*v.Sku).Name to v.Sku.Name (gocritic)
saType: (*v.Sku).Name,
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_loadbalancer.go:1892:25: appendAssign: append result not assigned to the same slice (gocritic)
newDestinations := append(existingPrefixes[:addressIndex], existingPrefixes[addressIndex+1:]...)
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_loadbalancer.go:2113:14: underef: could simplify (*existingPip).Name to existingPip.Name (gocritic)
pipName := *(*existingPip).Name
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_loadbalancer.go:2117:25: underef: could simplify (*existingPip).PublicIPAddressPropertiesFormat to existingPip.PublicIPAddressPropertiesFormat (gocritic)
pipPropertiesFormat := (*existingPip).PublicIPAddressPropertiesFormat
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_loadbalancer.go:2119:19: underef: could simplify (*pipPropertiesFormat).IPTags to pipPropertiesFormat.IPTags (gocritic)
currentIPTags = (*pipPropertiesFormat).IPTags
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_managedDiskController.go:196:3: commentFormatting: put a space between `//` and comment text (gocritic)
//still being provisioned, this is to avoid some race conditions
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_managedDiskController.go:269:37: underef: could simplify (*result.DiskProperties).ProvisioningState to result.DiskProperties.ProvisioningState (gocritic)
if result.DiskProperties != nil && (*result.DiskProperties).ProvisioningState != nil {
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_managedDiskController.go:270:11: underef: could simplify (*result.DiskProperties).ProvisioningState to result.DiskProperties.ProvisioningState (gocritic)
return *(*result.DiskProperties).ProvisioningState, *result.ID, nil
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_managedDiskController.go:104:14: wrapperFunc: use strings.ReplaceAll method in `strings.Replace(k, "/", "-", -1)` (gocritic)
newKey := strings.Replace(k, "/", "-", -1)
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_managedDiskController.go:105:16: wrapperFunc: use strings.ReplaceAll method in `strings.Replace(v, "/", "-", -1)` (gocritic)
newValue := strings.Replace(v, "/", "-", -1)
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_routes.go:386:4: commentFormatting: put a space between `//` and comment text (gocritic)
//TODO (khenidak) add support for unmanaged nodes when the feature reaches beta
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_standard.go:179:21: captLocal: `ID' should not be capitalized (gocritic)
func getLastSegment(ID, separator string) (string, error) {
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_routes.go:527:10: S1025: the argument's underlying type is a string, should use a simple conversion instead of fmt.Sprintf (gosimple)
return fmt.Sprintf("%s", nodeName)
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/armclient/azure_armclient_test.go:308:4: S1035: calling net/http.CanonicalHeaderKey on the 'key' argument of (net/http.Header).Set is redundant (gosimple)
rw.Header().Set(http.CanonicalHeaderKey("Azure-AsyncOperation"),
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/armclient/azure_armclient_test.go:348:4: S1035: calling net/http.CanonicalHeaderKey on the 'key' argument of (net/http.Header).Set is redundant (gosimple)
rw.Header().Set(http.CanonicalHeaderKey("Azure-AsyncOperation"),
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/armclient/azure_armclient_test.go:355:4: S1035: calling net/http.CanonicalHeaderKey on the 'key' argument of (net/http.Header).Set is redundant (gosimple)
rw.Header().Set(http.CanonicalHeaderKey("Azure-AsyncOperation"),
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/armclient/azure_armclient_test.go:446:4: S1035: calling net/http.CanonicalHeaderKey on the 'key' argument of (net/http.Header).Set is redundant (gosimple)
rw.Header().Set(http.CanonicalHeaderKey("Azure-AsyncOperation"),
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_managedDiskController_test.go:46:28: S1039: unnecessary use of fmt.Sprintf (gosimple)
badDiskEncryptionSetID := fmt.Sprintf("badDiskEncryptionSetID")
^
staging/src/k8s.io/legacy-cloud-providers/vsphere/shared_datastore.go:90:10: S1039: unnecessary use of fmt.Sprintf (gosimple)
msg := fmt.Sprintf("SharedHost.getSharedDatastore unable to find hosts associated with nodes")
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_blobDiskController.go:361:98: S1002: should omit comparison to bool constant, can be simplified to `!swapped` (gosimple)
for swapped := atomic.CompareAndSwapInt32(&c.accounts[storageAccountName].isValidating, 0, 1); swapped != true; {
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_loadbalancer.go:2094:6: S1002: should omit comparison to bool constant, can be simplified to `seen[v]` (gosimple)
if seen[v] == true {
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_vmss.go:907:38: S1002: should omit comparison to bool constant, can be simplified to `*networkConfig.Primary` (gosimple)
if networkConfig.Primary != nil && *networkConfig.Primary == true {
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_vmss.go:923:38: S1002: should omit comparison to bool constant, can be simplified to `*networkConfig.Primary` (gosimple)
if networkConfig.Primary != nil && *networkConfig.Primary == true {
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_vmss.go:939:33: S1002: should omit comparison to bool constant, can be simplified to `*ipConfig.Primary` (gosimple)
if ipConfig.Primary != nil && *ipConfig.Primary == true {
^
staging/src/k8s.io/legacy-cloud-providers/vsphere/nodemanager.go:131:7: S1002: should omit comparison to bool constant, can be simplified to `found` (gosimple)
if found == true {
^
staging/src/k8s.io/legacy-cloud-providers/vsphere/nodemanager.go:172:8: S1002: should omit comparison to bool constant, can be simplified to `found` (gosimple)
if found == true {
^
staging/src/k8s.io/legacy-cloud-providers/vsphere/vclib/diskmanagers/vmdm.go:221:5: S1009: should omit nil check; len() for []*k8s.io/legacy-cloud-providers/vsphere/vclib.VirtualMachine is defined as zero (gosimple)
if vmList == nil || len(vmList) == 0 {
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_standard.go:706:6: S1009: should omit nil check; len() for []string is defined as zero (gosimple)
if serviceAvailabilitySetNames == nil || len(serviceAvailabilitySetNames) == 0 {
^
staging/src/k8s.io/legacy-cloud-providers/vsphere/vclib/pbm.go:66:5: S1009: should omit nil check; len() for github.com/vmware/govmomi/pbm.PlacementCompatibilityResult is defined as zero (gosimple)
if compatibilityResult != nil && len(compatibilityResult) > 0 {
^
staging/src/k8s.io/legacy-cloud-providers/vsphere/vclib/pbm.go:68:6: S1009: should omit nil check; len() for []github.com/vmware/govmomi/pbm/types.PbmPlacementHub is defined as zero (gosimple)
if compatibleHubs != nil && len(compatibleHubs) > 0 {
^
staging/src/k8s.io/legacy-cloud-providers/vsphere/vclib/diskmanagers/vmdm.go:250:2: S1008: should use 'return errorMessage == err.Error()' instead of 'if errorMessage == err.Error() { return true }; return false' (gosimple)
if errorMessage == err.Error() {
^
staging/src/k8s.io/legacy-cloud-providers/vsphere/vclib/utils.go:41:2: S1008: should use 'return ok' instead of 'if ok { return true }; return false' (gosimple)
if ok {
^
staging/src/k8s.io/legacy-cloud-providers/vsphere/vclib/utils.go:260:3: S1008: should use 'return v.Major <= o.Major' instead of 'if v.Major > o.Major { return false }; return true' (gosimple)
if v.Major > o.Major {
^
staging/src/k8s.io/legacy-cloud-providers/vsphere/vclib/utils.go:266:3: S1008: should use 'return v.Minor <= o.Minor' instead of 'if v.Minor > o.Minor { return false }; return true' (gosimple)
if v.Minor > o.Minor {
^
staging/src/k8s.io/legacy-cloud-providers/vsphere/vclib/utils.go:272:3: S1008: should use 'return v.Revision <= o.Revision' instead of 'if v.Revision > o.Revision { return false }; return true' (gosimple)
if v.Revision > o.Revision {
^
staging/src/k8s.io/legacy-cloud-providers/vsphere/vclib/utils.go:278:3: S1008: should use 'return v.Build <= o.Build' instead of 'if v.Build > o.Build { return false }; return true' (gosimple)
if v.Build > o.Build {
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_loadbalancer.go:1790:3: S1033: unnecessary guard around call to delete (gosimple)
if _, ok := sourceRanges[defaultLoadBalancerSourceRanges]; ok {
^
staging/src/k8s.io/legacy-cloud-providers/vsphere/vclib/utils.go:130:15: S1007: should use raw string (`...`) with regexp.MustCompile to avoid having to escape twice (gosimple)
datastore := regexp.MustCompile("\\[(.*?)\\]").FindStringSubmatch(vDiskPath)[1]
^
staging/src/k8s.io/legacy-cloud-providers/vsphere/vsphere_util.go:259:4: S1011: should replace loop with `dsRefList = append(dsRefList, hostSystemMo.Datastore...)` (gosimple)
for _, dsRef := range hostSystemMo.Datastore {
^
staging/src/k8s.io/legacy-cloud-providers/vsphere/vclib/virtualmachine.go:351:3: S1021: should merge variable declaration with assignment on next line (gosimple)
var diskFormat string
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure.go:273:12: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
nodeNames sets.String
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure.go:276:23: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
nodeZones map[string]sets.String
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure.go:280:17: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
unmanagedNodes sets.String
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure.go:282:27: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
excludeLoadBalancerNodes sets.String
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure.go:345:40: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
nodeZones: map[string]sets.String{},
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure.go:878:36: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
func (az *Cloud) GetActiveZones() (sets.String, error) {
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure.go:926:34: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
func (az *Cloud) GetNodeNames() (sets.String, error) {
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure.go:942:39: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
func (az *Cloud) GetResourceGroups() (sets.String, error) {
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure.go:963:39: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
func (az *Cloud) GetUnmanagedNodes() (sets.String, error) {
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_backoff.go:94:12: SA1019: wait.ErrWaitTimeout is deprecated: This type will be made private in favor of Interrupted() for checking errors or ErrorInterrupted(err) for returning a wrapped error. (staticcheck)
if err == wait.ErrWaitTimeout {
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_blobDiskController.go:398:14: SA1019: kwait.ErrWaitTimeout is deprecated: This type will be made private in favor of Interrupted() for checking errors or ErrorInterrupted(err) for returning a wrapped error. (staticcheck)
if err == kwait.ErrWaitTimeout {
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_fakes.go:69:40: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
nodeZones: map[string]sets.String{},
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_routes.go:99:9: SA1019: wait.PollImmediateInfinite is deprecated: This method does not return errors from context, use PollWithContextCancel. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
err := wait.PollImmediateInfinite(d.interval, func() (bool, error) {
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_vmss_cache.go:63:12: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
vmNames sets.String
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_vmss_cache.go:64:12: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
nodeNames sets.String
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_backoff_test.go:96:24: SA1019: wait.ErrWaitTimeout is deprecated: This type will be made private in favor of Interrupted() for checking errors or ErrorInterrupted(err) for returning a wrapped error. (staticcheck)
expectedErr: wait.ErrWaitTimeout,
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_backoff_test.go:159:17: SA1019: wait.ErrWaitTimeout is deprecated: This type will be made private in favor of Interrupted() for checking errors or ErrorInterrupted(err) for returning a wrapped error. (staticcheck)
expectedErr: wait.ErrWaitTimeout,
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_controller_common_test.go:485:18: SA1019: pointer.StringPtr is deprecated: Use String instead. (staticcheck)
Name: pointer.StringPtr("DiskName1"),
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_controller_common_test.go:486:18: SA1019: pointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
ToBeDetached: pointer.BoolPtr(false),
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_controller_common_test.go:488:9: SA1019: pointer.StringPtr is deprecated: Use String instead. (staticcheck)
ID: pointer.StringPtr("ManagedID"),
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_controller_common_test.go:492:18: SA1019: pointer.StringPtr is deprecated: Use String instead. (staticcheck)
Name: pointer.StringPtr("DiskName2"),
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_controller_common_test.go:493:18: SA1019: pointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
ToBeDetached: pointer.BoolPtr(true),
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_controller_common_test.go:496:18: SA1019: pointer.StringPtr is deprecated: Use String instead. (staticcheck)
Name: pointer.StringPtr("DiskName3"),
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_controller_common_test.go:500:18: SA1019: pointer.StringPtr is deprecated: Use String instead. (staticcheck)
Name: pointer.StringPtr("DiskName4"),
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_controller_common_test.go:730:10: SA1019: pointer.StringPtr is deprecated: Use String instead. (staticcheck)
Name: pointer.StringPtr("DiskName2"),
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_controller_common_test.go:732:9: SA1019: pointer.StringPtr is deprecated: Use String instead. (staticcheck)
ID: pointer.StringPtr(diskURIPrefix + "DiskName2"),
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_controller_common_test.go:736:10: SA1019: pointer.StringPtr is deprecated: Use String instead. (staticcheck)
Name: pointer.StringPtr("DiskName3"),
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_controller_common_test.go:738:9: SA1019: pointer.StringPtr is deprecated: Use String instead. (staticcheck)
ID: pointer.StringPtr(diskURIPrefix + "DiskName3"),
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_controller_common_test.go:742:10: SA1019: pointer.StringPtr is deprecated: Use String instead. (staticcheck)
Name: pointer.StringPtr("DiskName4"),
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_controller_common_test.go:744:9: SA1019: pointer.StringPtr is deprecated: Use String instead. (staticcheck)
ID: pointer.StringPtr(diskURIPrefix + "DiskName4"),
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_instances_test.go:491:25: SA1019: wait.ErrWaitTimeout is deprecated: This type will be made private in favor of Interrupted() for checking errors or ErrorInterrupted(err) for returning a wrapped error. (staticcheck)
expectedErrMsg: wait.ErrWaitTimeout,
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_loadbalancer_test.go:1875:43: SA1019: strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead. (staticcheck)
Protocol: network.TransportProtocol(strings.Title(
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_routes_test.go:230:20: SA1019: wait.ErrWaitTimeout is deprecated: This type will be made private in favor of Interrupted() for checking errors or ErrorInterrupted(err) for returning a wrapped error. (staticcheck)
expectedErrMsg: wait.ErrWaitTimeout,
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_routes_test.go:675:40: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
existingNodeNames sets.String
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_test.go:3120:22: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
expected sets.String
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_test.go:3235:28: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
az.nodeZones = map[string]sets.String{zone: nodesInZone}
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_test.go:3289:28: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
az.nodeZones = map[string]sets.String{zone: nodesInZone}
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_test.go:3407:28: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
az.nodeZones = map[string]sets.String{zone: nodesInZone}
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_wrap_test.go:66:18: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
unmanagedNodes sets.String
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_zones_test.go:227:19: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
unmanagedNodes: sets.String{"vm-0": sets.Empty{}},
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_zones_test.go:237:19: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
unmanagedNodes: sets.String{"vm-0": sets.Empty{}},
^
staging/src/k8s.io/legacy-cloud-providers/azure/main_test.go:27:2: SA1019: rand.Seed has been deprecated since Go 1.20 and an alternative has been available since Go 1.0: Programs that call Seed and then expect a specific sequence of results from the global random source (using functions such as Int) can be broken when a dependency changes how much it consumes from the global random source. To avoid such breakages, programs that need a specific result sequence should use NewRand(NewSource(seed)) to obtain a random generator that other packages cannot access. (staticcheck)
rand.Seed(time.Now().UnixNano())
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure.go:25:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_instance_metadata.go:25:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
staging/src/k8s.io/legacy-cloud-providers/azure/auth/azure_auth.go:23:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/armclient/azure_armclient.go:27:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/armclient/azure_armclient_test.go:25:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/containerserviceclient/azure_containerserviceclient_test.go:27:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/deploymentclient/azure_deploymentclient_test.go:27:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/diskclient/azure_diskclient_test.go:26:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
staging/src/k8s.io/legacy-cloud-providers/vsphere/nodemanager.go:79:2: ST1003: should not use ALL_CAPS in Go names; use CamelCase instead (stylecheck)
POOL_SIZE = 8
^
staging/src/k8s.io/legacy-cloud-providers/vsphere/nodemanager.go:80:2: ST1003: should not use ALL_CAPS in Go names; use CamelCase instead (stylecheck)
QUEUE_SIZE = POOL_SIZE * 10
^
staging/src/k8s.io/legacy-cloud-providers/vsphere/nodemanager.go:84:7: ST1003: type VmSearch should be VMSearch (stylecheck)
type VmSearch struct {
^
staging/src/k8s.io/legacy-cloud-providers/vsphere/vsphere.go:1160:5: ST1003: should not use ALL_CAPS in Go names; use CamelCase instead (stylecheck)
VC_DC := nodeInfo.vcServer + nodeInfo.dataCenter.String()
^
staging/src/k8s.io/legacy-cloud-providers/vsphere/vsphere.go:1715:20: ST1003: method getZoneByVmUUIDAndNodeName should be getZoneByVMUUIDAndNodeName (stylecheck)
func (vs *VSphere) getZoneByVmUUIDAndNodeName(ctx context.Context, vmUUID string, nodeName k8stypes.NodeName) (cloudprovider.Zone, error) {
^
staging/src/k8s.io/legacy-cloud-providers/vsphere/vsphere_util.go:98:51: ST1003: func parameter nodeVmDetail should be nodeVMDetail (stylecheck)
func getAccessibleDatastores(ctx context.Context, nodeVmDetail *NodeDetails, nodeManager *NodeManager) ([]*vclib.DatastoreInfo, error) {
^
staging/src/k8s.io/legacy-cloud-providers/vsphere/vsphere_util.go:133:2: ST1003: var nodeVmDetails should be nodeVMDetails (stylecheck)
nodeVmDetails, err := nodeManager.GetNodeDetails()
^
staging/src/k8s.io/legacy-cloud-providers/vsphere/vsphere_util.go:145:9: ST1003: range var nodeVmDetail should be nodeVMDetail (stylecheck)
for _, nodeVmDetail := range nodeVmDetails {
^
staging/src/k8s.io/legacy-cloud-providers/vsphere/vsphere_test.go:841:8: ST1003: range var tagId should be tagID (stylecheck)
for tagId, objects := range testcase.tags {
^
staging/src/k8s.io/legacy-cloud-providers/vsphere/vsphere_test.go:864:8: ST1003: range var tagId should be tagID (stylecheck)
for tagId, objects := range testcase.tags {
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_instances.go:418:18: ST1016: methods on the same type should have the same receiver name (seen 138x "az", 2x "c") (stylecheck)
func (az *Cloud) AddSSHKeyToAllInstances(ctx context.Context, user string, keyData []byte) error {
^
staging/src/k8s.io/legacy-cloud-providers/vsphere/nodemanager.go:47:19: ST1016: methods on the same type should have the same receiver name (seen 1x "n", 1x "nodeInfo") (stylecheck)
func (n NodeInfo) String() string {
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_loadbalancer_test.go:3914:38: ST1023: should omit type *bool from declaration; it will be inferred from the right-hand side (stylecheck)
var enableTCPReset, disableTCPReset *bool = pointer.Bool(true), pointer.Bool(false)
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_loadbalancer_test.go:3915:16: ST1023: should omit type *int32 from declaration; it will be inferred from the right-hand side (stylecheck)
var frontPort *int32 = pointer.Int32(80)
^
staging/src/k8s.io/legacy-cloud-providers/vsphere/vclib/diskmanagers/virtualdisk.go:72:14: ST1005: error strings should not be capitalized (stylecheck)
return "", fmt.Errorf("Storage Policy ID and Storage Policy Name both set, Please set only one parameter")
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_blobDiskController.go:514:11: ST1005: error strings should not be capitalized (stylecheck)
return fmt.Errorf("Create Storage Account: %s, error: %v", storageAccountName, err)
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_utils.go:101:16: ST1005: error strings should not be capitalized (stylecheck)
return nil, fmt.Errorf("Tags '%s' are invalid, the format should like: 'key1=value1,key2=value2'", tags)
^
staging/src/k8s.io/legacy-cloud-providers/azure/azure_utils.go:105:16: ST1005: error strings should not be capitalized (stylecheck)
return nil, fmt.Errorf("Tags '%s' are invalid, the format should like: 'key1=value1,key2=value2'", tags)
^
staging/src/k8s.io/legacy-cloud-providers/azure/auth/azure_auth.go:97:16: ST1005: error strings should not be capitalized (stylecheck)
return nil, fmt.Errorf("Getting the managed service identity endpoint: %v", err)
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/armclient/azure_armclient.go:116:42: ST1005: error strings should not be capitalized (stylecheck)
return response, retry.NewError(false, fmt.Errorf("Empty response and no HTTP code"))
^
staging/src/k8s.io/legacy-cloud-providers/azure/clients/armclient/azure_armclient.go:645:16: ST1005: error strings should not be capitalized (stylecheck)
return r, fmt.Errorf("Error in withAPIVersion: Invoked with a nil URL")
^
staging/src/k8s.io/legacy-cloud-providers/azure/retry/azure_error.go:80:9: ST1005: error strings should not be capitalized (stylecheck)
return fmt.Errorf("Retriable: %v, RetryAfter: %ds, HTTPStatusCode: %d, RawError: %w",
^
staging/src/k8s.io/legacy-cloud-providers/gce/gce_clusterid.go:134:14: ST1005: error strings should not be capitalized (stylecheck)
return "", errors.New("Could not retrieve cluster id")
^
staging/src/k8s.io/legacy-cloud-providers/gce/gce_clusterid.go:225:9: ST1005: error strings should not be capitalized (stylecheck)
err = fmt.Errorf("Expected v1.ConfigMap, item=%+v, typeIsOk=%v", item, ok)
^
staging/src/k8s.io/legacy-cloud-providers/gce/gce_loadbalancer_internal.go:91:15: ST1005: error strings should not be capitalized (stylecheck)
return nil, fmt.Errorf("Invalid protocol %s, only TCP and UDP are supported", string(protocol))
^
staging/src/k8s.io/legacy-cloud-providers/gce/gce_loadbalancer_internal.go:971:26: ST1005: error strings should not be capitalized (stylecheck)
return meta.VersionGA, fmt.Errorf("Failed to get APIVersion from Forwarding rule %s - %v", rule.Name, err)
^
staging/src/k8s.io/legacy-cloud-providers/vsphere/credentialmanager.go:44:27: ST1005: error strings should not be capitalized (stylecheck)
ErrCredentialsNotFound = errors.New(CredentialsNotFoundErrMsg)
^
staging/src/k8s.io/legacy-cloud-providers/vsphere/credentialmanager.go:46:27: ST1005: error strings should not be capitalized (stylecheck)
ErrUnknownSecretKey = errors.New(UnknownSecretKeyErrMsg)
^
staging/src/k8s.io/legacy-cloud-providers/vsphere/vsphere.go:92:23: ST1005: error strings should not be capitalized (stylecheck)
ErrUsernameMissing = errors.New(MissingUsernameErrMsg)
^
staging/src/k8s.io/legacy-cloud-providers/vsphere/vsphere.go:93:23: ST1005: error strings should not be capitalized (stylecheck)
ErrPasswordMissing = errors.New(MissingPasswordErrMsg)
^
staging/src/k8s.io/legacy-cloud-providers/vsphere/vsphere.go:94:23: ST1005: error strings should not be capitalized (stylecheck)
ErrNoZoneTagInVC = errors.New(NoZoneTagInVCErrMsg)
^
staging/src/k8s.io/legacy-cloud-providers/vsphere/vsphere.go:380:16: ST1005: error strings should not end with punctuation or newlines (stylecheck)
return nil, errors.New("Global.WorkingDir is empty!")
^
staging/src/k8s.io/legacy-cloud-providers/vsphere/vsphere.go:384:16: ST1005: error strings should not end with punctuation or newlines (stylecheck)
return nil, errors.New("Global.VCenterIP is empty!")
^
staging/src/k8s.io/legacy-cloud-providers/vsphere/vsphere.go:388:16: ST1005: error strings should not end with punctuation or newlines (stylecheck)
return nil, errors.New("Global.Datacenter is empty!")
^
staging/src/k8s.io/legacy-cloud-providers/vsphere/vsphere.go:542:15: ST1005: error strings should not be capitalized (stylecheck)
return nil, errors.New("Controller type not supported. Please configure 'lsilogic-sas' OR 'pvscsi'")
^
staging/src/k8s.io/legacy-cloud-providers/vsphere/vsphere_util.go:78:15: ST1005: error strings should not end with punctuation or newlines (stylecheck)
return nil, fmt.Errorf("Env variable 'VSPHERE_CONF_FILE' is not set.")
^
staging/src/k8s.io/legacy-cloud-providers/vsphere/vsphere_util.go:161:17: ST1005: error strings should not be capitalized (stylecheck)
return nil, fmt.Errorf("No shared datastores found in the Kubernetes cluster for nodeVmDetails: %+v", nodeVmDetails)
^
staging/src/k8s.io/legacy-cloud-providers/vsphere/vsphere_util.go:219:15: ST1005: error strings should not be capitalized (stylecheck)
return nil, errors.New(msg)
^
staging/src/k8s.io/legacy-cloud-providers/vsphere/vsphere_util.go:316:18: ST1005: error strings should not be capitalized (stylecheck)
return nil, fmt.Errorf("No matching datastores found in the kubernetes cluster for zone %s", zone)
^
staging/src/k8s.io/legacy-cloud-providers/vsphere/vsphere_util.go:327:17: ST1005: error strings should not be capitalized (stylecheck)
return nil, fmt.Errorf("No matching datastores found in the kubernetes cluster across zones %s", selectedZones)
^
staging/src/k8s.io/legacy-cloud-providers/vsphere/vsphere_util.go:454:15: ST1005: error strings should not be capitalized (stylecheck)
return "", fmt.Errorf("Failed to parse canonicalVolumePath: %s in getcanonicalVolumePath method", canonicalVolumePath)
^
staging/src/k8s.io/legacy-cloud-providers/vsphere/vsphere_util.go:876:15: ST1005: error strings should not be capitalized (stylecheck)
return nil, fmt.Errorf("Datastore '%s' not found", datastoreName)
^
staging/src/k8s.io/legacy-cloud-providers/vsphere/vsphere.go:836:15: ST1005: error strings should not be capitalized (stylecheck)
return "", fmt.Errorf("The current node can't determine InstanceID for %q", convertToString(nodeName))
^
staging/src/k8s.io/legacy-cloud-providers/vsphere/vsphere.go:1344:13: ST1005: error strings should not be capitalized (stylecheck)
err := fmt.Errorf("The specified datastore %s does not match the provided zones : %s", volumeOptions.Datastore, zonesToSearch)
^
staging/src/k8s.io/legacy-cloud-providers/vsphere/vsphere.go:1397:13: ST1005: error strings should not be capitalized (stylecheck)
err := fmt.Errorf("Failed to find a shared datastore matching zone %s", zonesToSearch)
^
staging/src/k8s.io/legacy-cloud-providers/vsphere/vsphere.go:1424:13: ST1005: error strings should not be capitalized (stylecheck)
err = fmt.Errorf("The specified datastore %s is not a shared datastore across node VMs", datastoreName)
^
staging/src/k8s.io/legacy-cloud-providers/vsphere/vsphere.go:1445:13: ST1005: error strings should not be capitalized (stylecheck)
err = fmt.Errorf("The specified datastore %s does not match the provided zones : %s", datastoreName, zonesToSearch)
^
staging/src/k8s.io/legacy-cloud-providers/vsphere/vclib/custom_errors.go:32:24: ST1005: error strings should not be capitalized (stylecheck)
ErrFileAlreadyExist = errors.New(FileAlreadyExistErrMsg)
^
staging/src/k8s.io/legacy-cloud-providers/vsphere/vclib/custom_errors.go:33:24: ST1005: error strings should not be capitalized (stylecheck)
ErrNoDiskUUIDFound = errors.New(NoDiskUUIDFoundErrMsg)
^
staging/src/k8s.io/legacy-cloud-providers/vsphere/vclib/custom_errors.go:34:24: ST1005: error strings should not be capitalized (stylecheck)
ErrNoDevicesFound = errors.New(NoDevicesFoundErrMsg)
^
running ( cd /nvme/gopath/src/k8s.io/kubernetes/staging/src/k8s.io/metrics; env LOGCHECK_CONFIG=/nvme/gopath/src/k8s.io/kubernetes/hack/logcheck.conf /nvme/gopath/src/k8s.io/kubernetes/_output/local/bin/golangci-lint run --config=/nvme/gopath/src/k8s.io/kubernetes/hack/golangci-strict.yaml --path-prefix staging/src/k8s.io/metrics ./... )
staging/src/k8s.io/metrics/pkg/client/custom_metrics/scheme/register.go:64:19: Error return value is not checked (errcheck)
cmint.AddToScheme(scheme)
^
staging/src/k8s.io/metrics/pkg/client/custom_metrics/scheme/register.go:65:23: Error return value is not checked (errcheck)
cmv1beta1.AddToScheme(scheme)
^
staging/src/k8s.io/metrics/pkg/client/custom_metrics/scheme/register.go:66:23: Error return value is not checked (errcheck)
cmv1beta2.AddToScheme(scheme)
^
staging/src/k8s.io/metrics/pkg/apis/custom_metrics/conversion.go:17:1: ST1003: should not use underscores in package names (stylecheck)
package custom_metrics
^
staging/src/k8s.io/metrics/pkg/apis/custom_metrics/doc.go:21:1: ST1003: should not use underscores in package names (stylecheck)
package custom_metrics // import "k8s.io/metrics/pkg/apis/custom_metrics"
^
staging/src/k8s.io/metrics/pkg/apis/custom_metrics/register.go:17:1: ST1003: should not use underscores in package names (stylecheck)
package custom_metrics
^
staging/src/k8s.io/metrics/pkg/apis/custom_metrics/types.go:17:1: ST1003: should not use underscores in package names (stylecheck)
package custom_metrics
^
staging/src/k8s.io/metrics/pkg/apis/custom_metrics/conversion.go:24:6: ST1003: should not use underscores in Go names; func Convert_v1_ObjectReference_To_custom_metrics_ObjectReference should be ConvertV1ObjectReferenceToCustomMetricsObjectReference (stylecheck)
func Convert_v1_ObjectReference_To_custom_metrics_ObjectReference(in *v1.ObjectReference, out *ObjectReference, s conversion.Scope) error {
^
staging/src/k8s.io/metrics/pkg/apis/custom_metrics/conversion.go:36:6: ST1003: should not use underscores in Go names; func Convert_custom_metrics_ObjectReference_To_v1_ObjectReference should be ConvertCustomMetricsObjectReferenceToV1ObjectReference (stylecheck)
func Convert_custom_metrics_ObjectReference_To_v1_ObjectReference(in *ObjectReference, out *v1.ObjectReference, s conversion.Scope) error {
^
staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta1/conversion.go:24:6: ST1003: should not use underscores in Go names; func Convert_v1beta1_MetricValue_To_custom_metrics_MetricValue should be ConvertV1beta1MetricValueToCustomMetricsMetricValue (stylecheck)
func Convert_v1beta1_MetricValue_To_custom_metrics_MetricValue(in *MetricValue, out *custom_metrics.MetricValue, s conversion.Scope) error {
^
staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta1/conversion.go:33:6: ST1003: should not use underscores in Go names; func Convert_custom_metrics_MetricValue_To_v1beta1_MetricValue should be ConvertCustomMetricsMetricValueToV1beta1MetricValue (stylecheck)
func Convert_custom_metrics_MetricValue_To_v1beta1_MetricValue(in *custom_metrics.MetricValue, out *MetricValue, s conversion.Scope) error {
^
staging/src/k8s.io/metrics/pkg/apis/external_metrics/doc.go:21:1: ST1003: should not use underscores in package names (stylecheck)
package external_metrics // import "k8s.io/metrics/pkg/apis/external_metrics"
^
staging/src/k8s.io/metrics/pkg/apis/external_metrics/register.go:17:1: ST1003: should not use underscores in package names (stylecheck)
package external_metrics
^
staging/src/k8s.io/metrics/pkg/apis/external_metrics/types.go:17:1: ST1003: should not use underscores in package names (stylecheck)
package external_metrics
^
staging/src/k8s.io/metrics/pkg/client/external_metrics/client.go:17:1: ST1003: should not use underscores in package names (stylecheck)
package external_metrics
^
staging/src/k8s.io/metrics/pkg/client/external_metrics/interfaces.go:17:1: ST1003: should not use underscores in package names (stylecheck)
package external_metrics
^
staging/src/k8s.io/metrics/pkg/client/custom_metrics/converter.go:17:1: ST1003: should not use underscores in package names (stylecheck)
package custom_metrics
^
staging/src/k8s.io/metrics/pkg/client/custom_metrics/discovery.go:17:1: ST1003: should not use underscores in package names (stylecheck)
package custom_metrics
^
staging/src/k8s.io/metrics/pkg/client/custom_metrics/interfaces.go:17:1: ST1003: should not use underscores in package names (stylecheck)
package custom_metrics
^
staging/src/k8s.io/metrics/pkg/client/custom_metrics/multi_client.go:17:1: ST1003: should not use underscores in package names (stylecheck)
package custom_metrics
^
staging/src/k8s.io/metrics/pkg/client/custom_metrics/versioned_client.go:17:1: ST1003: should not use underscores in package names (stylecheck)
package custom_metrics
^
staging/src/k8s.io/metrics/pkg/client/custom_metrics/util_test.go:17:1: ST1003: should not use underscores in package names (stylecheck)
package custom_metrics
^
running ( cd /nvme/gopath/src/k8s.io/kubernetes/staging/src/k8s.io/mount-utils; env LOGCHECK_CONFIG=/nvme/gopath/src/k8s.io/kubernetes/hack/logcheck.conf /nvme/gopath/src/k8s.io/kubernetes/_output/local/bin/golangci-lint run --config=/nvme/gopath/src/k8s.io/kubernetes/hack/golangci-strict.yaml --path-prefix staging/src/k8s.io/mount-utils ./... )
staging/src/k8s.io/mount-utils/mount_helper_test.go:130:19: Error return value is not checked (errcheck)
tt.prepareMntr(fake)
^
staging/src/k8s.io/mount-utils/mount_linux_test.go:437:19: Error return value of `tmpFile.Truncate` is not checked (errcheck)
tmpFile.Truncate(0)
^
staging/src/k8s.io/mount-utils/mount_linux_test.go:438:15: Error return value of `tmpFile.Seek` is not checked (errcheck)
tmpFile.Seek(0, 0)
^
staging/src/k8s.io/mount-utils/mount_linux_test.go:439:22: Error return value of `tmpFile.WriteString` is not checked (errcheck)
tmpFile.WriteString(v.mountInfos)
^
staging/src/k8s.io/mount-utils/mount_linux_test.go:440:15: Error return value of `tmpFile.Sync` is not checked (errcheck)
tmpFile.Sync()
^
staging/src/k8s.io/mount-utils/mount_linux_test.go:723:20: Error return value of `mounter.format` is not checked (errcheck)
mounter.format(fstype, nil)
^
staging/src/k8s.io/mount-utils/mount_helper_unix.go:184:2: ifElseChain: rewrite if-else to switch statement (gocritic)
if err == nil {
^
staging/src/k8s.io/mount-utils/mount_linux.go:424:2: ifElseChain: rewrite if-else to switch statement (gocritic)
if !pathExists {
^
staging/src/k8s.io/mount-utils/mount_linux.go:602:6: sloppyLen: len(l) <= 0 can be len(l) == 0 (gocritic)
if len(l) <= 0 {
^
staging/src/k8s.io/mount-utils/safe_format_and_mount_test.go:264:4: commentFormatting: put a space between `//` and comment text (gocritic)
//check that the correct device was mounted
^
staging/src/k8s.io/mount-utils/safe_format_and_mount_test.go:246:3: ifElseChain: rewrite if-else to switch statement (gocritic)
if len(test.formatOptions) > 0 {
^
staging/src/k8s.io/mount-utils/mount_linux.go:27:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
staging/src/k8s.io/mount-utils/mount_helper_test.go:21:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
staging/src/k8s.io/mount-utils/mount_helper_unix_test.go:23:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
staging/src/k8s.io/mount-utils/mount_linux_test.go:25:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
staging/src/k8s.io/mount-utils/safe_format_and_mount_test.go:21:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
staging/src/k8s.io/mount-utils/resizefs_linux.go:152:17: ST1005: error strings should not be capitalized (stylecheck)
return false, fmt.Errorf("Could not parse fs info on given filesystem format: %s. Supported fs types are: xfs, ext3, ext4", format)
^
staging/src/k8s.io/mount-utils/resizefs_linux.go:189:17: ST1005: error strings should not be capitalized (stylecheck)
return false, fmt.Errorf("Failed readonly device check. Expected 1 or 0, got '%s'", outStr)
^
running ( cd /nvme/gopath/src/k8s.io/kubernetes/staging/src/k8s.io/pod-security-admission; env LOGCHECK_CONFIG=/nvme/gopath/src/k8s.io/kubernetes/hack/logcheck.conf /nvme/gopath/src/k8s.io/kubernetes/_output/local/bin/golangci-lint run --config=/nvme/gopath/src/k8s.io/kubernetes/hack/golangci-strict.yaml --path-prefix staging/src/k8s.io/pod-security-admission ./... )
staging/src/k8s.io/pod-security-admission/test/run.go:222:40: Error return value of `(k8s.io/client-go/kubernetes/typed/core/v1.NamespaceInterface).Delete` is not checked (errcheck)
client.CoreV1().Namespaces().Delete(context.Background(), ns, metav1.DeleteOptions{})
^
staging/src/k8s.io/pod-security-admission/test/run.go:236:47: Error return value of `(k8s.io/client-go/kubernetes/typed/core/v1.ServiceAccountInterface).Delete` is not checked (errcheck)
client.CoreV1().ServiceAccounts(ns).Delete(context.Background(), sa.Name, metav1.DeleteOptions{})
^
staging/src/k8s.io/pod-security-admission/cmd/webhook/server/server.go:243:28: Error return value of `opts.SecureServing.ApplyTo` is not checked (errcheck)
opts.SecureServing.ApplyTo(&c.SecureServing)
^
staging/src/k8s.io/pod-security-admission/cmd/webhook/server/server.go:244:30: Error return value of `opts.InsecureServing.ApplyTo` is not checked (errcheck)
opts.InsecureServing.ApplyTo(&c.InsecureServing)
^
staging/src/k8s.io/pod-security-admission/policy/registry.go:162:16: appendAssign: append result not assigned to the same slice (gocritic)
orderedIDs := append(baselineIDs, restrictedIDs...) // Baseline checks first, then restricted.
^
staging/src/k8s.io/pod-security-admission/policy/check_sysctls_test.go:70:11: elseif: can replace 'else {if cond {}}' with 'else if cond {}' (gocritic)
} else {
^
staging/src/k8s.io/pod-security-admission/policy/check_sysctls_test.go:122:11: elseif: can replace 'else {if cond {}}' with 'else if cond {}' (gocritic)
} else {
^
staging/src/k8s.io/pod-security-admission/cmd/webhook/server/server.go:26:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
staging/src/k8s.io/pod-security-admission/admission/api/load/load_test.go:21:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
staging/src/k8s.io/pod-security-admission/policy/check_sysctls.go:98:91: SA1019: sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (staticcheck)
func sysctls(podMetadata *metav1.ObjectMeta, podSpec *corev1.PodSpec, sysctls_allowed_set sets.String) CheckResult {
^
staging/src/k8s.io/pod-security-admission/test/fixtures.go:73:69: SA1019: pointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
p.Spec.SecurityContext = &corev1.PodSecurityContext{RunAsNonRoot: pointer.BoolPtr(true)}
^
staging/src/k8s.io/pod-security-admission/test/fixtures.go:81:92: SA1019: pointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
p.Spec.Containers[0].SecurityContext = &corev1.SecurityContext{AllowPrivilegeEscalation: pointer.BoolPtr(false)}
^
staging/src/k8s.io/pod-security-admission/test/fixtures.go:82:96: SA1019: pointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
p.Spec.InitContainers[0].SecurityContext = &corev1.SecurityContext{AllowPrivilegeEscalation: pointer.BoolPtr(false)}
^
staging/src/k8s.io/pod-security-admission/test/fixtures_allowPrivilegeEscalation.go:47:70: SA1019: pointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
p.Spec.Containers[0].SecurityContext.AllowPrivilegeEscalation = pointer.BoolPtr(true)
^
staging/src/k8s.io/pod-security-admission/test/fixtures_allowPrivilegeEscalation.go:51:74: SA1019: pointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
p.Spec.InitContainers[0].SecurityContext.AllowPrivilegeEscalation = pointer.BoolPtr(true)
^
staging/src/k8s.io/pod-security-admission/test/fixtures_privileged.go:41:56: SA1019: pointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
p.Spec.Containers[0].SecurityContext.Privileged = pointer.BoolPtr(false)
^
staging/src/k8s.io/pod-security-admission/test/fixtures_privileged.go:42:60: SA1019: pointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
p.Spec.InitContainers[0].SecurityContext.Privileged = pointer.BoolPtr(false)
^
staging/src/k8s.io/pod-security-admission/test/fixtures_privileged.go:51:56: SA1019: pointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
p.Spec.Containers[0].SecurityContext.Privileged = pointer.BoolPtr(true)
^
staging/src/k8s.io/pod-security-admission/test/fixtures_privileged.go:56:60: SA1019: pointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
p.Spec.InitContainers[0].SecurityContext.Privileged = pointer.BoolPtr(true)
^
staging/src/k8s.io/pod-security-admission/test/fixtures_runAsNonRoot.go:45:44: SA1019: pointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
p.Spec.SecurityContext.RunAsNonRoot = pointer.BoolPtr(true)
^
staging/src/k8s.io/pod-security-admission/test/fixtures_runAsNonRoot.go:52:58: SA1019: pointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
p.Spec.Containers[0].SecurityContext.RunAsNonRoot = pointer.BoolPtr(true)
^
staging/src/k8s.io/pod-security-admission/test/fixtures_runAsNonRoot.go:53:62: SA1019: pointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
p.Spec.InitContainers[0].SecurityContext.RunAsNonRoot = pointer.BoolPtr(true)
^
staging/src/k8s.io/pod-security-admission/test/fixtures_runAsNonRoot.go:67:74: SA1019: pointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
tweak(p, func(p *corev1.Pod) { p.Spec.SecurityContext.RunAsNonRoot = pointer.BoolPtr(false) }),
^
staging/src/k8s.io/pod-security-admission/test/fixtures_runAsNonRoot.go:69:88: SA1019: pointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
tweak(p, func(p *corev1.Pod) { p.Spec.Containers[0].SecurityContext.RunAsNonRoot = pointer.BoolPtr(false) }),
^
staging/src/k8s.io/pod-security-admission/test/fixtures_runAsNonRoot.go:70:92: SA1019: pointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
tweak(p, func(p *corev1.Pod) { p.Spec.InitContainers[0].SecurityContext.RunAsNonRoot = pointer.BoolPtr(false) }),
^
staging/src/k8s.io/pod-security-admission/test/fixtures_runAsUser.go:44:41: SA1019: pointer.Int64Ptr is deprecated: Use Int64 instead. (staticcheck)
p.Spec.SecurityContext.RunAsUser = pointer.Int64Ptr(1000)
^
staging/src/k8s.io/pod-security-admission/test/fixtures_runAsUser.go:45:55: SA1019: pointer.Int64Ptr is deprecated: Use Int64 instead. (staticcheck)
p.Spec.Containers[0].SecurityContext.RunAsUser = pointer.Int64Ptr(1000)
^
staging/src/k8s.io/pod-security-admission/test/fixtures_runAsUser.go:46:59: SA1019: pointer.Int64Ptr is deprecated: Use Int64 instead. (staticcheck)
p.Spec.InitContainers[0].SecurityContext.RunAsUser = pointer.Int64Ptr(1000)
^
staging/src/k8s.io/pod-security-admission/test/fixtures_runAsUser.go:54:71: SA1019: pointer.Int64Ptr is deprecated: Use Int64 instead. (staticcheck)
tweak(p, func(p *corev1.Pod) { p.Spec.SecurityContext.RunAsUser = pointer.Int64Ptr(0) }),
^
staging/src/k8s.io/pod-security-admission/test/fixtures_runAsUser.go:56:85: SA1019: pointer.Int64Ptr is deprecated: Use Int64 instead. (staticcheck)
tweak(p, func(p *corev1.Pod) { p.Spec.Containers[0].SecurityContext.RunAsUser = pointer.Int64Ptr(0) }),
^
staging/src/k8s.io/pod-security-admission/test/fixtures_runAsUser.go:57:89: SA1019: pointer.Int64Ptr is deprecated: Use Int64 instead. (staticcheck)
tweak(p, func(p *corev1.Pod) { p.Spec.InitContainers[0].SecurityContext.RunAsUser = pointer.Int64Ptr(0) }),
^
staging/src/k8s.io/pod-security-admission/test/fixtures_windowsHostProcess.go:64:58: SA1019: pointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
p.Spec.SecurityContext.WindowsOptions.HostProcess = pointer.BoolPtr(true)
^
staging/src/k8s.io/pod-security-admission/test/fixtures_windowsHostProcess.go:71:72: SA1019: pointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
p.Spec.Containers[0].SecurityContext.WindowsOptions.HostProcess = pointer.BoolPtr(true)
^
staging/src/k8s.io/pod-security-admission/test/fixtures_windowsHostProcess.go:72:76: SA1019: pointer.BoolPtr is deprecated: Use Bool instead. (staticcheck)
p.Spec.InitContainers[0].SecurityContext.WindowsOptions.HostProcess = pointer.BoolPtr(true)
^
staging/src/k8s.io/pod-security-admission/test/fixtures_test.go:21:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
staging/src/k8s.io/pod-security-admission/admission/api/v1/defaults.go:28:6: ST1003: should not use underscores in Go names; func SetDefaults_PodSecurityDefaults should be SetDefaultsPodSecurityDefaults (stylecheck)
func SetDefaults_PodSecurityDefaults(obj *PodSecurityDefaults) {
^
staging/src/k8s.io/pod-security-admission/admission/api/v1alpha1/defaults.go:28:6: ST1003: should not use underscores in Go names; func SetDefaults_PodSecurityDefaults should be SetDefaultsPodSecurityDefaults (stylecheck)
func SetDefaults_PodSecurityDefaults(obj *PodSecurityDefaults) {
^
staging/src/k8s.io/pod-security-admission/admission/api/v1beta1/defaults.go:28:6: ST1003: should not use underscores in Go names; func SetDefaults_PodSecurityDefaults should be SetDefaultsPodSecurityDefaults (stylecheck)
func SetDefaults_PodSecurityDefaults(obj *PodSecurityDefaults) {
^
staging/src/k8s.io/pod-security-admission/policy/check_allowPrivilegeEscalation.go:64:6: ST1003: should not use underscores in Go names; func allowPrivilegeEscalation_1_8 should be allowPrivilegeEscalation1_8 (stylecheck)
func allowPrivilegeEscalation_1_8(podMetadata *metav1.ObjectMeta, podSpec *corev1.PodSpec) CheckResult {
^
staging/src/k8s.io/pod-security-admission/policy/check_allowPrivilegeEscalation.go:86:6: ST1003: should not use underscores in Go names; func allowPrivilegeEscalation_1_25 should be allowPrivilegeEscalation1_25 (stylecheck)
func allowPrivilegeEscalation_1_25(podMetadata *metav1.ObjectMeta, podSpec *corev1.PodSpec) CheckResult {
^
staging/src/k8s.io/pod-security-admission/policy/check_appArmorProfile.go:64:6: ST1003: should not use underscores in Go names; func appArmorProfile_1_0 should be appArmorProfile1_0 (stylecheck)
func appArmorProfile_1_0(podMetadata *metav1.ObjectMeta, podSpec *corev1.PodSpec) CheckResult {
^
staging/src/k8s.io/pod-security-admission/policy/check_capabilities_baseline.go:62:2: ST1003: should not use underscores in Go names; var capabilities_allowed_1_0 should be capabilitiesAllowed1_0 (stylecheck)
capabilities_allowed_1_0 = sets.NewString(
^
staging/src/k8s.io/pod-security-admission/policy/check_capabilities_baseline.go:79:6: ST1003: should not use underscores in Go names; func capabilitiesBaseline_1_0 should be capabilitiesBaseline1_0 (stylecheck)
func capabilitiesBaseline_1_0(podMetadata *metav1.ObjectMeta, podSpec *corev1.PodSpec) CheckResult {
^
staging/src/k8s.io/pod-security-admission/policy/check_capabilities_restricted.go:79:6: ST1003: should not use underscores in Go names; func capabilitiesRestricted_1_22 should be capabilitiesRestricted1_22 (stylecheck)
func capabilitiesRestricted_1_22(podMetadata *metav1.ObjectMeta, podSpec *corev1.PodSpec) CheckResult {
^
staging/src/k8s.io/pod-security-admission/policy/check_capabilities_restricted.go:138:6: ST1003: should not use underscores in Go names; func capabilitiesRestricted_1_25 should be capabilitiesRestricted1_25 (stylecheck)
func capabilitiesRestricted_1_25(podMetadata *metav1.ObjectMeta, podSpec *corev1.PodSpec) CheckResult {
^
staging/src/k8s.io/pod-security-admission/policy/check_hostNamespaces.go:58:6: ST1003: should not use underscores in Go names; func hostNamespaces_1_0 should be hostNamespaces1_0 (stylecheck)
func hostNamespaces_1_0(podMetadata *metav1.ObjectMeta, podSpec *corev1.PodSpec) CheckResult {
^
staging/src/k8s.io/pod-security-admission/policy/check_hostPathVolumes.go:58:6: ST1003: should not use underscores in Go names; func hostPathVolumes_1_0 should be hostPathVolumes1_0 (stylecheck)
func hostPathVolumes_1_0(podMetadata *metav1.ObjectMeta, podSpec *corev1.PodSpec) CheckResult {
^
staging/src/k8s.io/pod-security-admission/policy/check_hostPorts.go:60:6: ST1003: should not use underscores in Go names; func hostPorts_1_0 should be hostPorts1_0 (stylecheck)
func hostPorts_1_0(podMetadata *metav1.ObjectMeta, podSpec *corev1.PodSpec) CheckResult {
^
staging/src/k8s.io/pod-security-admission/policy/check_privileged.go:56:6: ST1003: should not use underscores in Go names; func privileged_1_0 should be privileged1_0 (stylecheck)
func privileged_1_0(podMetadata *metav1.ObjectMeta, podSpec *corev1.PodSpec) CheckResult {
^
staging/src/k8s.io/pod-security-admission/policy/check_procMount.go:60:6: ST1003: should not use underscores in Go names; func procMount_1_0 should be procMount1_0 (stylecheck)
func procMount_1_0(podMetadata *metav1.ObjectMeta, podSpec *corev1.PodSpec) CheckResult {
^
staging/src/k8s.io/pod-security-admission/policy/check_restrictedVolumes.go:87:6: ST1003: should not use underscores in Go names; func restrictedVolumes_1_0 should be restrictedVolumes1_0 (stylecheck)
func restrictedVolumes_1_0(podMetadata *metav1.ObjectMeta, podSpec *corev1.PodSpec) CheckResult {
^
staging/src/k8s.io/pod-security-admission/policy/check_runAsNonRoot.go:61:6: ST1003: should not use underscores in Go names; func runAsNonRoot_1_0 should be runAsNonRoot1_0 (stylecheck)
func runAsNonRoot_1_0(podMetadata *metav1.ObjectMeta, podSpec *corev1.PodSpec) CheckResult {
^
staging/src/k8s.io/pod-security-admission/policy/check_runAsUser.go:62:6: ST1003: should not use underscores in Go names; func runAsUser_1_23 should be runAsUser1_23 (stylecheck)
func runAsUser_1_23(podMetadata *metav1.ObjectMeta, podSpec *corev1.PodSpec) CheckResult {
^
staging/src/k8s.io/pod-security-admission/policy/check_seLinuxOptions.go:74:2: ST1003: should not use underscores in Go names; var selinux_allowed_types_1_0 should be selinuxAllowedTypes1_0 (stylecheck)
selinux_allowed_types_1_0 = sets.NewString("", "container_t", "container_init_t", "container_kvm_t")
^
staging/src/k8s.io/pod-security-admission/policy/check_seLinuxOptions.go:77:6: ST1003: should not use underscores in Go names; func seLinuxOptions_1_0 should be seLinuxOptions1_0 (stylecheck)
func seLinuxOptions_1_0(podMetadata *metav1.ObjectMeta, podSpec *corev1.PodSpec) CheckResult {
^
staging/src/k8s.io/pod-security-admission/policy/check_seccompProfile_baseline.go:87:6: ST1003: should not use underscores in Go names; func seccompProfileBaseline_1_0 should be seccompProfileBaseline1_0 (stylecheck)
func seccompProfileBaseline_1_0(podMetadata *metav1.ObjectMeta, podSpec *corev1.PodSpec) CheckResult {
^
staging/src/k8s.io/pod-security-admission/policy/check_seccompProfile_baseline.go:121:6: ST1003: should not use underscores in Go names; func seccompProfileBaseline_1_19 should be seccompProfileBaseline1_19 (stylecheck)
func seccompProfileBaseline_1_19(podMetadata *metav1.ObjectMeta, podSpec *corev1.PodSpec) CheckResult {
^
staging/src/k8s.io/pod-security-admission/policy/check_seccompProfile_restricted.go:69:6: ST1003: should not use underscores in Go names; func seccompProfileRestricted_1_19 should be seccompProfileRestricted1_19 (stylecheck)
func seccompProfileRestricted_1_19(podMetadata *metav1.ObjectMeta, podSpec *corev1.PodSpec) CheckResult {
^
staging/src/k8s.io/pod-security-admission/policy/check_seccompProfile_restricted.go:148:6: ST1003: should not use underscores in Go names; func seccompProfileRestricted_1_25 should be seccompProfileRestricted1_25 (stylecheck)
func seccompProfileRestricted_1_25(podMetadata *metav1.ObjectMeta, podSpec *corev1.PodSpec) CheckResult {
^
staging/src/k8s.io/pod-security-admission/policy/check_sysctls.go:73:2: ST1003: should not use underscores in Go names; var sysctls_allowed_1_0 should be sysctlsAllowed1_0 (stylecheck)
sysctls_allowed_1_0 = sets.NewString(
^
staging/src/k8s.io/pod-security-admission/policy/check_sysctls.go:80:2: ST1003: should not use underscores in Go names; var sysctls_allowed_1_27 should be sysctlsAllowed1_27 (stylecheck)
sysctls_allowed_1_27 = sets.NewString(
^
staging/src/k8s.io/pod-security-admission/policy/check_sysctls.go:90:6: ST1003: should not use underscores in Go names; func sysctls_1_0 should be sysctls1_0 (stylecheck)
func sysctls_1_0(podMetadata *metav1.ObjectMeta, podSpec *corev1.PodSpec) CheckResult {
^
staging/src/k8s.io/pod-security-admission/policy/check_sysctls.go:94:6: ST1003: should not use underscores in Go names; func sysctls_1_27 should be sysctls1_27 (stylecheck)
func sysctls_1_27(podMetadata *metav1.ObjectMeta, podSpec *corev1.PodSpec) CheckResult {
^
staging/src/k8s.io/pod-security-admission/policy/check_windowsHostProcess.go:59:6: ST1003: should not use underscores in Go names; func windowsHostProcess_1_0 should be windowsHostProcess1_0 (stylecheck)
func windowsHostProcess_1_0(podMetadata *metav1.ObjectMeta, podSpec *corev1.PodSpec) CheckResult {
^
staging/src/k8s.io/pod-security-admission/test/fixtures.go:62:2: ST1003: should not use underscores in Go names; var baseline_1_0 should be baseline1_0 (stylecheck)
baseline_1_0 := &corev1.Pod{Spec: corev1.PodSpec{
^
staging/src/k8s.io/pod-security-admission/test/fixtures.go:72:2: ST1003: should not use underscores in Go names; var restricted_1_0 should be restricted1_0 (stylecheck)
restricted_1_0 := tweak(baseline_1_0, func(p *corev1.Pod) {
^
staging/src/k8s.io/pod-security-admission/test/fixtures.go:80:2: ST1003: should not use underscores in Go names; var restricted_1_8 should be restricted1_8 (stylecheck)
restricted_1_8 := tweak(restricted_1_0, func(p *corev1.Pod) {
^
staging/src/k8s.io/pod-security-admission/test/fixtures.go:89:2: ST1003: should not use underscores in Go names; var restricted_1_19 should be restricted1_19 (stylecheck)
restricted_1_19 := tweak(restricted_1_8, func(p *corev1.Pod) {
^
staging/src/k8s.io/pod-security-admission/test/fixtures.go:100:2: ST1003: should not use underscores in Go names; var restricted_1_22 should be restricted1_22 (stylecheck)
restricted_1_22 := tweak(restricted_1_19, func(p *corev1.Pod) {
^
staging/src/k8s.io/pod-security-admission/test/fixtures.go:112:2: ST1003: should not use underscores in Go names; var restricted_1_25_windows should be restricted1_25Windows (stylecheck)
restricted_1_25_windows := addWindows(restricted_1_0)
^
staging/src/k8s.io/pod-security-admission/test/fixtures_allowPrivilegeEscalation.go:35:2: ST1003: should not use underscores in Go names; var fixtureData_1_8 should be fixtureData1_8 (stylecheck)
fixtureData_1_8 := fixtureGenerator{
^
staging/src/k8s.io/pod-security-admission/test/fixtures_appArmorProfile.go:26:2: ST1003: should not use underscores in Go names; var appArmorFixture_1_0 should be appArmorFixture1_0 (stylecheck)
appArmorFixture_1_0 := fixtureGenerator{
^
staging/src/k8s.io/pod-security-admission/test/fixtures_capabilities_baseline.go:49:2: ST1003: should not use underscores in Go names; var fixtureData_1_0 should be fixtureData1_0 (stylecheck)
fixtureData_1_0 := fixtureGenerator{
^
staging/src/k8s.io/pod-security-admission/test/fixtures_capabilities_restricted.go:32:2: ST1003: should not use underscores in Go names; var fixtureData_1_22 should be fixtureData1_22 (stylecheck)
fixtureData_1_22 := fixtureGenerator{
^
staging/src/k8s.io/pod-security-admission/test/fixtures_hostNamespaces.go:30:2: ST1003: should not use underscores in Go names; var fixtureData_1_0 should be fixtureData1_0 (stylecheck)
fixtureData_1_0 := fixtureGenerator{
^
staging/src/k8s.io/pod-security-admission/test/fixtures_hostPathVolumes.go:30:2: ST1003: should not use underscores in Go names; var fixtureData_1_0 should be fixtureData1_0 (stylecheck)
fixtureData_1_0 := fixtureGenerator{
^
staging/src/k8s.io/pod-security-admission/test/fixtures_hostPorts.go:33:2: ST1003: should not use underscores in Go names; var fixtureData_1_0 should be fixtureData1_0 (stylecheck)
fixtureData_1_0 := fixtureGenerator{
^
staging/src/k8s.io/pod-security-admission/test/fixtures_privileged.go:35:2: ST1003: should not use underscores in Go names; var fixtureData_1_0 should be fixtureData1_0 (stylecheck)
fixtureData_1_0 := fixtureGenerator{
^
staging/src/k8s.io/pod-security-admission/test/fixtures_procMount.go:26:2: ST1003: should not use underscores in Go names; var fixtureData_1_0 should be fixtureData1_0 (stylecheck)
fixtureData_1_0 := fixtureGenerator{
^
staging/src/k8s.io/pod-security-admission/test/fixtures_restrictedVolumes.go:26:2: ST1003: should not use underscores in Go names; var fixtureData_1_0 should be fixtureData1_0 (stylecheck)
fixtureData_1_0 := fixtureGenerator{
^
staging/src/k8s.io/pod-security-admission/test/fixtures_runAsNonRoot.go:39:2: ST1003: should not use underscores in Go names; var fixtureData_1_0 should be fixtureData1_0 (stylecheck)
fixtureData_1_0 := fixtureGenerator{
^
staging/src/k8s.io/pod-security-admission/test/fixtures_runAsUser.go:39:2: ST1003: should not use underscores in Go names; var fixtureData_1_23 should be fixtureData1_23 (stylecheck)
fixtureData_1_23 := fixtureGenerator{
^
staging/src/k8s.io/pod-security-admission/test/fixtures_seLinuxOptions.go:40:2: ST1003: should not use underscores in Go names; var fixtureData_1_0 should be fixtureData1_0 (stylecheck)
fixtureData_1_0 := fixtureGenerator{
^
staging/src/k8s.io/pod-security-admission/test/fixtures_seccompProfile_baseline.go:32:2: ST1003: should not use underscores in Go names; var fixtureData_baseline_1_0 should be fixtureDataBaseline1_0 (stylecheck)
fixtureData_baseline_1_0 := fixtureGenerator{
^
staging/src/k8s.io/pod-security-admission/test/fixtures_seccompProfile_baseline.go:68:2: ST1003: should not use underscores in Go names; var fixtureData_baseline_1_19 should be fixtureDataBaseline1_19 (stylecheck)
fixtureData_baseline_1_19 := fixtureGenerator{
^
running ( cd /nvme/gopath/src/k8s.io/kubernetes/staging/src/k8s.io/sample-apiserver; env LOGCHECK_CONFIG=/nvme/gopath/src/k8s.io/kubernetes/hack/logcheck.conf /nvme/gopath/src/k8s.io/kubernetes/_output/local/bin/golangci-lint run --config=/nvme/gopath/src/k8s.io/kubernetes/hack/golangci-strict.yaml --path-prefix staging/src/k8s.io/sample-apiserver ./... )
staging/src/k8s.io/sample-apiserver/pkg/apis/wardle/validation/validation.go:37:2: ifElseChain: rewrite if-else to switch statement (gocritic)
if len(s.FlunderReference) != 0 && len(s.FischerReference) != 0 {
^
staging/src/k8s.io/sample-apiserver/pkg/apis/wardle/v1alpha1/conversion.go:25:6: ST1003: should not use underscores in Go names; func Convert_v1alpha1_FlunderSpec_To_wardle_FlunderSpec should be ConvertV1alpha1FlunderSpecToWardleFlunderSpec (stylecheck)
func Convert_v1alpha1_FlunderSpec_To_wardle_FlunderSpec(in *FlunderSpec, out *wardle.FlunderSpec, s conversion.Scope) error {
^
staging/src/k8s.io/sample-apiserver/pkg/apis/wardle/v1alpha1/conversion.go:42:6: ST1003: should not use underscores in Go names; func Convert_wardle_FlunderSpec_To_v1alpha1_FlunderSpec should be ConvertWardleFlunderSpecToV1alpha1FlunderSpec (stylecheck)
func Convert_wardle_FlunderSpec_To_v1alpha1_FlunderSpec(in *wardle.FlunderSpec, out *FlunderSpec, s conversion.Scope) error {
^
staging/src/k8s.io/sample-apiserver/pkg/apis/wardle/v1alpha1/defaults.go:28:6: ST1003: should not use underscores in Go names; func SetDefaults_FlunderSpec should be SetDefaultsFlunderSpec (stylecheck)
func SetDefaults_FlunderSpec(obj *FlunderSpec) {
^
running ( cd /nvme/gopath/src/k8s.io/kubernetes/staging/src/k8s.io/sample-cli-plugin; env LOGCHECK_CONFIG=/nvme/gopath/src/k8s.io/kubernetes/hack/logcheck.conf /nvme/gopath/src/k8s.io/kubernetes/_output/local/bin/golangci-lint run --config=/nvme/gopath/src/k8s.io/kubernetes/hack/golangci-strict.yaml --path-prefix staging/src/k8s.io/sample-cli-plugin ./... )
running ( cd /nvme/gopath/src/k8s.io/kubernetes/staging/src/k8s.io/sample-controller; env LOGCHECK_CONFIG=/nvme/gopath/src/k8s.io/kubernetes/hack/logcheck.conf /nvme/gopath/src/k8s.io/kubernetes/_output/local/bin/golangci-lint run --config=/nvme/gopath/src/k8s.io/kubernetes/hack/golangci-strict.yaml --path-prefix staging/src/k8s.io/sample-controller ./... )
staging/src/k8s.io/sample-controller/controller.go:120:40: Error return value of `(k8s.io/client-go/tools/cache.SharedInformer).AddEventHandler` is not checked (errcheck)
fooInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{
^
staging/src/k8s.io/sample-controller/controller.go:132:47: Error return value of `(k8s.io/client-go/tools/cache.SharedInformer).AddEventHandler` is not checked (errcheck)
deploymentInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{
^
staging/src/k8s.io/sample-controller/controller_test.go:101:69: Error return value of `(k8s.io/client-go/tools/cache.Store).Add` is not checked (errcheck)
i.Samplecontroller().V1alpha1().Foos().Informer().GetIndexer().Add(f)
^
staging/src/k8s.io/sample-controller/controller_test.go:105:61: Error return value of `(k8s.io/client-go/tools/cache.Store).Add` is not checked (errcheck)
k8sI.Apps().V1().Deployments().Informer().GetIndexer().Add(d)
^
Please review the above warnings. You can test via "./hack/verify-golangci-lint.sh -s --"
If the above warnings do not make sense, you can exempt this warning with a comment
(if your reviewer is okay with it).
The more strict golangci-strict.yaml was used. If you feel that this warns about issues
that should be ignored by default, then please discuss with your reviewer and propose
a change for hack/golangci-strict.yaml as part of your PR.
In general please prefer to fix the error, we have already disabled specific lints
that the project chooses to ignore.
See: https://golangci-lint.run/usage/false-positives/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment