Showing 1000 of 24991 detailed findings. The summary includes all 24991 findings.
pkg/kubeapiserver/authorizer/reload.go1
280:20add-constant
pkg/kubeapiserver/authorizer/reload.go:280:20
if err != nil { klog.ErrorS(err, "reloading authorization config") metrics.RecordAuthorizationConfigAutomaticReloadFailure(r.apiServerID)pkg/registry/core/service/allocator/storage/storage.go1
33:2blank-imports
pkg/registry/core/service/allocator/storage/storage.go:33:2
api "k8s.io/kubernetes/pkg/apis/core" _ "k8s.io/kubernetes/pkg/apis/core/install" "k8s.io/kubernetes/pkg/registry/core/rangeallocation"pkg/proxy/winkernel/proxier_test.go1
1425:6boolean-literal-comparison
pkg/proxy/winkernel/proxier_test.go:1425:6
} if svcInfo.localTrafficDSR != true { t.Errorf("Failed to create DSR loadbalancer with local traffic policy")pkg/kubeapiserver/authenticator/config.go1
107:22cognitive-complexity
pkg/kubeapiserver/authenticator/config.go:107:22
// Kubernetes authentication mechanisms.func (config Config) New(serverLifecycle context.Context) (authenticator.Request, func(context.Context, *apiserver.AuthenticationConfiguration) error, *spec.SecurityDefinitions, spec3.SecuritySchemes, error) { var authenticators []authenticator.Requestpkg/proxy/config/config.go1
473:6confusing-naming
pkg/proxy/config/config.go:473:6
// event handler completes processing and is only used for testing.func newNodeTopologyConfig(ctx context.Context, nodeInformer v1informers.NodeInformer, resyncPeriod time.Duration, callback func()) *NodeTopologyConfig { result := &NodeTopologyConfig{pkg/proxy/iptables/proxier_test.go1
5498:89confusing-results
pkg/proxy/iptables/proxier_test.go:5498:89
func countEndpointsAndComments(iptablesData string, matchEndpoint string) (string, int, int) { var numEndpoints, numComments intpkg/proxy/healthcheck/service_health.go1
297:6constructor-interface-return
pkg/proxy/healthcheck/service_health.go:297:6
// NewFakeServiceHealthServer allocates a new fake service healthcheck server managerfunc NewFakeServiceHealthServer() ServiceHealthServer { return FakeServiceHealthServer{}pkg/registry/core/node/strategy.go1
247:124context-as-argument
pkg/registry/core/node/strategy.go:247:124
// ResourceLocation returns a URL and transport which one can use to send traffic for the specified node.func ResourceLocation(getter ResourceGetter, connection client.ConnectionInfoGetter, proxyTransport http.RoundTripper, ctx context.Context, id string) (*url.URL, http.RoundTripper, error) { schemeReq, name, portReq, valid := utilnet.SplitSchemeNamePort(id)pkg/scheduler/backend/queue/scheduling_queue_test.go1
2403:6context-cancel-in-loop
pkg/scheduler/backend/queue/scheduling_queue_test.go:2403:6
ctx, cancel := context.WithCancel(ctx) defer cancel() q := NewTestQueue(ctx, newDefaultQueueSort(), WithClock(c), WithQueueingHintMapPerProfile(m))pkg/kubeapiserver/authenticator/config.go2
307:2context-stored-in-struct
pkg/kubeapiserver/authenticator/config.go:307:2
type authenticationConfigUpdater struct { serverLifecycle context.Context config Config107:22cyclomatic-complexity
pkg/kubeapiserver/authenticator/config.go:107:22
// Kubernetes authentication mechanisms.func (config Config) New(serverLifecycle context.Context) (authenticator.Request, func(context.Context, *apiserver.AuthenticationConfiguration) error, *spec.SecurityDefinitions, spec3.SecuritySchemes, error) { var authenticators []authenticator.Requestpkg/scheduler/framework/plugins/volumebinding/binder_test.go1
196:4deep-exit
pkg/scheduler/framework/plugins/volumebinding/binder_test.go:196:4
logger.Error(nil, "Error syncing informer", "informer", v) os.Exit(1) }pkg/proxy/config/api_test.go1
210:9deprecated-api-usage
pkg/proxy/config/api_test.go:210:9
err := wait.PollImmediate(time.Millisecond*10, wait.ForeverTestTimeout, func() (bool, error) { svcHandler.lock.Lock()pkg/kubeapiserver/options/admission.go1
83:2discarded-error-result
pkg/kubeapiserver/options/admission.go:83:2
"Comma-delimited list of: "+strings.Join(a.GenericAdmission.Plugins.Registered(), ", ")+".") fs.MarkDeprecated("admission-control", "Use --enable-admission-plugins or --disable-admission-plugins instead. Will be removed in a future version.") fs.Lookup("admission-control").Hidden = falsepkg/kubeapiserver/admission/config.go1
23:1doc-comment-period
pkg/kubeapiserver/admission/config.go:23:1
// Config holds the configuration needed to for initialize the admission pluginstype Config struct{}pkg/proxy/conntrack/cleanup.go1
53:3early-return
pkg/proxy/conntrack/cleanup.go:53:3
if err != nil { if errors.Is(err, unix.EINTR) { klog.V(2).ErrorS(err, "received a partial result, continuing to clean with partial result")pkg/proxy/conntrack/cleanup_test.go1
270:99empty-conditional-block
pkg/proxy/conntrack/cleanup_test.go:270:99
entriesBeforeCleanup = append(entriesBeforeCleanup, entry) if proto == unix.IPPROTO_UDP && port == testServicePort && dnatDest != testServingEndpointIP { // we do not expect UDP entries with destination port `testServicePort` and DNATed destinationpkg/proxy/ipvs/ipset/ipset.go1
33:5error-naming
pkg/proxy/ipvs/ipset/ipset.go:33:5
var validationError = fmt.Errorf("failed to validate entry for ipset")pkg/kubeapiserver/options/admission_test.go1
33:12error-strings
pkg/kubeapiserver/options/admission_test.go:33:12
if len(options.Validate()) == 0 { t.Errorf("Expect error, but got none") }pkg/registry/core/service/ipallocator/interfaces.go1
51:6error-type-naming
pkg/registry/core/service/ipallocator/interfaces.go:51:6
type ErrNotInRange struct { IP net.IPpkg/registry/core/service/ipallocator/storage/storage_test.go1
82:2excessive-blank-identifiers
pkg/registry/core/service/ipallocator/storage/storage_test.go:82:2
func TestEmpty(t *testing.T) { _, storage, _, _, destroyFunc := newStorage(t) defer destroyFunc()pkg/kubeapiserver/admission/exclusion/resources.go1
58:6exported-declaration-comment
pkg/kubeapiserver/admission/exclusion/resources.go:58:6
// should intercept.func Included() []schema.GroupResource { return slices.Clone(included)pkg/kubeapiserver/options/authentication.go1
1:1file-length-limit
pkg/kubeapiserver/options/authentication.go:1:1
/*Copyright 2016 The Kubernetes Authors.pkg/proxy/apis/config/fuzzer/fuzzer.go1
33:23flag-parameter
pkg/proxy/apis/config/fuzzer/fuzzer.go:33:23
// generateRandomIP is copied from pkg/apis/networking/fuzzer/fuzzer.gofunc generateRandomIP(is6 bool, c randfill.Continue) string { n := 4pkg/kubeapiserver/admission/config.go1
1:1format
pkg/kubeapiserver/admission/config.go:1:1
/*Copyright 2018 The Kubernetes Authors.- Fix (safe): run `strider fmt pkg/kubeapiserver/admission/config.go`
pkg/kubeapiserver/authenticator/config.go2
107:22function-length
pkg/kubeapiserver/authenticator/config.go:107:22
// Kubernetes authentication mechanisms.func (config Config) New(serverLifecycle context.Context) (authenticator.Request, func(context.Context, *apiserver.AuthenticationConfiguration) error, *spec.SecurityDefinitions, spec3.SecuritySchemes, error) { var authenticators []authenticator.Request107:22function-result-limit
pkg/kubeapiserver/authenticator/config.go:107:22
// Kubernetes authentication mechanisms.func (config Config) New(serverLifecycle context.Context) (authenticator.Request, func(context.Context, *apiserver.AuthenticationConfiguration) error, *spec.SecurityDefinitions, spec3.SecuritySchemes, error) { var authenticators []authenticator.Requestpkg/proxy/util/nodeport_addresses.go1
111:4identical-switch-branches
pkg/proxy/util/nodeport_addresses.go:111:4
ip = v.IP case *net.IPNet: ip = v.IPpkg/registry/core/node/storage/storage.go1
32:2import-alias-naming
pkg/registry/core/node/storage/storage.go:32:2
api "k8s.io/kubernetes/pkg/apis/core" k8s_api_v1 "k8s.io/kubernetes/pkg/apis/core/v1" "k8s.io/kubernetes/pkg/kubelet/client"pkg/kubeapiserver/authenticator/config.go1
238:2import-shadowing
pkg/kubeapiserver/authenticator/config.go:238:2
authenticator := union.New(authenticators...)pkg/registry/apps/replicaset/storage/storage_test.go1
122:4increment-decrement
pkg/registry/apps/replicaset/storage/storage_test.go:122:4
object := obj.(*apps.ReplicaSet) object.Spec.Replicas = object.Spec.Replicas + 1 return objectpkg/proxy/endpointslicecache.go1
108:3inefficient-map-lookup
pkg/proxy/endpointslicecache.go:108:3
if _, ok := cache.trackerByServiceMap[serviceKey]; !ok { cache.trackerByServiceMap[serviceKey] = newEndpointSliceTracker() }pkg/proxy/iptables/number_generated_rules_test.go1
374:21inefficient-sprintf
pkg/proxy/iptables/number_generated_rules_test.go:374:21
Ports: []discovery.EndpointPort{{ Name: ptr.To(fmt.Sprintf("%d", epPort)), Port: ptr.To(int32(epPort)),pkg/kubeapiserver/options/authentication_test.go1
85:24insecure-url-scheme
pkg/kubeapiserver/options/authentication_test.go:85:24
testSA: &ServiceAccountAuthenticationOptions{ Issuers: []string{"http://foo.bar.com"}, KeyFiles: []string{"testkeyfile1", "testkeyfile2"},pkg/proxy/ipvs/util/ipvs.go1
29:16interface-method-limit
pkg/proxy/ipvs/util/ipvs.go:29:16
// Interface is an injectable interface for running ipvs commands. Implementations must be goroutine-safe.type Interface interface { // Flush clears all virtual servers in system. return occurred error immediately.pkg/proxy/ipvs/proxier.go1
1105:7max-control-nesting
pkg/proxy/ipvs/proxier.go:1105:7
for _, entry := range entries { if valid := nodePortLocalSet.validateEntry(entry); !valid { proxier.logger.Error(nil, "Error adding entry to ipset", "entry", entry, "ipset", nodePortLocalSet.Name)pkg/kubeapiserver/options/authentication.go2
670:40max-parameters
pkg/kubeapiserver/options/authentication.go:670:40
// The input context controls the lifecycle of background goroutines started to reload the authentication config file.func (o *BuiltInAuthenticationOptions) ApplyTo( ctx context.Context,148:6max-public-structs
pkg/kubeapiserver/options/authentication.go:148:6
// TokenFileAuthenticationOptions contains token file authentication options for API Servertype TokenFileAuthenticationOptions struct { TokenFile stringpkg/kubeapiserver/options/admission.go1
84:2modifies-parameter
pkg/kubeapiserver/options/admission.go:84:2
fs.MarkDeprecated("admission-control", "Use --enable-admission-plugins or --disable-admission-plugins instead. Will be removed in a future version.") fs.Lookup("admission-control").Hidden = falsepkg/proxy/endpointschangetracker.go1
246:3modifies-value-receiver
pkg/proxy/endpointschangetracker.go:246:3
} em[svcPortName] = epList }pkg/kubeapiserver/authorizer/modes/modes_test.go1
22:16nested-structs
pkg/kubeapiserver/authorizer/modes/modes_test.go:22:16
func TestIsValidAuthorizationMode(t *testing.T) { var tests = []struct { authzMode stringpkg/proxy/ipvs/netlink_linux.go1
57:4nil-error-return
pkg/proxy/ipvs/netlink_linux.go:57:4
if err == unix.EEXIST { return true, nil }pkg/kubeapiserver/options/authorization.go1
210:3nil-value-with-nil-error
pkg/kubeapiserver/options/authorization.go:210:3
if o == nil { return nil, nil }pkg/registry/admissionregistration/mutatingadmissionpolicybinding/storage/storage_test.go1
61:3no-defer-in-loop
pkg/registry/admissionregistration/mutatingadmissionpolicybinding/storage/storage_test.go:61:3
storage, server := newInsecureStorage(t) defer server.Terminate(t) defer storage.Store.DestroyFunc()pkg/kubeapiserver/options/authentication_test.go1
1786:4no-else-after-return
pkg/kubeapiserver/options/authentication_test.go:1786:4
return "The system cannot find the file specified" } else { return "no such file or directory"pkg/kubeapiserver/options/authentication.go1
876:6no-init
pkg/kubeapiserver/options/authentication.go:876:6
func init() { install.Install(cfgScheme)pkg/proxy/iptables/cleanup.go1
38:2no-naked-return
pkg/proxy/iptables/cleanup.go:38:2
} return}pkg/kubeapiserver/admission/exclusion/resources.go1
30:5no-package-var
pkg/kubeapiserver/admission/exclusion/resources.go:30:5
// in either include or excluded list.var included = []schema.GroupResource{ {Group: "", Resource: "bindings"},pkg/kubeapiserver/authenticator/config.go1
148:5optimize-operands-order
pkg/kubeapiserver/authenticator/config.go:148:5
} if len(config.ServiceAccountIssuers) > 0 && config.ServiceAccountPublicKeysGetter != nil { serviceAccountAuth, err := newServiceAccountAuthenticator(config.ServiceAccountIssuers, config.ServiceAccountPublicKeysGetter, config.APIAudiences, config.ServiceAccountTokenGetter)pkg/registry/networking/ipaddress/strategy.go1
66:2overwritten-before-use
pkg/registry/networking/ipaddress/strategy.go:66:2
func (ipAddressStrategy) PrepareForUpdate(ctx context.Context, obj, old runtime.Object) { newIPAddress := obj.(*networking.IPAddress) oldIPAddress := old.(*networking.IPAddress)pkg/kubeapiserver/admission/config.go1
17:9package-comments
pkg/kubeapiserver/admission/config.go:17:9
package admissionpkg/proxy/ipvs/util/doc.go1
19:9package-directory-mismatch
pkg/proxy/ipvs/util/doc.go:19:9
package ipvspkg/registry/core/node/storage/storage_test.go1
259:16possible-nil-dereference
pkg/registry/core/node/storage/storage_test.go:259:16
if location.Host != testCase.host { t.Errorf("Unexpected host: expected %v, but got %v", testCase.host, location.Host)pkg/proxy/conntrack/cleanup_test.go1
295:13range-value-address
pkg/proxy/conntrack/cleanup_test.go:295:13
for _, port := range []uint16{testServicePort, testNonServicePort} { entry := &netlink.ConntrackFlow{ FamilyType: unix.AF_INET,pkg/proxy/winkernel/proxier.go1
507:7receiver-naming
pkg/proxy/winkernel/proxier.go:507:7
func (ep *endpointInfo) DecrementRefCount() { klog.V(3).InfoS("Decrementing Endpoint RefCount", "endpointInfo", ep)pkg/proxy/conntrack/sysctls.go1
45:30redefines-builtin-id
pkg/proxy/conntrack/sysctls.go:45:30
// SetMax adjusts nf_conntrack_max. SetMax(ctx context.Context, max int) error // SetTCPEstablishedTimeout adjusts nf_conntrack_tcp_timeout_established.pkg/kubeapiserver/options/authentication_test.go1
1286:20redundant-conversion
pkg/kubeapiserver/options/authentication_test.go:1286:20
file: func() string { return "bogus-missing-file" }, expectErr: syscall.Errno(syscall.ENOENT).Error(), expectedConfig: nil,pkg/registry/batch/job/storage/storage_test.go1
186:2redundant-final-return
pkg/registry/batch/job/storage/storage_test.go:186:2
r.text = text return}pkg/proxy/config/api_test.go1
24:2redundant-import-alias
pkg/proxy/config/api_test.go:24:2
v1 "k8s.io/api/core/v1" discoveryv1 "k8s.io/api/discovery/v1"pkg/kubeapiserver/authorizer/config.go1
103:3single-case-switch
pkg/kubeapiserver/authorizer/config.go:103:3
// Keep cases in sync with constant list in k8s.io/kubernetes/pkg/kubeapiserver/authorizer/modes/modes.go. switch configuredAuthorizer.Type { case authzconfig.AuthorizerType(modes.ModeNode):pkg/kubeapiserver/authenticator/config.go1
265:6slice-preallocation
pkg/kubeapiserver/authenticator/config.go:265:6
}() var jwtAuthenticators []authenticator.Token var healthChecks []func() errorpkg/proxy/healthcheck/healthcheck_test.go1
396:31standard-http-method-constant
pkg/proxy/healthcheck/healthcheck_test.go:396:31
req, err := http.NewRequest("GET", "/healthz", nil) if err != nil {pkg/kubeapiserver/admission/initializer.go1
29:1task-comment
pkg/kubeapiserver/admission/initializer.go:29:1
// TODO add a `WantsToRun` which takes a stopCh. Might make it generic.pkg/kubeapiserver/authorizer/modes/modes_test.go1
21:6test-parallelism
pkg/kubeapiserver/authorizer/modes/modes_test.go:21:6
func TestIsValidAuthorizationMode(t *testing.T) { var tests = []struct {pkg/scheduler/backend/queue/backoff_queue_test.go1
108:45time-value-equality
pkg/scheduler/backend/queue/backoff_queue_test.go:108:45
bq := newBackoffQueue(clock.RealClock{}, tt.initialBackoffDuration, tt.maxBackoffDuration, convertLessFn(newDefaultQueueSort()), true) if got := bq.getBackoffTime(tt.podInfo); got != tt.want { t.Errorf("backoffQueue.getBackoffTime() = %v, want %v", got, tt.want)pkg/kubeapiserver/admission/initializer.go1
36:1top-level-declaration-order
pkg/kubeapiserver/admission/initializer.go:36:1
var _ admission.PluginInitializer = &PluginInitializer{}pkg/proxy/healthcheck/healthcheck_test.go1
153:13unchecked-type-assertion
pkg/proxy/healthcheck/healthcheck_test.go:153:13
hcsi := newServiceHealthServer("hostname", nil, listener, httpFactory, nodePortAddresses, proxyChecker, v1.IPv4Protocol) hcs := hcsi.(*server) if len(hcs.services) != 0 {pkg/kubeapiserver/default_storage_factory_builder.go1
112:81unexported-return
pkg/kubeapiserver/default_storage_factory_builder.go:112:81
// This method mutates the receiver (StorageFactoryConfig). It must never mutate the inputs.func (c *StorageFactoryConfig) Complete(etcdOptions *serveroptions.EtcdOptions) *completedStorageFactoryConfig { c.StorageConfig = etcdOptions.StorageConfigpkg/registry/authentication/tokenreview/storage.go1
80:39unnecessary-format
pkg/registry/authentication/tokenreview/storage.go:80:39
if len(tokenReview.Spec.Token) == 0 { return nil, apierrors.NewBadRequest(fmt.Sprintf("token is required for TokenReview in authentication")) }pkg/kubeapiserver/authorizer/reload.go1
248:50unused-parameter
pkg/kubeapiserver/authorizer/reload.go:248:50
func (r *reloadableAuthorizerResolver) checkFile(ctx context.Context) { r.lastLoadedLock.Lock()pkg/kubeapiserver/admission/config.go1
27:7unused-receiver
pkg/kubeapiserver/admission/config.go:27:7
// New sets up the plugins and admission start hooks needed for admissionfunc (c *Config) New() ([]admission.PluginInitializer, error) { return []admission.PluginInitializer{NewPluginInitializer()}, nilpkg/kubeapiserver/options/authentication.go1
624:23use-any
pkg/kubeapiserver/options/authentication.go:624:23
case len(o.ServiceAccounts.KeyFiles) > 0: allPublicKeys := []interface{}{} for _, keyfile := range o.ServiceAccounts.KeyFiles {pkg/kubeapiserver/authenticator/config.go1
382:15use-errors-new
pkg/kubeapiserver/authenticator/config.go:382:15
if publicKeysGetter == nil { return nil, fmt.Errorf("no public key getter provided") }pkg/proxy/conntrack/cleanup_test.go1
336:2use-slices-sort
pkg/proxy/conntrack/cleanup_test.go:336:2
// sort the actual flows before comparison sort.Slice(actualEntries, func(i, j int) bool { return actualEntries[i].String() < actualEntries[j].String()pkg/registry/core/service/allocator/utils.go1
26:18var-declaration
pkg/registry/core/service/allocator/utils.go:26:18
func countBits(n *big.Int) int { var count int = 0 for _, w := range n.Bits() {pkg/proxy/endpointschangetracker_test.go1
299:2var-naming
pkg/proxy/endpointschangetracker_test.go:299:2
} multipleSubsets_s1 := func(eps *discovery.EndpointSlice) { eps.Endpoints = []discovery.Endpoint{{pkg/kubeapiserver/default_storage_factory_builder.go1
84:63add-constant
pkg/kubeapiserver/default_storage_factory_builder.go:84:63
certificates.Resource("clustertrustbundles").WithVersion("v1beta1"), // TODO: remove in 1.38 certificates.Resource("podcertificaterequests").WithVersion("v1beta1"), storagemigration.Resource("storageversionmigrations").WithVersion("v1beta1"),pkg/registry/certificates/clustertrustbundle/strategy_test.go1
33:5boolean-literal-comparison
pkg/registry/certificates/clustertrustbundle/strategy_test.go:33:5
func TestAllowCreateOnUpdate(t *testing.T) { if Strategy.AllowCreateOnUpdate(context.Background()) != false { t.Errorf("Got true, want false")pkg/kubeapiserver/authenticator/config.go1
257:6cognitive-complexity
pkg/kubeapiserver/authenticator/config.go:257:6
func newJWTAuthenticator(serverLifecycle context.Context, config *apiserver.AuthenticationConfiguration, oidcSigningAlgs []string, apiAudiences authenticator.Audiences, disallowedIssuers []string, egressLookup egressselector.Lookup, apiServerID string) (_ *jwtAuthenticatorWithCancel, buildErr error) { ctx, cancel := context.WithCancel(serverLifecycle)pkg/proxy/conntrack/sysctls.go1
58:6confusing-naming
pkg/proxy/conntrack/sysctls.go:58:6
func setSysctls(ctx context.Context, ct conntrackConfigurer, config *kubeproxyconfig.KubeProxyConntrackConfiguration) error { max, err := getConntrackMax(ctx, config, detectNumCPU())pkg/registry/certificates/podcertificaterequest/storage/storage_test.go1
624:114confusing-results
pkg/registry/certificates/podcertificaterequest/storage/storage_test.go:624:114
func mustMakeEd25519KeyAndProof(t *testing.T, toBeSigned []byte) (ed25519.PrivateKey, ed25519.PublicKey, []byte, []byte) { pub, priv, err := ed25519.GenerateKey(rand.Reader)pkg/proxy/ipvs/ipset/ipset.go1
280:6constructor-interface-return
pkg/proxy/ipvs/ipset/ipset.go:280:6
// New returns a new Interface which will exec ipset.func New() Interface { return &runner{pkg/registry/core/pod/storage/eviction.go1
318:52context-as-argument
pkg/registry/core/pod/storage/eviction.go:318:52
func addConditionAndDeletePod(r *EvictionREST, ctx context.Context, name string, validation rest.ValidateObjectFunc, options *metav1.DeleteOptions) error { if !dryrun.IsDryRun(options.DryRun) {pkg/registry/certificates/certificates/strategy_test.go1
36:3context-stored-in-struct
pkg/registry/certificates/certificates/strategy_test.go:36:3
tests := map[string]struct { ctx context.Context obj runtime.Objectpkg/kubeapiserver/authorizer/config.go1
82:22cyclomatic-complexity
pkg/kubeapiserver/authorizer/config.go:82:22
// Note: the cel compiler construction depends on feature gates and the compatibility version to be initialized.func (config Config) New(ctx context.Context, serverID string) (authorizer.Authorizer, authorizer.RuleResolver, error) { if len(config.AuthorizationConfiguration.Authorizers) == 0 {pkg/scheduler/framework/runtime/batch_test.go1
105:3deep-exit
pkg/scheduler/framework/runtime/batch_test.go:105:3
if err != nil { log.Fatal("Couldn't register test.") }pkg/proxy/config/api_test.go1
222:8deprecated-api-usage
pkg/proxy/config/api_test.go:222:8
err = wait.PollImmediate(time.Millisecond*10, wait.ForeverTestTimeout, func() (bool, error) { epsHandler.lock.Lock()pkg/kubeapiserver/options/authentication_test.go1
1633:3discarded-error-result
pkg/kubeapiserver/options/authentication_test.go:1633:3
if err != nil { fmt.Println("Error creating public key file:", err) returnpkg/kubeapiserver/admission/config.go1
26:1doc-comment-period
pkg/kubeapiserver/admission/config.go:26:1
// New sets up the plugins and admission start hooks needed for admissionfunc (c *Config) New() ([]admission.PluginInitializer, error) {pkg/proxy/ipvs/ipset/ipset.go1
345:2early-return
pkg/proxy/ipvs/ipset/ipset.go:345:2
func (runner *runner) TestEntry(entry string, set string) (bool, error) { if out, err := runner.exec.Command(IPSetCmd, "test", set, entry).CombinedOutput(); err == nil { reg, e := regexp.Compile("is NOT in set " + set)pkg/proxy/conntrack/cleanup_test.go1
281:70empty-conditional-block
pkg/proxy/conntrack/cleanup_test.go:281:70
entriesBeforeCleanup = append(entriesBeforeCleanup, entry) if proto == unix.IPPROTO_UDP && dnatDest != testServingEndpointIP { // we do not expect UDP entries with DNATed destination address notpkg/proxy/util/nfacct/nfacct_others.go1
26:5error-naming
pkg/proxy/util/nfacct/nfacct_others.go:26:5
var unsupportedError = fmt.Errorf(runtime.GOOS + "/" + runtime.GOARCH + " is unsupported")pkg/kubeapiserver/options/admission_test.go1
41:12error-strings
pkg/kubeapiserver/options/admission_test.go:41:12
if len(options.Validate()) == 0 { t.Errorf("Expect error, but got none") }pkg/registry/core/service/portallocator/allocator.go1
47:6error-type-naming
pkg/registry/core/service/portallocator/allocator.go:47:6
type ErrNotInRange struct { ValidPorts stringpkg/registry/core/service/ipallocator/storage/storage_test.go1
90:2excessive-blank-identifiers
pkg/registry/core/service/ipallocator/storage/storage_test.go:90:2
func TestErrors(t *testing.T) { _, storage, _, _, destroyFunc := newStorage(t) defer destroyFunc()pkg/kubeapiserver/admission/exclusion/resources.go1
64:6exported-declaration-comment
pkg/kubeapiserver/admission/exclusion/resources.go:64:6
// should ignore.func Excluded() []schema.GroupResource { return slices.Clone(excluded)pkg/kubeapiserver/options/authentication_test.go1
1:1file-length-limit
pkg/kubeapiserver/options/authentication_test.go:1:1
/*Copyright 2018 The Kubernetes Authors.pkg/proxy/apis/config/fuzzer/fuzzer.go1
52:25flag-parameter
pkg/proxy/apis/config/fuzzer/fuzzer.go:52:25
// generateRandomCIDR is copied from pkg/apis/networking/fuzzer/fuzzer.gofunc generateRandomCIDR(is6 bool, c randfill.Continue) string { ip, err := netip.ParseAddr(generateRandomIP(is6, c))pkg/kubeapiserver/admission/exclusion/resources.go1
1:1format
pkg/kubeapiserver/admission/exclusion/resources.go:1:1
/*Copyright 2024 The Kubernetes Authors.- Fix (safe): run `strider fmt pkg/kubeapiserver/admission/exclusion/resources.go`
pkg/kubeapiserver/authorizer/config.go1
82:22function-length
pkg/kubeapiserver/authorizer/config.go:82:22
// Note: the cel compiler construction depends on feature gates and the compatibility version to be initialized.func (config Config) New(ctx context.Context, serverID string) (authorizer.Authorizer, authorizer.RuleResolver, error) { if len(config.AuthorizationConfiguration.Authorizers) == 0 {pkg/kubeapiserver/authorizer/reload.go1
95:40function-result-limit
pkg/kubeapiserver/authorizer/reload.go:95:40
func (r *reloadableAuthorizerResolver) RulesFor(ctx context.Context, user user.Info, namespace string) ([]authorizer.ResourceRuleInfo, []authorizer.NonResourceRuleInfo, bool, error) { return r.current.Load().ruleResolver.RulesFor(ctx, user, namespace)pkg/proxy/util/utils.go1
79:3identical-switch-branches
pkg/proxy/util/utils.go:79:3
ip = v.IP case *net.IPNet: ip = v.IPpkg/kubeapiserver/authorizer/config.go1
147:2import-shadowing
pkg/kubeapiserver/authorizer/config.go:147:2
// Construct the authorizers / ruleResolvers for the given configuration authorizer, ruleResolver, err := r.newForConfig(r.initialConfig.AuthorizationConfiguration) if err != nil {pkg/registry/autoscaling/horizontalpodautoscaler/storage/storage_test.go1
110:4increment-decrement
pkg/registry/autoscaling/horizontalpodautoscaler/storage/storage_test.go:110:4
object := obj.(*autoscaling.HorizontalPodAutoscaler) object.Spec.MaxReplicas = object.Spec.MaxReplicas + 1 return objectpkg/proxy/endpointslicecache.go1
248:4inefficient-map-lookup
pkg/proxy/endpointslicecache.go:248:4
if _, exists := endpointSet[endpointInfo.String()]; !exists || !terminating { endpointSet[endpointInfo.String()] = cache.makeEndpointInfo(endpointInfo, svcPortName) }pkg/proxy/iptables/number_generated_rules_test.go1
414:17inefficient-sprintf
pkg/proxy/iptables/number_generated_rules_test.go:414:17
{ Name: fmt.Sprintf("%d", epPort), Protocol: v1.ProtocolTCP,pkg/kubeapiserver/options/authentication_test.go1
98:24insecure-url-scheme
pkg/kubeapiserver/options/authentication_test.go:98:24
testSA: &ServiceAccountAuthenticationOptions{ Issuers: []string{"http://foo.bar.com"}, KeyFiles: []string{"testkeyfile1", "testkeyfile2"},pkg/proxy/serviceport.go1
35:18interface-method-limit
pkg/proxy/serviceport.go:35:18
// ServicePort is an interface which abstracts information about a service.type ServicePort interface { // String returns service string. An example format can be: `IP:Port/Protocol`.pkg/proxy/ipvs/proxier.go1
1660:7max-control-nesting
pkg/proxy/ipvs/proxier.go:1660:7
err = proxier.ipvs.UpdateRealServer(appliedVirtualServer, newDest) if err != nil { proxier.logger.Error(err, "Failed to update destination", "newDest", newDest)pkg/proxy/endpointslicecache_test.go1
512:6max-parameters
pkg/proxy/endpointslicecache_test.go:512:6
func generateEndpointSliceWithOffset(serviceName, namespace string, sliceNum, offset, numEndpoints, unreadyMod int, terminatingMod int, hosts []string, portNums []*int32) *discovery.EndpointSlice { endpointSlice := &discovery.EndpointSlice{pkg/kubeapiserver/options/authentication.go2
153:6max-public-structs
pkg/kubeapiserver/options/authentication.go:153:6
// WebHookAuthenticationOptions contains web hook authentication options for API Servertype WebHookAuthenticationOptions struct { ConfigFile string704:2modifies-parameter
pkg/kubeapiserver/options/authentication.go:704:2
authInfo.RequestHeaderConfig = authenticatorConfig.RequestHeaderConfig authInfo.APIAudiences = o.APIAudiencespkg/proxy/endpointslicecache.go1
329:2modifies-value-receiver
pkg/proxy/endpointslicecache.go:329:2
func (e byEndpoint) Swap(i, j int) { e[i], e[j] = e[j], e[i]}pkg/kubeapiserver/options/admission_test.go1
66:13nested-structs
pkg/kubeapiserver/options/admission_test.go:66:13
func TestComputeEnabledAdmission(t *testing.T) { tests := []struct { name stringpkg/proxy/ipvs/netlink_linux.go1
101:4nil-error-return
pkg/proxy/ipvs/netlink_linux.go:101:4
if ok { return nil }pkg/proxy/healthcheck/healthcheck_test.go1
84:2nil-value-with-nil-error
pkg/proxy/healthcheck/healthcheck_test.go:84:2
// Not implemented return nil, nil}pkg/registry/admissionregistration/mutatingadmissionpolicybinding/storage/storage_test.go1
62:3no-defer-in-loop
pkg/registry/admissionregistration/mutatingadmissionpolicybinding/storage/storage_test.go:62:3
defer server.Terminate(t) defer storage.Store.DestroyFunc() t.Run(b.Name, func(t *testing.T) {pkg/proxy/iptables/proxier_test.go1
727:6no-else-after-return
pkg/proxy/iptables/proxier_test.go:727:6
return false } else if chain.Rules[j].Comment != nil && strings.Contains(chain.Rules[j].Comment.Value, "must be the last rule") { return truepkg/proxy/apis/config/scheme/scheme.go1
35:6no-init
pkg/proxy/apis/config/scheme/scheme.go:35:6
func init() { AddToScheme(Scheme)pkg/proxy/iptables/proxier.go1
632:3no-naked-return
pkg/proxy/iptables/proxier.go:632:3
proxier.logger.V(2).Info("Not syncing iptables until Services and Endpoints have been received from master") return }pkg/kubeapiserver/admission/exclusion/resources.go1
45:5no-package-var
pkg/kubeapiserver/admission/exclusion/resources.go:45:5
// The version is omitted, all versions of the same GroupResource are treated the same.var excluded = []schema.GroupResource{ // BEGIN interception of these non-persisted resources may break the clusterpkg/kubeapiserver/options/authentication.go1
282:6optimize-operands-order
pkg/kubeapiserver/options/authentication.go:282:6
} if len(o.ServiceAccounts.KeyFiles) == 0 && o.ServiceAccounts.ExternalPublicKeysGetter == nil { allErrors = append(allErrors, errors.New("either `--service-account-key-file` or `--service-account-signing-endpoint` must be set"))pkg/registry/networking/ipaddress/strategy.go1
67:2overwritten-before-use
pkg/registry/networking/ipaddress/strategy.go:67:2
newIPAddress := obj.(*networking.IPAddress) oldIPAddress := old.(*networking.IPAddress)pkg/kubeapiserver/admission/exclusion/resources.go1
17:9package-comments
pkg/kubeapiserver/admission/exclusion/resources.go:17:9
package exclusionpkg/proxy/ipvs/util/ipvs.go1
19:9package-directory-mismatch
pkg/proxy/ipvs/util/ipvs.go:19:9
package ipvspkg/registry/core/node/storage/storage_test.go1
260:82possible-nil-dereference
pkg/registry/core/node/storage/storage_test.go:260:82
if location.Host != testCase.host { t.Errorf("Unexpected host: expected %v, but got %v", testCase.host, location.Host) }pkg/proxy/conntrack/cleanup_test.go1
295:13range-value-address
pkg/proxy/conntrack/cleanup_test.go:295:13
for _, port := range []uint16{testServicePort, testNonServicePort} { entry := &netlink.ConntrackFlow{ FamilyType: unix.AF_INET,pkg/proxy/winkernel/proxier.go1
519:7receiver-naming
pkg/proxy/winkernel/proxier.go:519:7
func (ep *endpointInfo) Cleanup() { klog.V(3).InfoS("Endpoint cleanup", "endpointInfo", ep)pkg/proxy/conntrack/sysctls.go1
59:2redefines-builtin-id
pkg/proxy/conntrack/sysctls.go:59:2
func setSysctls(ctx context.Context, ct conntrackConfigurer, config *kubeproxyconfig.KubeProxyConntrackConfiguration) error { max, err := getConntrackMax(ctx, config, detectNumCPU()) if err != nil {pkg/proxy/apis/config/v1alpha1/defaults.go1
89:11redundant-conversion
pkg/proxy/apis/config/v1alpha1/defaults.go:89:11
if obj.IPTables.MasqueradeBit == nil { temp := int32(14) obj.IPTables.MasqueradeBit = &temppkg/proxy/config/config.go1
26:2redundant-import-alias
pkg/proxy/config/config.go:26:2
v1 "k8s.io/api/core/v1" discoveryv1 "k8s.io/api/discovery/v1"pkg/kubeapiserver/authorizer/reload.go1
119:3single-case-switch
pkg/kubeapiserver/authorizer/reload.go:119:3
// Keep cases in sync with constant list in k8s.io/kubernetes/pkg/kubeapiserver/authorizer/modes/modes.go. switch configuredAuthorizer.Type { case authzconfig.AuthorizerType(modes.ModeNode):pkg/kubeapiserver/authenticator/config.go1
266:6slice-preallocation
pkg/kubeapiserver/authenticator/config.go:266:6
var jwtAuthenticators []authenticator.Token var healthChecks []func() error for _, jwtAuthenticator := range config.JWT {pkg/proxy/healthcheck/healthcheck_test.go1
897:30standard-http-method-constant
pkg/proxy/healthcheck/healthcheck_test.go:897:30
handler := hsTest.server.(*fakeHTTPServer).handler req, err := http.NewRequest("GET", string(hsTest.url), nil) if err != nil {pkg/kubeapiserver/authenticator/config.go1
268:3task-comment
pkg/kubeapiserver/authenticator/config.go:268:3
for _, jwtAuthenticator := range config.JWT { // TODO remove this CAContentProvider indirection var oidcCAContent oidc.CAContentProviderpkg/kubeapiserver/options/admission_test.go1
27:6test-parallelism
pkg/kubeapiserver/options/admission_test.go:27:6
func TestValidate(t *testing.T) { // 1. Both `--admission-control` and `--enable-admission-plugins` are specifiedpkg/scheduler/backend/queue/scheduling_queue_test.go1
3726:7time-value-equality
pkg/scheduler/backend/queue/scheduling_queue_test.go:3726:7
// Verify that flush didn't happen if actualEntity.GetFlushTimestamp() != firstFlushTime { t.Errorf("Expected FlushTimestamp to remain %v, but was updated to %v (pod was flushed prematurely)", firstFlushTime, actualEntity.GetFlushTimestamp())pkg/kubeapiserver/authenticator/config.go1
251:1top-level-declaration-order
pkg/kubeapiserver/authenticator/config.go:251:1
type jwtAuthenticatorWithCancel struct { jwtAuthenticator authenticator.Tokenpkg/proxy/healthcheck/healthcheck_test.go1
394:15unchecked-type-assertion
pkg/proxy/healthcheck/healthcheck_test.go:394:15
for _, h := range instance.httpServers { handler := h.(*fakeHTTPServer).handlerpkg/proxy/healthcheck/common.go1
59:55unexported-return
pkg/proxy/healthcheck/common.go:59:55
func (stdHTTPServerFactory) New(handler http.Handler) httpServer { return &http.Server{pkg/kubeapiserver/options/authentication_test.go2
1770:44unused-parameter
pkg/kubeapiserver/options/authentication_test.go:1770:44
func (d *dummyPublicKeyGetter) AddListener(listener serviceaccount.Listener) {}1770:7unused-receiver
pkg/kubeapiserver/options/authentication_test.go:1770:7
func (d *dummyPublicKeyGetter) AddListener(listener serviceaccount.Listener) {}pkg/proxy/apis/config/fuzzer/fuzzer.go1
82:53use-any
pkg/proxy/apis/config/fuzzer/fuzzer.go:82:53
// Funcs returns the fuzzer functions for the kube-proxy apis.func Funcs(codecs runtimeserializer.CodecFactory) []interface{} { return []interface{}{pkg/kubeapiserver/authenticator/config.go1
396:15use-errors-new
pkg/kubeapiserver/authenticator/config.go:396:15
if publicKeysGetter == nil { return nil, fmt.Errorf("no public key getter provided") }pkg/proxy/conntrack/cleanup_test.go1
340:2use-slices-sort
pkg/proxy/conntrack/cleanup_test.go:340:2
// sort the expected flows before comparison sort.Slice(entriesAfterCleanup, func(i, j int) bool { return entriesAfterCleanup[i].String() < entriesAfterCleanup[j].String()pkg/registry/core/service/storage/storage.go1
111:39var-declaration
pkg/registry/core/service/storage/storage.go:111:39
var primaryIPFamily api.IPFamily = serviceIPFamily var secondaryIPFamily api.IPFamily = "" // sentinel value if len(ipAllocs) > 1 {pkg/proxy/endpointschangetracker_test.go1
309:2var-naming
pkg/proxy/endpointschangetracker_test.go:309:2
} multipleSubsets_s2 := func(eps *discovery.EndpointSlice) { eps.Endpoints = []discovery.Endpoint{{pkg/kubeapiserver/default_storage_factory_builder.go1
89:48add-constant
pkg/kubeapiserver/default_storage_factory_builder.go:89:48
scheduling.Resource("workloads").WithVersion("v1alpha3"), scheduling.Resource("podgroups").WithVersion("v1alpha3"), scheduling.Resource("compositepodgroups").WithVersion("v1alpha3"),pkg/registry/certificates/clustertrustbundle/strategy_test.go1
45:5boolean-literal-comparison
pkg/registry/certificates/clustertrustbundle/strategy_test.go:45:5
func TestAllowUnconditionalUpdate(t *testing.T) { if Strategy.AllowUnconditionalUpdate(context.Background()) != false { t.Errorf("Got true, want false")pkg/kubeapiserver/authorizer/config.go1
82:22cognitive-complexity
pkg/kubeapiserver/authorizer/config.go:82:22
// Note: the cel compiler construction depends on feature gates and the compatibility version to be initialized.func (config Config) New(ctx context.Context, serverID string) (authorizer.Authorizer, authorizer.RuleResolver, error) { if len(config.AuthorizationConfiguration.Authorizers) == 0 {pkg/proxy/healthcheck/proxy_health.go1
93:6confusing-naming
pkg/proxy/healthcheck/proxy_health.go:93:6
func newProxyHealthServer(listener listener, httpServerFactory httpServerFactory, c clock.Clock, addr string, healthTimeout time.Duration, nodeManager nodeManager) *ProxyHealthServer { return &ProxyHealthServer{pkg/registry/certificates/podcertificaterequest/strategy_test.go1
484:114confusing-results
pkg/registry/certificates/podcertificaterequest/strategy_test.go:484:114
func mustMakeEd25519KeyAndProof(t *testing.T, toBeSigned []byte) (ed25519.PrivateKey, ed25519.PublicKey, []byte, []byte) { pub, priv, err := ed25519.GenerateKey(rand.Reader)pkg/proxy/ipvs/netlink_linux.go1
40:6constructor-interface-return
pkg/proxy/ipvs/netlink_linux.go:40:6
// NewNetLinkHandle will create a new NetLinkHandlefunc NewNetLinkHandle(isIPv6 bool) NetLinkHandle { return &netlinkHandle{netlink.Handle{}, isIPv6}pkg/registry/core/pod/storage/eviction.go1
375:34context-as-argument
pkg/registry/core/pod/storage/eviction.go:375:34
func getPod(r *EvictionREST, ctx context.Context, name string) (*api.Pod, error) { obj, err := r.store.Get(ctx, name, &metav1.GetOptions{})pkg/registry/core/pod/rest/authorize_test.go1
44:3context-stored-in-struct
pkg/registry/core/pod/rest/authorize_test.go:44:3
name string ctx context.Context authorizer authorizer.UnconditionalAuthorizerpkg/kubeapiserver/authorizer/reload.go1
100:40cyclomatic-complexity
pkg/kubeapiserver/authorizer/reload.go:100:40
// newForConfig constructsfunc (r *reloadableAuthorizerResolver) newForConfig(authzConfig *authzconfig.AuthorizationConfiguration) (authorizer.Authorizer, authorizer.RuleResolver, error) { if len(authzConfig.Authorizers) == 0 {pkg/scheduler/framework/runtime/batch_test.go1
109:3deep-exit
pkg/scheduler/framework/runtime/batch_test.go:109:3
if err != nil { log.Fatal("Couldn't register test.") }pkg/proxy/ipvs/ipset/testing/fake.go1
35:21deprecated-api-usage
pkg/proxy/ipvs/ipset/testing/fake.go:35:21
// The key of Entries map is the ip set name where the entries exists Entries map[string]sets.String}pkg/kubeapiserver/options/authentication_test.go1
1647:3discarded-error-result
pkg/kubeapiserver/options/authentication_test.go:1647:3
if err := pem.Encode(publicKeyFile, publicKeyBlock); err != nil { fmt.Println("Error encoding public key:", err) returnpkg/kubeapiserver/admission/initializer.go1
38:1doc-comment-period
pkg/kubeapiserver/admission/initializer.go:38:1
// NewPluginInitializer constructs new instance of PluginInitializerfunc NewPluginInitializer() *PluginInitializer {pkg/proxy/servicechangetracker_test.go1
96:3early-return
pkg/proxy/servicechangetracker_test.go:96:3
for _, s := range cidrStr { if _, n, err := netutils.ParseCIDRSloppy(s); err == nil { cidrs = append(cidrs, n)pkg/registry/batch/job/strategy.go1
207:12empty-conditional-block
pkg/registry/batch/job/strategy.go:207:12
_, found := obj.Spec.Template.Labels[value] if found { // User asked us to automatically generate a selector, but set manual labels.pkg/kubeapiserver/options/admission_test.go1
48:12error-strings
pkg/kubeapiserver/options/admission_test.go:48:12
if len(options.Validate()) == 0 { t.Errorf("Expect error, but got none") }pkg/registry/core/service/portallocator/storage/storage_test.go1
85:2excessive-blank-identifiers
pkg/registry/core/service/portallocator/storage/storage_test.go:85:2
func TestEmpty(t *testing.T) { _, storage, _, _, destroyFunc := newStorage(t) defer destroyFunc()pkg/kubeapiserver/admission/initializer.go1
47:29exported-declaration-comment
pkg/kubeapiserver/admission/initializer.go:47:29
// and provide the appropriate initialization datafunc (i *PluginInitializer) Initialize(plugin admission.Interface) { if wants, ok := plugin.(initializer.WantsManifestLoaders); ok {pkg/proxy/apis/config/validation/validation_test.go1
1:1file-length-limit
pkg/proxy/apis/config/validation/validation_test.go:1:1
/*Copyright 2017 The Kubernetes Authors.pkg/proxy/endpointschangetracker.go1
81:96flag-parameter
pkg/proxy/endpointschangetracker.go:81:96
// ServiceChangeTracker.Update().func (ect *EndpointsChangeTracker) EndpointSliceUpdate(endpointSlice *discovery.EndpointSlice, removeSlice bool) bool { if endpointSlice.AddressType != ect.addressType {pkg/kubeapiserver/admission/initializer.go1
1:1format
pkg/kubeapiserver/admission/initializer.go:1:1
/*Copyright 2016 The Kubernetes Authors.- Fix (safe): run `strider fmt pkg/kubeapiserver/admission/initializer.go`
pkg/kubeapiserver/authorizer/reload.go1
100:40function-length
pkg/kubeapiserver/authorizer/reload.go:100:40
// newForConfig constructsfunc (r *reloadableAuthorizerResolver) newForConfig(authzConfig *authzconfig.AuthorizationConfiguration) (authorizer.Authorizer, authorizer.RuleResolver, error) { if len(authzConfig.Authorizers) == 0 {pkg/proxy/topology.go1
48:6function-result-limit
pkg/proxy/topology.go:48:6
// types or labels, ensure the filtering logic in NodeTopologyConfig is updated accordingly.func CategorizeEndpoints(endpoints []Endpoint, svcInfo ServicePort, nodeName string, topologyLabels map[string]string) (clusterEndpoints, localEndpoints, allReachableEndpoints []Endpoint, hasAnyEndpoints bool) { if len(endpoints) == 0 {pkg/kubeapiserver/authorizer/reload.go1
77:2import-shadowing
pkg/kubeapiserver/authorizer/reload.go:77:2
type authorizerResolver struct { authorizer authorizer.Authorizer ruleResolver authorizer.RuleResolverpkg/registry/core/service/storage/transaction_test.go1
37:6increment-decrement
pkg/registry/core/service/storage/transaction_test.go:37:6
commit: func() { temp = temp + 1 },pkg/proxy/endpointslicecache.go1
263:29inefficient-map-lookup
pkg/proxy/endpointslicecache.go:263:29
if _, ok := cache.trackerByServiceMap[serviceKey]; ok { appliedData, appliedOk := cache.trackerByServiceMap[serviceKey].applied[sliceKey] pendingData, pendingOk := cache.trackerByServiceMap[serviceKey].pending[sliceKey]pkg/proxy/iptables/proxier_test.go1
1353:83inefficient-sprintf
pkg/proxy/iptables/proxier_test.go:1353:83
} matches, output, masq := tracePacket(t, ipt, tc.sourceIP, protocol, tc.destIP, fmt.Sprintf("%d", tc.destPort), nodeIPs) var errors []stringpkg/kubeapiserver/options/authentication_test.go1
113:23insecure-url-scheme
pkg/kubeapiserver/options/authentication_test.go:113:23
testSA: &ServiceAccountAuthenticationOptions{ Issuers: []string{"http://foo.bar.com"}, },pkg/proxy/types.go1
28:15interface-method-limit
pkg/proxy/types.go:28:15
// Provider is the interface provided by proxier implementations.type Provider interface { config.EndpointSliceHandlerpkg/scheduler/backend/queue/scheduling_queue_test.go1
2393:8max-control-nesting
pkg/scheduler/backend/queue/scheduling_queue_test.go:2393:8
for k := 0; k < len(plugins); k++ { if (k+1)%(j+1) == 0 { m[""][events[j]] = append(m[""][events[j]], &QueueingHintFunction{pkg/proxy/iptables/proxier.go1
94:6max-parameters
pkg/proxy/iptables/proxier.go:94:6
// NewDualStackProxier creates a MetaProxier instance, with IPv4 and IPv6 proxies.func NewDualStackProxier( ctx context.Context,pkg/proxy/apis/config/types.go1
90:6max-public-structs
pkg/proxy/apis/config/types.go:90:6
// the Kubernetes proxy server.type KubeProxyConntrackConfiguration struct { // maxPerCore is the maximum number of NAT connections to trackpkg/kubeapiserver/options/authentication.go1
705:2modifies-parameter
pkg/kubeapiserver/options/authentication.go:705:2
authInfo.RequestHeaderConfig = authenticatorConfig.RequestHeaderConfig authInfo.APIAudiences = o.APIAudiences if o.ServiceAccounts != nil && len(o.ServiceAccounts.Issuers) != 0 && len(o.APIAudiences) == 0 {pkg/proxy/endpointslicecache.go1
329:8modifies-value-receiver
pkg/proxy/endpointslicecache.go:329:8
func (e byEndpoint) Swap(i, j int) { e[i], e[j] = e[j], e[i]}pkg/kubeapiserver/options/authentication_test.go1
59:17nested-structs
pkg/kubeapiserver/options/authentication_test.go:59:17
func TestAuthenticationValidate(t *testing.T) { testCases := []struct { name stringpkg/registry/core/service/allocator/storage/storage.go1
100:4nil-error-return
pkg/registry/core/service/allocator/storage/storage.go:100:4
if err == errorUnableToAllocate { return false, nil }pkg/proxy/iptables/proxier.go1
121:3nil-value-with-nil-error
pkg/proxy/iptables/proxier.go:121:3
if initOnly { return nil, nil }pkg/registry/admissionregistration/validatingadmissionpolicybinding/storage/storage_test.go1
61:3no-defer-in-loop
pkg/registry/admissionregistration/validatingadmissionpolicybinding/storage/storage_test.go:61:3
storage, server := newInsecureStorage(t) defer server.Terminate(t) defer storage.Store.DestroyFunc()pkg/proxy/ipvs/ipset/ipset.go1
349:5no-else-after-return
pkg/proxy/ipvs/ipset/ipset.go:349:5
return false, nil } else if e == nil { return true, nilpkg/proxy/apis/config/v1alpha1/register.go1
38:6no-init
pkg/proxy/apis/config/v1alpha1/register.go:38:6
func init() { // We only register manually written functions here. The registration of thepkg/proxy/iptables/proxier.go1
689:5no-naked-return
pkg/proxy/iptables/proxier.go:689:5
proxier.logger.Error(err, "Failed to ensure chain exists", "table", jump.table, "chain", jump.dstChain) return }pkg/kubeapiserver/authorizer/config.go1
165:5no-package-var
pkg/kubeapiserver/authorizer/config.go:165:5
// RepeatableAuthorizerTypes is the list of Authorizer that can be repeated in the Authorization Configvar repeatableAuthorizerTypes = []string{modes.ModeWebhook}pkg/kubeapiserver/options/authentication.go1
307:6optimize-operands-order
pkg/kubeapiserver/options/authentication.go:307:6
if o.ClientCert != nil && len(o.ClientCert.ClientCA) > 0 &&pkg/registry/node/runtimeclass/strategy.go1
64:2overwritten-before-use
pkg/registry/node/runtimeclass/strategy.go:64:2
func (strategy) PrepareForUpdate(ctx context.Context, obj, old runtime.Object) { newRuntimeClass := obj.(*node.RuntimeClass) oldRuntimeClass := old.(*node.RuntimeClass)pkg/kubeapiserver/admission/initializer.go1
17:9package-comments
pkg/kubeapiserver/admission/initializer.go:17:9
package admissionpkg/proxy/ipvs/util/ipvs_linux.go1
19:9package-directory-mismatch
pkg/proxy/ipvs/util/ipvs_linux.go:19:9
package ipvspkg/registry/core/pod/storage/storage_test.go1
398:15possible-nil-dereference
pkg/registry/core/pod/storage/storage_test.go:398:15
if location.Scheme != "" { t.Errorf("Expected '%v', but got '%v'", "", location.Scheme)pkg/proxy/conntrack/sysctls_test.go1
228:10range-value-address
pkg/proxy/conntrack/sysctls_test.go:228:10
t.Run(test.name, func(t *testing.T) { fc := &fakeConntracker{err: test.conntrackErr} err := setSysctls(ctx, fc, &test.config)pkg/proxy/winkernel/proxier.go1
884:7receiver-naming
pkg/proxy/winkernel/proxier.go:884:7
func (svcInfo *serviceInfo) cleanupAllPolicies(endpoints []proxy.Endpoint, mapStaleLoadbalancers map[string]loadBalancerType, isEndpointChange bool, ipFamilyStr string) { klog.V(3).InfoS("Service cleanup", "serviceInfo", svcInfo)pkg/proxy/conntrack/sysctls.go1
146:64redefines-builtin-id
pkg/proxy/conntrack/sysctls.go:146:64
func (rct realConntrackConfigurer) SetMax(ctx context.Context, max int) error { logger := klog.FromContext(ctx)pkg/proxy/apis/config/v1alpha1/defaults.go1
93:11redundant-conversion
pkg/proxy/apis/config/v1alpha1/defaults.go:93:11
if obj.NFTables.MasqueradeBit == nil { temp := int32(14) obj.NFTables.MasqueradeBit = &temppkg/proxy/config/config_test.go1
37:2redundant-import-alias
pkg/proxy/config/config_test.go:37:2
"k8s.io/apimachinery/pkg/watch" informers "k8s.io/client-go/informers" "k8s.io/client-go/kubernetes/fake"pkg/kubeapiserver/authorizer/reload.go1
164:4single-case-switch
pkg/kubeapiserver/authorizer/reload.go:164:4
var decisionOnError authorizer.Decision switch configuredAuthorizer.Webhook.FailurePolicy { case authzconfig.FailurePolicyNoOpinion:pkg/proxy/apis/config/validation/validation.go1
296:2slice-preallocation
pkg/proxy/apis/config/validation/validation.go:296:2
func validateShowHiddenMetricsVersion(version string, fldPath *field.Path) field.ErrorList { allErrs := field.ErrorList{} errs := metrics.ValidateShowHiddenMetricsVersion(version)pkg/scheduler/extender.go1
407:30standard-http-method-constant
pkg/scheduler/extender.go:407:30
req, err := http.NewRequest("POST", url, bytes.NewReader(out)) if err != nil {pkg/kubeapiserver/authenticator/config.go1
347:3task-comment
pkg/kubeapiserver/authenticator/config.go:347:3
} // TODO maybe track requests so we know when this is safe to do oldJWTAuthenticator.cancel()pkg/kubeapiserver/options/admission_test.go1
65:6test-parallelism
pkg/kubeapiserver/options/admission_test.go:65:6
func TestComputeEnabledAdmission(t *testing.T) { tests := []struct {pkg/scheduler/backend/queue/scheduling_queue_test.go1
3927:136time-value-equality
pkg/scheduler/backend/queue/scheduling_queue_test.go:3927:136
} if !test.expectPreservedTimestamp && (test.expectedInActiveQ || test.expectedInBackoffQ || test.expectedInUnschedulableEntities) && pgInfo.Timestamp != c.Now() { tCtx.Errorf("Expected timestamp to be %v, but got %v", c.Now(), pgInfo.Timestamp)pkg/kubeapiserver/authorizer/config.go1
165:1top-level-declaration-order
pkg/kubeapiserver/authorizer/config.go:165:1
// RepeatableAuthorizerTypes is the list of Authorizer that can be repeated in the Authorization Configvar repeatableAuthorizerTypes = []string{modes.ModeWebhook}pkg/proxy/healthcheck/healthcheck_test.go2
896:26unchecked-type-assertion
pkg/proxy/healthcheck/healthcheck_test.go:896:26
t.Helper() handler := hsTest.server.(*fakeHTTPServer).handler req, err := http.NewRequest("GET", string(hsTest.url), nil)103:62unexported-return
pkg/proxy/healthcheck/healthcheck_test.go:103:62
func (fake *fakeHTTPServerFactory) New(handler http.Handler) httpServer { return &fakeHTTPServer{pkg/kubeapiserver/options/authentication_test.go2
1776:46unused-parameter
pkg/kubeapiserver/options/authentication_test.go:1776:46
func (d *dummyPublicKeyGetter) GetPublicKeys(ctx context.Context, keyIDHint string) []serviceaccount.PublicKey { return []serviceaccount.PublicKey{}1772:7unused-receiver
pkg/kubeapiserver/options/authentication_test.go:1772:7
func (d *dummyPublicKeyGetter) GetCacheAgeMaxSeconds() int { return 10pkg/proxy/apis/config/fuzzer/fuzzer.go1
83:11use-any
pkg/proxy/apis/config/fuzzer/fuzzer.go:83:11
func Funcs(codecs runtimeserializer.CodecFactory) []interface{} { return []interface{}{ func(obj *kubeproxyconfig.KubeProxyConfiguration, c randfill.Continue) {pkg/kubeapiserver/authorizer/config.go1
84:20use-errors-new
pkg/kubeapiserver/authorizer/config.go:84:20
if len(config.AuthorizationConfiguration.Authorizers) == 0 { return nil, nil, fmt.Errorf("at least one authorization mode must be passed") }pkg/proxy/conntrack/cleanup_test.go1
556:2use-slices-sort
pkg/proxy/conntrack/cleanup_test.go:556:2
// sort the actual flows before comparison sort.Slice(actualEntries, func(i, j int) bool { return actualEntries[i].String() < actualEntries[j].String()pkg/proxy/endpointschangetracker_test.go1
319:2var-naming
pkg/proxy/endpointschangetracker_test.go:319:2
} multipleSubsetsWithLocal_s1 := func(eps *discovery.EndpointSlice) { eps.Endpoints = []discovery.Endpoint{{pkg/kubeapiserver/default_storage_factory_builder.go1
142:55add-constant
pkg/kubeapiserver/default_storage_factory_builder.go:142:55
storageFactory.AddCohabitatingResources(apps.Resource("replicasets"), extensions.Resource("replicasets")) storageFactory.AddCohabitatingResources(api.Resource("events"), events.Resource("events")) storageFactory.AddCohabitatingResources(api.Resource("replicationcontrollers"), extensions.Resource("replicationcontrollers")) // to make scale subresources equivalentpkg/registry/certificates/podcertificaterequest/strategy_test.go1
51:5boolean-literal-comparison
pkg/registry/certificates/podcertificaterequest/strategy_test.go:51:5
strategy := NewStrategy() if strategy.AllowCreateOnUpdate(context.Background()) != false { t.Errorf("Got true, want false")pkg/kubeapiserver/authorizer/config.go1
185:6cognitive-complexity
pkg/kubeapiserver/authorizer/config.go:185:6
func LoadAndValidateData(data []byte, compiler authorizationcel.Compiler, requireNonWebhookTypes sets.Set[authzconfig.AuthorizerType]) (*authzconfig.AuthorizationConfiguration, error) { // load the file and check for errorspkg/proxy/healthcheck/service_health.go1
101:6confusing-naming
pkg/proxy/healthcheck/service_health.go:101:6
// NewServiceHealthServer allocates a new service healthcheck server managerfunc NewServiceHealthServer(nodeName string, recorder events.EventRecorder, nodePortAddresses *proxyutil.NodePortAddresses, healthzServer proxyHealthChecker, serviceFamily v1.IPFamily) ServiceHealthServer { return newServiceHealthServer(nodeName, recorder, stdNetListener{}, stdHTTPServerFactory{}, nodePortAddresses, healthzServer, serviceFamily)pkg/scheduler/backend/cache/snapshot_test.go1
1159:68confusing-results
pkg/scheduler/backend/cache/snapshot_test.go:1159:68
// simplifySnapshot for comparison in unit testsfunc simplifySnapshot(s *Snapshot) (map[string][]string, []string, []string, []string, map[string]int, map[string][]string) { nodeInfoMap := make(map[string][]string)pkg/proxy/ipvs/util/ipvs_linux.go1
45:6constructor-interface-return
pkg/proxy/ipvs/util/ipvs_linux.go:45:6
// New returns a new Interface which will call ipvs APIs.func New() Interface { handle, err := libipvs.New("")pkg/scheduler/backend/queue/scheduling_queue_test.go1
6035:50context-as-argument
pkg/scheduler/backend/queue/scheduling_queue_test.go:6035:50
func setupInitialPodGroupState(t *testing.T, ctx context.Context, q *PriorityQueue, initialPods []*v1.Pod, initialState initialQueueState, initialPodGroup *schedulingv1alpha3.PodGroup) { t.Helper()pkg/kubeapiserver/options/authentication.go1
248:40cyclomatic-complexity
pkg/kubeapiserver/options/authentication.go:248:40
// Validate checks invalid config combinationfunc (o *BuiltInAuthenticationOptions) Validate() []error { if o == nil {pkg/scheduler/framework/runtime/batch_test.go1
113:3deep-exit
pkg/scheduler/framework/runtime/batch_test.go:113:3
if err != nil { log.Fatal("Couldn't register test.") }pkg/proxy/ipvs/ipset/testing/fake.go1
43:28deprecated-api-usage
pkg/proxy/ipvs/ipset/testing/fake.go:43:28
Sets: make(map[string]*ipset.IPSet), Entries: make(map[string]sets.String), }pkg/proxy/config/config.go1
85:28discarded-error-result
pkg/proxy/config/config.go:85:28
handlerRegistration, _ := endpointSliceInformer.Informer().AddEventHandlerWithResyncPeriod( cache.ResourceEventHandlerFuncs{pkg/kubeapiserver/admission/initializer.go1
45:1doc-comment-period
pkg/kubeapiserver/admission/initializer.go:45:1
// Initialize checks the initialization interfaces implemented by each plugin// and provide the appropriate initialization datapkg/proxy/winkernel/proxier.go1
213:2early-return
pkg/proxy/winkernel/proxier.go:213:2
klog.V(3).InfoS("HNS Supported features", "hnsSupportedFeatures", supportedFeatures) if supportedFeatures.Api.V2 { h = hns{pkg/registry/batch/job/strategy.go1
220:12empty-conditional-block
pkg/registry/batch/job/strategy.go:220:12
_, found := obj.Spec.Template.Labels[value] if found { // User asked us to automatically generate a selector, but set manual labels.pkg/kubeapiserver/options/admission_test.go1
55:12error-strings
pkg/kubeapiserver/options/admission_test.go:55:12
if errs := options.Validate(); len(errs) > 0 { t.Errorf("Unexpected err: %v", errs) }pkg/scheduler/backend/cache/snapshot_test.go1
1651:5excessive-blank-identifiers
pkg/scheduler/backend/cache/snapshot_test.go:1651:5
if tt.expectedPodGroups != nil { _, _, _, _, _, gotPGStates := simplifySnapshot(s) if diff := cmp.Diff(tt.expectedPodGroups, gotPGStates); diff != "" {pkg/kubeapiserver/authenticator/config.go1
107:22exported-declaration-comment
pkg/kubeapiserver/authenticator/config.go:107:22
// Kubernetes authentication mechanisms.func (config Config) New(serverLifecycle context.Context) (authenticator.Request, func(context.Context, *apiserver.AuthenticationConfiguration) error, *spec.SecurityDefinitions, spec3.SecuritySchemes, error) { var authenticators []authenticator.Requestpkg/proxy/config/config.go1
1:1file-length-limit
pkg/proxy/config/config.go:1:1
/*Copyright 2014 The Kubernetes Authors.pkg/proxy/healthcheck/healthcheck_test.go1
391:81flag-parameter
pkg/proxy/healthcheck/healthcheck_test.go:391:81
func tHandler(hcs *server, nsn types.NamespacedName, status int, endpoints int, kubeProxyHealthy bool, t *testing.T) { instance := hcs.services[nsn]pkg/kubeapiserver/authenticator/config.go1
1:1format
pkg/kubeapiserver/authenticator/config.go:1:1
/*Copyright 2014 The Kubernetes Authors.- Fix (safe): run `strider fmt pkg/kubeapiserver/authenticator/config.go`
pkg/kubeapiserver/options/authentication.go1
248:40function-length
pkg/kubeapiserver/options/authentication.go:248:40
// Validate checks invalid config combinationfunc (o *BuiltInAuthenticationOptions) Validate() []error { if o == nil {pkg/registry/apps/deployment/storage/storage.go1
94:6function-result-limit
pkg/registry/apps/deployment/storage/storage.go:94:6
// NewREST returns a RESTStorage object that will work against deployments.func NewREST(optsGetter generic.RESTOptionsGetter) (*REST, *StatusREST, *RollbackREST, error) { store := &genericregistry.Store{pkg/kubeapiserver/authorizer/reload.go1
95:70import-shadowing
pkg/kubeapiserver/authorizer/reload.go:95:70
func (r *reloadableAuthorizerResolver) RulesFor(ctx context.Context, user user.Info, namespace string) ([]authorizer.ResourceRuleInfo, []authorizer.NonResourceRuleInfo, bool, error) { return r.current.Load().ruleResolver.RulesFor(ctx, user, namespace)pkg/registry/core/service/storage/transaction_test.go1
40:6increment-decrement
pkg/registry/core/service/storage/transaction_test.go:40:6
revert: func() { temp = temp - 1 },pkg/proxy/endpointslicecache.go1
264:29inefficient-map-lookup
pkg/proxy/endpointslicecache.go:264:29
appliedData, appliedOk := cache.trackerByServiceMap[serviceKey].applied[sliceKey] pendingData, pendingOk := cache.trackerByServiceMap[serviceKey].pending[sliceKey]pkg/proxy/ipvs/ipset/ipset.go1
233:10inefficient-sprintf
pkg/proxy/ipvs/ipset/ipset.go:233:10
// Entry{192.168.1.1} -> 192.168.1.1 return fmt.Sprintf("%s", e.IP) case HashIPPort:pkg/kubeapiserver/options/authentication_test.go1
155:23insecure-url-scheme
pkg/kubeapiserver/options/authentication_test.go:155:23
testSA: &ServiceAccountAuthenticationOptions{ Issuers: []string{"http://foo.bar.com", "http://foo.bar.com"}, },pkg/registry/flowcontrol/ensurer/strategy.go1
99:26interface-method-limit
pkg/registry/flowcontrol/ensurer/strategy.go:99:26
// configurationObject is the relevant interfaces that each API object type implementstype configurationObject interface { metav1.Objectpkg/scheduler/backend/queue/scheduling_queue_test.go1
2422:14max-control-nesting
pkg/scheduler/backend/queue/scheduling_queue_test.go:2422:14
podInfo = q.newQueuedPodInfo(ctx, p) } else if tt.name == "worst" { // Each pod failed by all plugins.pkg/proxy/iptables/proxier.go1
209:6max-parameters
pkg/proxy/iptables/proxier.go:209:6
// NewProxier returns a new single-stack IPTables proxier.func NewProxier(ctx context.Context, config *kubeproxyconfig.KubeProxyConfiguration,pkg/proxy/apis/config/types.go1
120:6max-public-structs
pkg/proxy/apis/config/types.go:120:6
// the Kubernetes proxy server.type KubeProxyWinkernelConfiguration struct { // networkName is the name of the network kube-proxy will usepkg/kubeapiserver/options/authentication.go1
707:3modifies-parameter
pkg/kubeapiserver/options/authentication.go:707:3
if o.ServiceAccounts != nil && len(o.ServiceAccounts.Issuers) != 0 && len(o.APIAudiences) == 0 { authInfo.APIAudiences = authenticator.Audiences(o.ServiceAccounts.Issuers) }pkg/proxy/ipvs/util/testing/fake.go1
69:2modifies-value-receiver
pkg/proxy/ipvs/util/testing/fake.go:69:2
func (a byAddress) Swap(i, j int) { a[i], a[j] = a[j], a[i]}pkg/kubeapiserver/options/authentication_test.go1
543:17nested-structs
pkg/kubeapiserver/options/authentication_test.go:543:17
func TestToAuthenticationConfig_Anonymous(t *testing.T) { testCases := []struct { name stringpkg/registry/core/service/allocator/storage/storage.go1
129:4nil-error-return
pkg/registry/core/service/allocator/storage/storage.go:129:4
if err == errorUnableToAllocate { return offset, false, nil }pkg/proxy/iptables/proxier.go1
248:3nil-value-with-nil-error
pkg/proxy/iptables/proxier.go:248:3
logger.Info("System initialized and --init-only specified") return nil, nil }pkg/registry/admissionregistration/validatingadmissionpolicybinding/storage/storage_test.go1
62:3no-defer-in-loop
pkg/registry/admissionregistration/validatingadmissionpolicybinding/storage/storage_test.go:62:3
defer server.Terminate(t) defer storage.Store.DestroyFunc() t.Run(b.Name, func(t *testing.T) {pkg/proxy/ipvs/ipset/ipset.go1
351:5no-else-after-return
pkg/proxy/ipvs/ipset/ipset.go:351:5
return true, nil } else { return false, fmt.Errorf("error testing entry: %s, error: %v", entry, e)pkg/registry/certificates/certificates/storage/metrics.go1
69:6no-init
pkg/registry/certificates/certificates/storage/metrics.go:69:6
func init() { registerMetricsOnce.Do(func() {pkg/proxy/iptables/proxier.go1
698:5no-naked-return
pkg/proxy/iptables/proxier.go:698:5
proxier.logger.Error(err, "Failed to ensure chain jumps", "table", jump.table, "srcChain", jump.srcChain, "dstChain", jump.dstChain) return }pkg/kubeapiserver/authorizer/modes/modes.go1
37:5no-package-var
pkg/kubeapiserver/authorizer/modes/modes.go:37:5
// AuthorizationModeChoices is the list of supported authorization modesvar AuthorizationModeChoices = []string{ModeAlwaysAllow, ModeAlwaysDeny, ModeABAC, ModeWebhook, ModeRBAC, ModeNode}pkg/kubeapiserver/options/authentication.go1
307:6optimize-operands-order
pkg/kubeapiserver/options/authentication.go:307:6
if o.ClientCert != nil && len(o.ClientCert.ClientCA) > 0 &&pkg/registry/node/runtimeclass/strategy.go1
65:2overwritten-before-use
pkg/registry/node/runtimeclass/strategy.go:65:2
newRuntimeClass := obj.(*node.RuntimeClass) oldRuntimeClass := old.(*node.RuntimeClass)pkg/kubeapiserver/authenticator/config.go1
17:9package-comments
pkg/kubeapiserver/authenticator/config.go:17:9
package authenticatorpkg/proxy/ipvs/util/ipvs_linux_test.go1
19:9package-directory-mismatch
pkg/proxy/ipvs/util/ipvs_linux_test.go:19:9
package ipvspkg/registry/core/pod/storage/storage_test.go1
399:57possible-nil-dereference
pkg/registry/core/pod/storage/storage_test.go:399:57
if location.Scheme != "" { t.Errorf("Expected '%v', but got '%v'", "", location.Scheme) }pkg/proxy/conntrack/sysctls_test.go1
229:31range-value-address
pkg/proxy/conntrack/sysctls_test.go:229:31
fc := &fakeConntracker{err: test.conntrackErr} err := setSysctls(ctx, fc, &test.config) if test.wantErr && err == nil {pkg/proxy/winkernel/proxier.go1
912:7receiver-naming
pkg/proxy/winkernel/proxier.go:912:7
func (svcInfo *serviceInfo) deleteLoadBalancerPolicy(mapStaleLoadbalancer map[string]loadBalancerType, ipFamilyStr string) { // Remove the Hns Policy corresponding to this servicepkg/proxy/conntrack/sysctls_test.go1
42:3redefines-builtin-id
pkg/proxy/conntrack/sysctls_test.go:42:3
testCases := []struct { min int32 maxPerCore int32pkg/proxy/apis/config/v1alpha1/defaults_test.go1
34:14redundant-conversion
pkg/proxy/apis/config/v1alpha1/defaults_test.go:34:14
func TestDefaultsKubeProxyConfiguration(t *testing.T) { oomScore := int32(-999) ctMaxPerCore := int32(32768)pkg/proxy/conntrack/cleanup.go1
30:2redundant-import-alias
pkg/proxy/conntrack/cleanup.go:30:2
v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/util/sets"pkg/kubeapiserver/options/authentication.go1
589:3single-case-switch
pkg/kubeapiserver/options/authentication.go:589:3
if o.Anonymous != nil { switch { case ret.AuthenticationConfig.Anonymous != nil && o.Anonymous.FlagsSet:pkg/proxy/conntrack/cleanup_test.go1
252:6slice-preallocation
pkg/proxy/conntrack/cleanup_test.go:252:6
// {entriesBeforeCleanup} - {entriesAfterCleanup} = entries cleared by conntrack reconciler var entriesBeforeCleanup []*netlink.ConntrackFlow // entriesBeforeCleanup - entriesAfterCleanup = entries cleared by conntrack reconcilerpkg/scheduler/metrics/resources/resources_test.go1
90:30standard-http-method-constant
pkg/scheduler/metrics/resources/resources_test.go:90:30
r := httptest.NewRecorder() req, err := http.NewRequest("GET", "/metrics/resources", nil) if err != nil {pkg/kubeapiserver/default_storage_factory_builder.go1
80:3task-comment
pkg/kubeapiserver/default_storage_factory_builder.go:80:3
// // TODO (https://github.com/kubernetes/kubernetes/issues/108451): remove the override in 1.25. // apisstorage.Resource("csistoragecapacities").WithVersion("v1beta1"),pkg/kubeapiserver/options/admission_test.go1
87:18test-parallelism
pkg/kubeapiserver/options/admission_test.go:87:18
for _, tc := range tests { t.Run(tc.name, func(t *testing.T) { actualEnabled, actualDisabled := computePluginNames(tc.enabled, tc.all)pkg/scheduler/backend/queue/scheduling_queue_test.go1
4823:7time-value-equality
pkg/scheduler/backend/queue/scheduling_queue_test.go:4823:7
} if *entity.GetInitialAttemptTimestamp() != test.wantInitialAttemptTs { t.Errorf("Pod initial schedule attempt timestamp unexpected, got %v, want %v", *entity.GetInitialAttemptTimestamp(), test.wantInitialAttemptTs)pkg/kubeapiserver/authorizer/reload.go1
220:1top-level-declaration-order
pkg/kubeapiserver/authorizer/reload.go:220:1
type kubeapiserverWebhookMetrics struct { // kube-apiserver doesn't report request metricspkg/proxy/healthcheck/healthcheck_test.go1
976:13unchecked-type-assertion
pkg/proxy/healthcheck/healthcheck_test.go:976:13
hcsi := newServiceHealthServer("hostname", nil, listener, httpFactory, nodePortAddresses, proxyChecker, v1.IPv4Protocol) hcs := hcsi.(*server) if len(hcs.services) != 0 {pkg/registry/admissionregistration/mutatingadmissionpolicy/strategy.go1
45:109unexported-return
pkg/registry/admissionregistration/mutatingadmissionpolicy/strategy.go:45:109
// NewStrategy is the default logic that applies when creating and updating MutatingAdmissionPolicy objects.func NewStrategy(authorizer authorizer.UnconditionalAuthorizer, resourceResolver resolver.ResourceResolver) *mutatingAdmissionPolicyStrategy { return &mutatingAdmissionPolicyStrategy{pkg/kubeapiserver/options/authentication_test.go2
1776:67unused-parameter
pkg/kubeapiserver/options/authentication_test.go:1776:67
func (d *dummyPublicKeyGetter) GetPublicKeys(ctx context.Context, keyIDHint string) []serviceaccount.PublicKey { return []serviceaccount.PublicKey{}1776:7unused-receiver
pkg/kubeapiserver/options/authentication_test.go:1776:7
func (d *dummyPublicKeyGetter) GetPublicKeys(ctx context.Context, keyIDHint string) []serviceaccount.PublicKey { return []serviceaccount.PublicKey{}pkg/proxy/config/config.go1
118:58use-any
pkg/proxy/config/config.go:118:58
func (c *EndpointSliceConfig) handleAddEndpointSlice(obj interface{}) { endpointSlice, ok := obj.(*discoveryv1.EndpointSlice)pkg/kubeapiserver/authorizer/reload.go1
102:20use-errors-new
pkg/kubeapiserver/authorizer/reload.go:102:20
if len(authzConfig.Authorizers) == 0 { return nil, nil, fmt.Errorf("at least one authorization mode must be passed") }pkg/proxy/conntrack/cleanup_test.go1
560:2use-slices-sort
pkg/proxy/conntrack/cleanup_test.go:560:2
// sort the expected flows before comparison sort.Slice(entriesAfterCleanup, func(i, j int) bool { return entriesAfterCleanup[i].String() < entriesAfterCleanup[j].String()pkg/proxy/endpointschangetracker_test.go1
329:2var-naming
pkg/proxy/endpointschangetracker_test.go:329:2
} multipleSubsetsWithLocal_s2 := func(eps *discovery.EndpointSlice) { eps.Endpoints = []discovery.Endpoint{{pkg/kubeapiserver/options/admission.go1
84:12add-constant
pkg/kubeapiserver/options/admission.go:84:12
fs.MarkDeprecated("admission-control", "Use --enable-admission-plugins or --disable-admission-plugins instead. Will be removed in a future version.") fs.Lookup("admission-control").Hidden = falsepkg/registry/certificates/podcertificaterequest/strategy_test.go1
67:5boolean-literal-comparison
pkg/registry/certificates/podcertificaterequest/strategy_test.go:67:5
strategy := NewStrategy() if strategy.AllowUnconditionalUpdate(context.Background()) != false { t.Errorf("Got true, want false")pkg/kubeapiserver/authorizer/reload.go1
100:40cognitive-complexity
pkg/kubeapiserver/authorizer/reload.go:100:40
// newForConfig constructsfunc (r *reloadableAuthorizerResolver) newForConfig(authzConfig *authzconfig.AuthorizationConfiguration) (authorizer.Authorizer, authorizer.RuleResolver, error) { if len(authzConfig.Authorizers) == 0 {pkg/proxy/ipvs/cleanup.go1
91:6confusing-naming
pkg/proxy/ipvs/cleanup.go:91:6
func cleanupLeftovers(ctx context.Context, ipvs utilipvs.Interface, ipts map[v1.IPFamily]utiliptables.Interface, ipset utilipset.Interface) (encounteredError bool) { logger := klog.FromContext(ctx)pkg/scheduler/backend/cache/snapshot_test.go1
1159:78confusing-results
pkg/scheduler/backend/cache/snapshot_test.go:1159:78
// simplifySnapshot for comparison in unit testsfunc simplifySnapshot(s *Snapshot) (map[string][]string, []string, []string, []string, map[string]int, map[string][]string) { nodeInfoMap := make(map[string][]string)pkg/proxy/util/linebuffer.go1
60:6constructor-interface-return
pkg/proxy/util/linebuffer.go:60:6
// NewLineBuffer returns a new "real" LineBufferfunc NewLineBuffer() LineBuffer { return &realLineBuffer{}pkg/scheduler/framework/plugins/volumebinding/binder_test.go1
148:38context-as-argument
pkg/scheduler/framework/plugins/volumebinding/binder_test.go:148:38
func newTestBinder(t *testing.T, ctx context.Context) *testEnv { client := &fake.Clientset{}pkg/kubeapiserver/options/authentication.go1
490:40cyclomatic-complexity
pkg/kubeapiserver/options/authentication.go:490:40
// an empty config if o is nil.func (o *BuiltInAuthenticationOptions) ToAuthenticationConfig() (kubeauthenticator.Config, error) { if o == nil {pkg/registry/batch/job/storage/storage.go1
103:59deprecated-api-usage
pkg/registry/batch/job/storage/storage.go:103:59
//nolint: staticcheck if options != nil && options.PropagationPolicy == nil && options.OrphanDependents == nil && job.Strategy.DefaultGarbageCollectionPolicy(ctx) == rest.OrphanDependents {pkg/proxy/config/config.go1
179:28discarded-error-result
pkg/proxy/config/config.go:179:28
handlerRegistration, _ := serviceInformer.Informer().AddEventHandlerWithResyncPeriod( cache.ResourceEventHandlerFuncs{pkg/kubeapiserver/authenticator/config.go1
57:1doc-comment-period
pkg/kubeapiserver/authenticator/config.go:57:1
// Config contains the data on how to authenticate a request to the Kube API Servertype Config struct {pkg/registry/core/service/ipallocator/ipallocator.go1
600:3early-return
pkg/registry/core/service/ipallocator/ipallocator.go:600:3
for i := len(bytes) - 1; i >= 0 && n > 0; i-- { if n >= 8 { bytes[i] = 0xffpkg/scheduler/testing/framework/fake_extender.go1
267:24empty-conditional-block
pkg/scheduler/testing/framework/fake_extender.go:267:24
status := f.runPredicate(pod, nodeInfoCopy) if status.IsSuccess() { // passpkg/kubeapiserver/options/authentication_test.go1
305:14error-strings
pkg/kubeapiserver/options/authentication_test.go:305:14
if len(errs) > 0 && (!strings.Contains(utilerrors.NewAggregate(errs).Error(), testcase.expectErr) || testcase.expectErr == "") { t.Errorf("Got err: %v, Expected err: %s", errs, testcase.expectErr) }pkg/scheduler/framework/plugins/interpodaffinity/filtering_test.go1
1272:4excessive-blank-identifiers
pkg/scheduler/framework/plugins/interpodaffinity/filtering_test.go:1272:4
// allPodsState is the state produced when all pods, including test.addedPod are given to prefilter. _, _, allPodsState, _ := getState(append(test.existingPods, test.addedPod))pkg/kubeapiserver/authorizer/config.go1
82:22exported-declaration-comment
pkg/kubeapiserver/authorizer/config.go:82:22
// Note: the cel compiler construction depends on feature gates and the compatibility version to be initialized.func (config Config) New(ctx context.Context, serverID string) (authorizer.Authorizer, authorizer.RuleResolver, error) { if len(config.AuthorizationConfiguration.Authorizers) == 0 {pkg/proxy/config/config_test.go1
1:1file-length-limit
pkg/proxy/config/config_test.go:1:1
/*Copyright 2014 The Kubernetes Authors.pkg/proxy/iptables/proxier.go1
104:2flag-parameter
pkg/proxy/iptables/proxier.go:104:2
healthzServer *healthcheck.ProxyHealthServer, initOnly bool,) (proxy.Provider, error) {pkg/kubeapiserver/authorizer/config.go1
1:1format
pkg/kubeapiserver/authorizer/config.go:1:1
/*Copyright 2016 The Kubernetes Authors.- Fix (safe): run `strider fmt pkg/kubeapiserver/authorizer/config.go`
pkg/kubeapiserver/options/authentication.go1
340:40function-length
pkg/kubeapiserver/options/authentication.go:340:40
// AddFlags returns flags of authentication for a API Serverfunc (o *BuiltInAuthenticationOptions) AddFlags(fs *pflag.FlagSet) { if o == nil {pkg/registry/certificates/certificates/storage/storage.go1
41:6function-result-limit
pkg/registry/certificates/certificates/storage/storage.go:41:6
// NewREST returns a registry which will store CertificateSigningRequest in the given helper.func NewREST(optsGetter generic.RESTOptionsGetter) (*REST, *StatusREST, *ApprovalREST, error) { store := &genericregistry.Store{pkg/kubeapiserver/authorizer/reload.go1
278:2import-shadowing
pkg/kubeapiserver/authorizer/reload.go:278:2
authorizer, ruleResolver, err := r.newForConfig(config) if err != nil {pkg/registry/core/service/storage/transaction_test.go1
50:6increment-decrement
pkg/registry/core/service/storage/transaction_test.go:50:6
commit: func() { temp = temp + 1 },pkg/proxy/healthcheck/proxy_health.go1
126:3inefficient-map-lookup
pkg/proxy/healthcheck/proxy_health.go:126:3
if _, set := hs.oldestPendingQueuedMap[ipFamily]; !set { hs.oldestPendingQueuedMap[ipFamily] = hs.clock.Now() }pkg/proxy/nftables/helpers_test.go1
644:83inefficient-sprintf
pkg/proxy/nftables/helpers_test.go:644:83
} matches, output, masq := tracePacket(t, nft, tc.sourceIP, protocol, tc.destIP, fmt.Sprintf("%d", tc.destPort), nodeIPs) var errors []stringpkg/kubeapiserver/options/authentication_test.go1
155:45insecure-url-scheme
pkg/kubeapiserver/options/authentication_test.go:155:45
testSA: &ServiceAccountAuthenticationOptions{ Issuers: []string{"http://foo.bar.com", "http://foo.bar.com"}, },pkg/registry/flowcontrol/ensurer/strategy.go1
106:30interface-method-limit
pkg/registry/flowcontrol/ensurer/strategy.go:106:30
// only usable as a type constraint.type configurationObjectType interface { comparablepkg/scheduler/framework/plugins/defaultpreemption/default_preemption_test.go1
2570:8max-control-nesting
pkg/scheduler/framework/plugins/defaultpreemption/default_preemption_test.go:2570:8
for _, expPod := range test.expectedPods { if expPod == victimName { found = truepkg/proxy/ipvs/proxier.go1
110:6max-parameters
pkg/proxy/ipvs/proxier.go:110:6
// NewDualStackProxier returns a new Proxier for dual-stack operationfunc NewDualStackProxier( ctx context.Context,pkg/proxy/apis/config/types.go1
139:6max-public-structs
pkg/proxy/apis/config/types.go:139:6
// DetectLocalConfiguration contains optional settings related to DetectLocalMode optiontype DetectLocalConfiguration struct { // bridgeInterface is a bridge interface name. When DetectLocalMode is set topkg/kubeapiserver/options/authentication.go1
750:2modifies-parameter
pkg/kubeapiserver/options/authentication.go:750:2
} authInfo.Authenticator = authenticatorpkg/proxy/ipvs/util/testing/fake.go1
69:8modifies-value-receiver
pkg/proxy/ipvs/util/testing/fake.go:69:8
func (a byAddress) Swap(i, j int) { a[i], a[j] = a[j], a[i]}pkg/kubeapiserver/options/authentication_test.go1
796:17nested-structs
pkg/kubeapiserver/options/authentication_test.go:796:17
func TestToAuthenticationConfig_OIDC(t *testing.T) { testCases := []struct { name stringpkg/registry/core/service/ipallocator/cidrallocator_test.go1
133:4nil-error-return
pkg/registry/core/service/ipallocator/cidrallocator_test.go:133:4
t.Logf("unexpected error %v", err) return false, nil }pkg/proxy/ipvs/proxier.go1
139:3nil-value-with-nil-error
pkg/proxy/ipvs/proxier.go:139:3
if initOnly { return nil, nil }pkg/registry/core/service/ipallocator/ipallocator_test.go1
388:3no-defer-in-loop
pkg/registry/core/service/ipallocator/ipallocator_test.go:388:3
} defer r.Destroy()pkg/proxy/nftables/helpers_test.go1
506:7no-else-after-return
pkg/proxy/nftables/helpers_test.go:506:7
return true } else if action == "goto" { // After a goto, return to our calling chainpkg/registry/flowcontrol/ensurer/flowschema_test.go1
38:6no-init
pkg/registry/flowcontrol/ensurer/flowschema_test.go:38:6
func init() { klog.InitFlags(nil)pkg/proxy/iptables/proxier.go1
1393:3no-naked-return
pkg/proxy/iptables/proxier.go:1393:3
metrics.IPTablesRestoreFailuresTotal.WithLabelValues(string(proxier.ipFamily)).Inc() return }pkg/kubeapiserver/default_storage_factory_builder.go1
45:5no-package-var
pkg/kubeapiserver/default_storage_factory_builder.go:45:5
// SpecialDefaultResourcePrefixes are prefixes compiled into Kubernetes.var SpecialDefaultResourcePrefixes = map[schema.GroupResource]string{ {Group: "", Resource: "replicationcontrollers"}: "controllers",pkg/kubeapiserver/options/authentication.go1
528:12optimize-operands-order
pkg/kubeapiserver/options/authentication.go:528:12
ret.OIDCSigningAlgs = oidc.AllValidSigningAlgorithms() } else if o.OIDC != nil && len(o.OIDC.IssuerURL) > 0 && len(o.OIDC.ClientID) > 0 { usernamePrefix := o.OIDC.UsernamePrefixpkg/registry/rbac/clusterrole/strategy.go1
66:2overwritten-before-use
pkg/registry/rbac/clusterrole/strategy.go:66:2
func (strategy) PrepareForUpdate(ctx context.Context, obj, old runtime.Object) { newClusterRole := obj.(*rbac.ClusterRole) oldClusterRole := old.(*rbac.ClusterRole)pkg/kubeapiserver/authorizer/config.go1
17:9package-comments
pkg/kubeapiserver/authorizer/config.go:17:9
package authorizerpkg/proxy/ipvs/util/ipvs_test.go1
19:9package-directory-mismatch
pkg/proxy/ipvs/util/ipvs_test.go:19:9
package ipvspkg/registry/core/pod/storage/storage_test.go1
401:15possible-nil-dereference
pkg/registry/core/pod/storage/storage_test.go:401:15
} if location.Host != tc.location { t.Errorf("Expected %v, but got %v", tc.location, location.Host)pkg/proxy/endpointslicecache_test.go1
500:14range-value-address
pkg/proxy/endpointslicecache_test.go:500:14
esData := &endpointSliceData{tc.updatedSlice, false} changed := tc.cache.esDataChanged(serviceKey, sliceKey, esData)pkg/registry/core/componentstatus/rest.go1
68:7receiver-naming
pkg/registry/core/componentstatus/rest.go:68:7
// Destroy cleans up resources on shutdown.func (r *REST) Destroy() { // Given no underlying store, we don't destroy anythingpkg/proxy/conntrack/sysctls_test.go1
92:56redefines-builtin-id
pkg/proxy/conntrack/sysctls_test.go:92:56
// SetMax value is calculated based on the number of CPUs by getConntrackMax()func (fc *fakeConntracker) SetMax(ctx context.Context, max int) error { fc.called = append(fc.called, "SetMax")pkg/proxy/apis/config/v1alpha1/defaults_test.go1
35:18redundant-conversion
pkg/proxy/apis/config/v1alpha1/defaults_test.go:35:18
oomScore := int32(-999) ctMaxPerCore := int32(32768) ctMin := int32(131072)pkg/proxy/conntrack/cleanup_test.go1
32:2redundant-import-alias
pkg/proxy/conntrack/cleanup_test.go:32:2
v1 "k8s.io/api/core/v1" discovery "k8s.io/api/discovery/v1"pkg/kubeapiserver/options/authentication.go1
620:3single-case-switch
pkg/kubeapiserver/options/authentication.go:620:3
switch { case len(o.ServiceAccounts.KeyFiles) > 0 && o.ServiceAccounts.ExternalPublicKeysGetter != nil:pkg/proxy/endpointschangetracker.go1
260:6slice-preallocation
pkg/proxy/endpointschangetracker.go:260:6
func formatEndpointsList(endpoints []Endpoint) []string { var formattedList []string for _, ep := range endpoints {pkg/kubeapiserver/default_storage_factory_builder.go1
83:72task-comment
pkg/kubeapiserver/default_storage_factory_builder.go:83:72
coordination.Resource("leasecandidates").WithVersion("v1beta1"), certificates.Resource("clustertrustbundles").WithVersion("v1beta1"), // TODO: remove in 1.38 certificates.Resource("podcertificaterequests").WithVersion("v1beta1"),pkg/kubeapiserver/options/admission_test.go1
99:6test-parallelism
pkg/kubeapiserver/options/admission_test.go:99:6
func TestAdmissionOptionsAddFlags(t *testing.T) { var args = []string{pkg/kubeapiserver/default_storage_factory_builder.go1
100:1top-level-declaration-order
pkg/kubeapiserver/default_storage_factory_builder.go:100:1
// StorageFactoryConfig is a configuration for creating storage factory.type StorageFactoryConfig struct { StorageConfig storagebackend.Configpkg/proxy/ipvs/proxier_test.go1
1908:22unchecked-type-assertion
pkg/proxy/ipvs/proxier_test.go:1908:22
addrs1 := []net.Addr{&net.IPNet{IP: netutils.ParseIPSloppy("2001:db8::"), Mask: net.CIDRMask(64, 128)}} fp.networkInterfacer.(*proxyutiltest.FakeNetwork).AddInterfaceAddr(&itf, addrs) fp.networkInterfacer.(*proxyutiltest.FakeNetwork).AddInterfaceAddr(&itf1, addrs1)pkg/registry/admissionregistration/mutatingadmissionpolicybinding/strategy.go1
52:136unexported-return
pkg/registry/admissionregistration/mutatingadmissionpolicybinding/strategy.go:52:136
// NewStrategy is the default logic that applies when creating and updating MutatingAdmissionPolicyBinding objects.func NewStrategy(authorizer authorizer.UnconditionalAuthorizer, policyGetter PolicyGetter, resourceResolver resolver.ResourceResolver) *mutatingAdmissionPolicyBindingStrategy { return &mutatingAdmissionPolicyBindingStrategy{pkg/proxy/apis/config/fuzzer/fuzzer.go1
82:12unused-parameter
pkg/proxy/apis/config/fuzzer/fuzzer.go:82:12
// Funcs returns the fuzzer functions for the kube-proxy apis.func Funcs(codecs runtimeserializer.CodecFactory) []interface{} { return []interface{}{pkg/proxy/apis/config/types.go1
271:7unused-receiver
pkg/proxy/apis/config/types.go:271:7
func (m *ProxyMode) Type() string { return "ProxyMode"pkg/proxy/config/config.go1
130:72use-any
pkg/proxy/config/config.go:130:72
func (c *EndpointSliceConfig) handleUpdateEndpointSlice(oldObj, newObj interface{}) { oldEndpointSlice, ok := oldObj.(*discoveryv1.EndpointSlice)pkg/kubeapiserver/authorizer/reload.go1
122:22use-errors-new
pkg/kubeapiserver/authorizer/reload.go:122:22
if r.nodeAuthorizer == nil { return nil, nil, fmt.Errorf("authorizer type Node is not allowed if it was not enabled at initial server startup") }pkg/proxy/iptables/proxier_test.go1
665:2use-slices-sort
pkg/proxy/iptables/proxier_test.go:665:2
// Sort tables sort.Slice(dump.Tables, func(i, j int) bool { return dump.Tables[i].Name < dump.Tables[j].Namepkg/proxy/endpointschangetracker_test.go1
340:2var-naming
pkg/proxy/endpointschangetracker_test.go:340:2
} multipleSubsetsMultiplePortsLocal_s1 := func(eps *discovery.EndpointSlice) { eps.Endpoints = []discovery.Endpoint{{pkg/kubeapiserver/options/admission_test.go1
48:12add-constant
pkg/kubeapiserver/options/admission_test.go:48:12
if len(options.Validate()) == 0 { t.Errorf("Expect error, but got none") }pkg/registry/core/namespace/storage/storage.go1
281:10boolean-literal-comparison
pkg/registry/core/namespace/storage/storage.go:281:10
if options.OrphanDependents != nil { return *options.OrphanDependents == false }pkg/kubeapiserver/options/authentication.go1
248:40cognitive-complexity
pkg/kubeapiserver/options/authentication.go:248:40
// Validate checks invalid config combinationfunc (o *BuiltInAuthenticationOptions) Validate() []error { if o == nil {pkg/proxy/ipvs/ipset/ipset.go1
300:23confusing-naming
pkg/proxy/ipvs/ipset/ipset.go:300:23
// otherwise raised when the same set (setname and create parameters are identical) already exists.func (runner *runner) createSet(set *IPSet, ignoreExistErr bool) error { args := []string{"create", set.Name, string(set.SetType)}pkg/scheduler/framework/plugins/defaultpreemption/default_preemption.go1
230:80confusing-results
pkg/scheduler/framework/plugins/defaultpreemption/default_preemption.go:230:80
// of candidates that should be shortlisted for dry running preemption.func (pl *DefaultPreemption) GetOffsetAndNumCandidates(numNodes int32) (int32, int32) { return getOffsetRand(numNodes), pl.calculateNumCandidates(numNodes)pkg/proxy/util/linebuffer.go1
128:6constructor-interface-return
pkg/proxy/util/linebuffer.go:128:6
// how many rules we managed to avoid having to sync.)func NewDiscardLineBuffer() LineBuffer { return &discardLineBuffer{}pkg/kubeapiserver/options/authentication.go1
670:40cyclomatic-complexity
pkg/kubeapiserver/options/authentication.go:670:40
// The input context controls the lifecycle of background goroutines started to reload the authentication config file.func (o *BuiltInAuthenticationOptions) ApplyTo( ctx context.Context,pkg/registry/batch/job/storage/storage.go1
114:47deprecated-api-usage
pkg/registry/batch/job/storage/storage.go:114:47
//nolint:staticcheck // SA1019 backwards compatibility if deleteOptions.PropagationPolicy == nil && deleteOptions.OrphanDependents == nil && job.Strategy.DefaultGarbageCollectionPolicy(ctx) == rest.OrphanDependents {pkg/proxy/config/config.go1
288:28discarded-error-result
pkg/proxy/config/config.go:288:28
handlerRegistration, _ := nodeInformer.Informer().AddEventHandlerWithResyncPeriod( cache.ResourceEventHandlerFuncs{pkg/kubeapiserver/authorizer/config.go1
48:1doc-comment-period
pkg/kubeapiserver/authorizer/config.go:48:1
// Config contains the data on how to authorize a request to the Kube API Servertype Config struct {pkg/registry/flowcontrol/ensurer/strategy.go1
347:3early-return
pkg/registry/flowcontrol/ensurer/strategy.go:347:3
} if apierrors.IsNotFound(err) { klog.V(5).InfoS("Unwanted APF object was concurrently deleted", "name", name)pkg/kubeapiserver/options/authentication_test.go1
308:14error-strings
pkg/kubeapiserver/options/authentication_test.go:308:14
if len(errs) == 0 && len(testcase.expectErr) != 0 { t.Errorf("Got err nil, Expected err: %s", testcase.expectErr) }pkg/scheduler/schedule_one_test.go1
3956:4excessive-blank-identifiers
pkg/scheduler/schedule_one_test.go:3956:4
podInfo := queuedPodInfoForPod(test.pod) _, _, _, err = scheduler.findNodesThatFitPod(ctx, schedFramework, framework.NewCycleState(), podInfo) if err != nil {pkg/kubeapiserver/authorizer/config.go1
169:6exported-declaration-comment
pkg/kubeapiserver/authorizer/config.go:169:6
// For now, lower cases the mode namefunc GetNameForAuthorizerMode(mode string) string { return strings.ToLower(mode)pkg/proxy/conntrack/cleanup_test.go1
1:1file-length-limit
pkg/proxy/conntrack/cleanup_test.go:1:1
//go:build linuxpkg/proxy/iptables/proxier.go1
219:2flag-parameter
pkg/proxy/iptables/proxier.go:219:2
healthzServer *healthcheck.ProxyHealthServer, initOnly bool,) (*Proxier, error) {pkg/kubeapiserver/authorizer/modes/modes.go1
1:1format
pkg/kubeapiserver/authorizer/modes/modes.go:1:1
/*Copyright 2017 The Kubernetes Authors.- Fix (safe): run `strider fmt pkg/kubeapiserver/authorizer/modes/modes.go`
pkg/kubeapiserver/options/authentication.go1
490:40function-length
pkg/kubeapiserver/options/authentication.go:490:40
// an empty config if o is nil.func (o *BuiltInAuthenticationOptions) ToAuthenticationConfig() (kubeauthenticator.Config, error) { if o == nil {pkg/registry/certificates/podcertificaterequest/storage/storage_test.go1
624:6function-result-limit
pkg/registry/certificates/podcertificaterequest/storage/storage_test.go:624:6
func mustMakeEd25519KeyAndProof(t *testing.T, toBeSigned []byte) (ed25519.PrivateKey, ed25519.PublicKey, []byte, []byte) { pub, priv, err := ed25519.GenerateKey(rand.Reader)pkg/kubeapiserver/default_storage_factory_builder.go1
152:3import-shadowing
pkg/kubeapiserver/default_storage_factory_builder.go:152:3
group := apiresource[0] resource := apiresource[1] groupResource := schema.GroupResource{Group: group, Resource: resource}pkg/registry/core/service/storage/transaction_test.go1
53:6increment-decrement
pkg/registry/core/service/storage/transaction_test.go:53:6
revert: func() { temp = temp - 1 },pkg/proxy/ipvs/proxier.go1
1287:35inefficient-map-lookup
pkg/proxy/ipvs/proxier.go:1287:35
args = append(args, "-m", "comment", "--comment", proxier.ipsetList[set.name].getComment(), "-m", "set", "--match-set", proxier.ipsetList[set.name].Name,pkg/registry/core/pod/strategy.go1
554:12inefficient-sprintf
pkg/registry/core/pod/strategy.go:554:12
if len(pod.Spec.Containers[i].Ports) > 0 { port = fmt.Sprintf("%d", pod.Spec.Containers[i].Ports[0].ContainerPort) breakpkg/kubeapiserver/options/authentication_test.go1
169:23insecure-url-scheme
pkg/kubeapiserver/options/authentication_test.go:169:23
testSA: &ServiceAccountAuthenticationOptions{ Issuers: []string{"http://[::1]:namedport"}, },pkg/scheduler/backend/cache/interface.go1
57:12interface-method-limit
pkg/scheduler/backend/cache/interface.go:57:12
// - If a pod wasn't added, it wouldn't be removed or updated.type Cache interface { // NodeCount returns the number of nodes in the cache.pkg/scheduler/framework/plugins/dynamicresources/dynamicresources.go1
571:7max-control-nesting
pkg/scheduler/framework/plugins/dynamicresources/dynamicresources.go:571:7
qualRequestName := strings.Join([]string{request.Name, subRequest.Name}, "/") if status := pl.validateDeviceClass(logger, subRequest.DeviceClassName, qualRequestName); status != nil { return nil, statuspkg/proxy/ipvs/proxier.go1
242:6max-parameters
pkg/proxy/ipvs/proxier.go:242:6
// NewProxier returns a new single-stack IPVS proxier.func NewProxier( ctx context.Context,pkg/proxy/apis/config/types.go1
158:6max-public-structs
pkg/proxy/apis/config/types.go:158:6
// Kubernetes proxy server.type KubeProxyConfiguration struct { metav1.TypeMetapkg/kubeapiserver/options/authentication.go1
823:2modifies-parameter
pkg/kubeapiserver/options/authentication.go:823:2
openAPIConfig.SecurityDefinitions = openAPIV2SecurityDefinitions if openAPIV3Config != nil {pkg/proxy/winkernel/proxier.go1
544:3modifies-value-receiver
pkg/proxy/winkernel/proxier.go:544:3
if !exists { refCountMap[hnsID] = new(uint16) refCount = refCountMap[hnsID]pkg/kubeapiserver/options/authentication_test.go1
1091:17nested-structs
pkg/kubeapiserver/options/authentication_test.go:1091:17
func TestValidateOIDCOptions(t *testing.T) { testCases := []struct { name stringpkg/registry/core/service/ipallocator/cidrallocator_test.go1
171:4nil-error-return
pkg/registry/core/service/ipallocator/cidrallocator_test.go:171:4
if err != nil { return false, nil }pkg/proxy/ipvs/proxier.go1
321:3nil-value-with-nil-error
pkg/proxy/ipvs/proxier.go:321:3
logger.Info("System initialized and --init-only specified") return nil, nil }pkg/scheduler/backend/queue/scheduling_queue_test.go1
2403:6no-defer-in-loop
pkg/scheduler/backend/queue/scheduling_queue_test.go:2403:6
ctx, cancel := context.WithCancel(ctx) defer cancel() q := NewTestQueue(ctx, newDefaultQueueSort(), WithClock(c), WithQueueingHintMapPerProfile(m))pkg/proxy/node.go1
124:6no-else-after-return
pkg/proxy/node.go:124:6
return nil, fmt.Errorf("timeout waiting for node %q to exist", nodeName) } else { return nil, fmt.Errorf("timeout waiting for PodCIDR allocation on node %q", nodeName)pkg/scheduler/apis/config/scheme/scheme.go1
35:6no-init
pkg/scheduler/apis/config/scheme/scheme.go:35:6
func init() { AddToScheme(Scheme)pkg/proxy/iptables/proxier.go1
1427:2no-naked-return
pkg/proxy/iptables/proxier.go:1427:2
} return}pkg/kubeapiserver/options/authentication.go2
82:5no-package-var
pkg/kubeapiserver/options/authentication.go:82:5
// Exported as a variable so that it can be overridden in integration tests.var UpdateAuthenticationConfigTimeout = time.Minute590:8optimize-operands-order
pkg/kubeapiserver/options/authentication.go:590:8
switch { case ret.AuthenticationConfig.Anonymous != nil && o.Anonymous.FlagsSet: // Flags and config file are mutually exclusivepkg/registry/rbac/clusterrole/strategy.go1
67:2overwritten-before-use
pkg/registry/rbac/clusterrole/strategy.go:67:2
newClusterRole := obj.(*rbac.ClusterRole) oldClusterRole := old.(*rbac.ClusterRole)pkg/kubeapiserver/authorizer/modes/modes.go1
17:9package-comments
pkg/kubeapiserver/authorizer/modes/modes.go:17:9
package modespkg/registry/core/node/rest/proxy.go1
17:9package-directory-mismatch
pkg/registry/core/node/rest/proxy.go:17:9
package nodepkg/registry/core/pod/storage/storage_test.go1
402:62possible-nil-dereference
pkg/registry/core/pod/storage/storage_test.go:402:62
if location.Host != tc.location { t.Errorf("Expected %v, but got %v", tc.location, location.Host) }pkg/proxy/healthcheck/service_health.go1
148:10range-value-address
pkg/proxy/healthcheck/service_health.go:148:10
svc := &hcInstance{nsn: nsn, port: port} err := svc.listenAndServeAll(hcs)pkg/registry/core/componentstatus/rest.go1
182:7receiver-naming
pkg/registry/core/componentstatus/rest.go:182:7
// ShortNames implements the ShortNamesProvider interface. Returns a list of short names for a resource.func (r *REST) ShortNames() []string { return []string{"cs"}pkg/proxy/iptables/proxier_test.go1
183:3redefines-builtin-id
pkg/proxy/iptables/proxier_test.go:183:3
output map[string][]string error string }{pkg/proxy/apis/config/v1alpha1/defaults_test.go1
36:11redundant-conversion
pkg/proxy/apis/config/v1alpha1/defaults_test.go:36:11
ctMaxPerCore := int32(32768) ctMin := int32(131072) testCases := []struct {pkg/proxy/endpointschangetracker.go1
23:2redundant-import-alias
pkg/proxy/endpointschangetracker.go:23:2
v1 "k8s.io/api/core/v1" discovery "k8s.io/api/discovery/v1"pkg/kubeapiserver/options/authorization.go1
261:3single-case-switch
pkg/kubeapiserver/options/authorization.go:261:3
for _, mode := range o.Modes { switch mode { case authzmodes.ModeWebhook:pkg/proxy/ipvs/ipset/testing/fake.go1
138:2slice-preallocation
pkg/proxy/ipvs/ipset/testing/fake.go:138:2
func (f *FakeIPSet) ListSets() ([]string, error) { res := []string{} for set := range f.Sets {pkg/kubeapiserver/options/authentication.go1
526:3task-comment
pkg/kubeapiserver/options/authentication.go:526:3
// all known signing algs are allowed when using authentication config // TODO: what we really want to express is 'any alg is fine as long it matches a public key' ret.OIDCSigningAlgs = oidc.AllValidSigningAlgorithms()pkg/kubeapiserver/options/authentication_test.go1
58:6test-parallelism
pkg/kubeapiserver/options/authentication_test.go:58:6
func TestAuthenticationValidate(t *testing.T) { testCases := []struct {pkg/kubeapiserver/options/authentication.go1
871:1top-level-declaration-order
pkg/kubeapiserver/options/authentication.go:871:1
var ( cfgScheme = runtime.NewScheme()pkg/proxy/ipvs/proxier_test.go1
1909:22unchecked-type-assertion
pkg/proxy/ipvs/proxier_test.go:1909:22
fp.networkInterfacer.(*proxyutiltest.FakeNetwork).AddInterfaceAddr(&itf, addrs) fp.networkInterfacer.(*proxyutiltest.FakeNetwork).AddInterfaceAddr(&itf1, addrs1) fp.nodePortAddresses = proxyutil.NewNodePortAddresses(v1.IPv4Protocol, []string{"100.101.102.0/24"})pkg/registry/admissionregistration/validatingadmissionpolicy/strategy.go1
48:109unexported-return
pkg/registry/admissionregistration/validatingadmissionpolicy/strategy.go:48:109
// NewStrategy is the default logic that applies when creating and updating validatingAdmissionPolicy objects.func NewStrategy(authorizer authorizer.UnconditionalAuthorizer, resourceResolver resolver.ResourceResolver) *validatingAdmissionPolicyStrategy { return &validatingAdmissionPolicyStrategy{pkg/proxy/config/config_test.go1
72:46unused-parameter
pkg/proxy/config/config_test.go:72:46
func (h *ServiceHandlerMock) OnServiceUpdate(oldService, service *v1.Service) { h.lock.Lock()pkg/proxy/apis/config/types.go1
298:7unused-receiver
pkg/proxy/apis/config/types.go:298:7
func (m *LocalMode) Type() string { return "LocalMode"pkg/proxy/config/config.go1
147:61use-any
pkg/proxy/config/config.go:147:61
func (c *EndpointSliceConfig) handleDeleteEndpointSlice(obj interface{}) { endpointSlice, ok := obj.(*discoveryv1.EndpointSlice)pkg/kubeapiserver/authorizer/reload.go1
145:22use-errors-new
pkg/kubeapiserver/authorizer/reload.go:145:22
if r.abacAuthorizer == nil { return nil, nil, fmt.Errorf("authorizer type ABAC is not allowed if it was not enabled at initial server startup") }pkg/proxy/iptables/proxier_test.go1
672:3use-slices-sort
pkg/proxy/iptables/proxier_test.go:672:3
table := &dump.Tables[t] sort.Slice(table.Chains, func(i, j int) bool { switch {pkg/proxy/endpointschangetracker_test.go1
355:2var-naming
pkg/proxy/endpointschangetracker_test.go:355:2
} multipleSubsetsMultiplePortsLocal_s2 := func(eps *discovery.EndpointSlice) { eps.Endpoints = []discovery.Endpoint{{pkg/kubeapiserver/options/admission_test.go1
53:33add-constant
pkg/kubeapiserver/options/admission_test.go:53:33
options = NewAdmissionOptions() options.PluginNames = []string{"ServiceAccount"} if errs := options.Validate(); len(errs) > 0 {pkg/registry/core/namespace/storage/storage_test.go1
616:7boolean-literal-comparison
pkg/registry/core/namespace/storage/storage_test.go:616:7
for _, f := range ns.Finalizers { if test.remainingFinalizers[f] != true { t.Errorf("%s: unexpected finalizer %s", test.name, f)pkg/kubeapiserver/options/authentication.go1
340:40cognitive-complexity
pkg/kubeapiserver/options/authentication.go:340:40
// AddFlags returns flags of authentication for a API Serverfunc (o *BuiltInAuthenticationOptions) AddFlags(fs *pflag.FlagSet) { if o == nil {pkg/proxy/node.go1
74:6confusing-naming
pkg/proxy/node.go:74:6
// newNodeManager implements NewNodeManager with configurable exit function, poll interval and timeouts.func newNodeManager(ctx context.Context, client clientset.Interface, resyncInterval time.Duration, nodeName string, watchPodCIDRs bool, exitFunc func(int),pkg/scheduler/framework/plugins/dynamicresources/dynamicresources_test.go1
3983:62confusing-results
pkg/scheduler/framework/plugins/dynamicresources/dynamicresources_test.go:3983:62
func (tc *testContext) listAssumedClaims() ([]metav1.Object, []metav1.Object) { var assumedClaims []metav1.Objectpkg/proxy/util/localdetector.go1
73:6constructor-interface-return
pkg/proxy/util/localdetector.go:73:6
// NewNoOpLocalDetector returns a no-op implementation of LocalTrafficDetector.func NewNoOpLocalDetector() LocalTrafficDetector { return &detectLocal{}pkg/kubeapiserver/options/authentication_test.go1
1612:6cyclomatic-complexity
pkg/kubeapiserver/options/authentication_test.go:1612:6
func TestToAuthenticationConfigForServiceAccount(t *testing.T) {pkg/registry/batch/job/storage/storage_test.go1
229:41deprecated-api-usage
pkg/registry/batch/job/storage/storage_test.go:229:41
expectWarning: false, deleteOptions: &metav1.DeleteOptions{OrphanDependents: &orphanDependents}, requestInfo: &genericapirequest.RequestInfo{APIGroup: "batch", APIVersion: "v1"},pkg/proxy/config/config.go1
376:28discarded-error-result
pkg/proxy/config/config.go:376:28
handlerRegistration, _ := serviceCIDRInformer.Informer().AddEventHandlerWithResyncPeriod( cache.ResourceEventHandlerFuncs{pkg/kubeapiserver/authorizer/config.go1
167:1doc-comment-period
pkg/kubeapiserver/authorizer/config.go:167:1
// GetNameForAuthorizerMode returns the name to be set for the mode in AuthorizationConfiguration// For now, lower cases the mode namepkg/scheduler/backend/cache/cache_test.go1
3026:3early-return
pkg/scheduler/backend/cache/cache_test.go:3026:3
for _, nodeName := range nodesList { if n := snapshot.nodeInfoMap[nodeName]; n != nil { expectedNodeInfoList = append(expectedNodeInfoList, n)pkg/kubeapiserver/options/authentication_test.go1
1235:14error-strings
pkg/kubeapiserver/options/authentication_test.go:1235:14
if len(errs) > 0 && (!strings.Contains(utilerrors.NewAggregate(errs).Error(), tt.expectErr) || tt.expectErr == "") { t.Errorf("Got err: %v, Expected err: %s", errs, tt.expectErr) }pkg/scheduler/schedule_one_test.go1
4565:4excessive-blank-identifiers
pkg/scheduler/schedule_one_test.go:4565:4
podInfo := queuedPodInfoForPod(test.pod) _, _, _, err = sched.findNodesThatFitPod(ctx, fwk, framework.NewCycleState(), podInfo) if err != nil {pkg/kubeapiserver/authorizer/config.go1
173:6exported-declaration-comment
pkg/kubeapiserver/authorizer/config.go:173:6
func LoadAndValidateFile(configFile string, compiler authorizationcel.Compiler, requireNonWebhookTypes sets.Set[authzconfig.AuthorizerType]) (*authzconfig.AuthorizationConfiguration, string, error) { data, err := os.ReadFile(configFile)pkg/proxy/endpointschangetracker_test.go1
1:1file-length-limit
pkg/proxy/endpointschangetracker_test.go:1:1
/*Copyright 2017 The Kubernetes Authors.pkg/proxy/iptables/proxier.go1
434:40flag-parameter
pkg/proxy/iptables/proxier.go:434:40
func (proxier *Proxier) setInitialized(value bool) { var initialized int32pkg/kubeapiserver/authorizer/modes/modes_test.go1
1:1format
pkg/kubeapiserver/authorizer/modes/modes_test.go:1:1
/*Copyright 2017 The Kubernetes Authors.- Fix (safe): run `strider fmt pkg/kubeapiserver/authorizer/modes/modes_test.go`
pkg/kubeapiserver/options/authentication.go1
670:40function-length
pkg/kubeapiserver/options/authentication.go:670:40
// The input context controls the lifecycle of background goroutines started to reload the authentication config file.func (o *BuiltInAuthenticationOptions) ApplyTo( ctx context.Context,pkg/registry/certificates/podcertificaterequest/strategy_test.go1
484:6function-result-limit
pkg/registry/certificates/podcertificaterequest/strategy_test.go:484:6
func mustMakeEd25519KeyAndProof(t *testing.T, toBeSigned []byte) (ed25519.PrivateKey, ed25519.PublicKey, []byte, []byte) { pub, priv, err := ed25519.GenerateKey(rand.Reader)pkg/kubeapiserver/options/admission.go1
117:2import-shadowing
pkg/kubeapiserver/options/admission.go:117:2
c *server.Config, informers informers.SharedInformerFactory, kubeClient kubernetes.Interface,pkg/registry/core/service/storage/transaction_test.go1
79:6increment-decrement
pkg/registry/core/service/storage/transaction_test.go:79:6
commit: func() { temp = temp + 1 },pkg/proxy/ipvs/proxier.go1
1288:33inefficient-map-lookup
pkg/proxy/ipvs/proxier.go:1288:33
"-m", "comment", "--comment", proxier.ipsetList[set.name].getComment(), "-m", "set", "--match-set", proxier.ipsetList[set.name].Name, set.matchType,pkg/registry/core/service/storage/storage_test.go1
904:7inefficient-sprintf
pkg/registry/core/service/storage/storage_test.go:904:7
if ok { s = fmt.Sprintf("%d", line) } else {pkg/kubeapiserver/options/authentication_test.go1
184:24insecure-url-scheme
pkg/kubeapiserver/options/authentication_test.go:184:24
KeyFiles: []string{"cert", "key"}, Issuers: []string{"http://foo.bar.com"}, JWKSURI: "https://host:port",pkg/scheduler/backend/queue/active_queue.go1
36:19interface-method-limit
pkg/scheduler/backend/queue/active_queue.go:36:19
// Its methods take the lock inside.type activeQueuer interface { underLock(func(unlockedActiveQ unlockedActiveQueuer))pkg/scheduler/framework/plugins/dynamicresources/nodeallocatabledynamicresources.go1
160:7max-control-nesting
pkg/scheduler/framework/plugins/dynamicresources/nodeallocatabledynamicresources.go:160:7
quantity = consumed.DeepCopy() if resourceMap.AllocationMultiplier != nil { qDec := quantity.AsDec()pkg/proxy/nftables/proxier.go1
202:6max-parameters
pkg/proxy/nftables/proxier.go:202:6
// NewProxier returns a new single-stack NFTables proxier.func NewProxier(ctx context.Context, config *kubeproxyconfig.KubeProxyConfiguration,pkg/registry/core/pod/storage/storage.go1
375:6max-public-structs
pkg/registry/core/pod/storage/storage.go:375:6
// EphemeralContainersREST implements the REST endpoint for adding EphemeralContainerstype EphemeralContainersREST struct { store *genericregistry.Storepkg/kubeapiserver/options/authentication.go1
825:3modifies-parameter
pkg/kubeapiserver/options/authentication.go:825:3
if openAPIV3Config != nil { openAPIV3Config.SecuritySchemes = openAPIV3SecuritySchemes }pkg/registry/core/pod/storage/storage_test.go1
155:2modifies-value-receiver
pkg/registry/core/pod/storage/storage_test.go:155:2
func (f FailDeletionStorage) Delete(_ context.Context, key string, _ runtime.Object, _ *apiserverstorage.Preconditions, _ apiserverstorage.ValidateObjectFunc, _ runtime.Object, _ apiserverstorage.DeleteOptions) error { *f.Called = true return apiserverstorage.NewKeyNotFoundError(key, 0)pkg/kubeapiserver/options/authentication_test.go1
1248:17nested-structs
pkg/kubeapiserver/options/authentication_test.go:1248:17
func TestLoadAuthenticationConfig(t *testing.T) { testCases := []struct { name stringpkg/registry/core/service/ipallocator/cidrallocator_test.go1
230:4nil-error-return
pkg/registry/core/service/ipallocator/cidrallocator_test.go:230:4
if err != nil { return false, nil }pkg/proxy/ipvs/proxier_test.go1
89:2nil-value-with-nil-error
pkg/proxy/ipvs/proxier_test.go:89:2
func (f *fakeIpvs) GetVirtualServer(*utilipvs.VirtualServer) (*utilipvs.VirtualServer, error) { return nil, nil}pkg/scheduler/eventhandlers.go1
291:4no-defer-in-loop
pkg/scheduler/eventhandlers.go:291:4
if evt.Label() != framework.EventUnscheduledPodUpdate.Label() { defer metrics.EventHandlingLatency.ObserveSince(start, evt.Label())() }pkg/proxy/util/nfacct/nfacct_linux.go1
101:4no-else-after-return
pkg/proxy/util/nfacct/nfacct_linux.go:101:4
return handleError(r.Add(name)) } else if err != nil { return handleError(err)pkg/scheduler/apis/config/v1/register.go1
37:6no-init
pkg/scheduler/apis/config/v1/register.go:37:6
func init() { // We only register manually written functions here. The registration of thepkg/proxy/ipvs/proxier.go1
665:3no-naked-return
pkg/proxy/ipvs/proxier.go:665:3
proxier.logger.V(2).Info("Not syncing ipvs rules until Services and Endpoints have been received from master") return }pkg/kubeapiserver/options/authentication.go2
872:2no-package-var
pkg/kubeapiserver/options/authentication.go:872:2
var ( cfgScheme = runtime.NewScheme() codecs = serializer.NewCodecFactory(cfgScheme, serializer.EnableStrict)616:6optimize-operands-order
pkg/kubeapiserver/options/authentication.go:616:6
if o.ServiceAccounts != nil { if len(o.ServiceAccounts.Issuers) != 0 && len(o.APIAudiences) == 0 { ret.APIAudiences = authenticator.Audiences(o.ServiceAccounts.Issuers)pkg/registry/rbac/clusterrolebinding/strategy.go1
65:2overwritten-before-use
pkg/registry/rbac/clusterrolebinding/strategy.go:65:2
func (strategy) PrepareForUpdate(ctx context.Context, obj, old runtime.Object) { newClusterRoleBinding := obj.(*rbac.ClusterRoleBinding) oldClusterRoleBinding := old.(*rbac.ClusterRoleBinding)pkg/kubeapiserver/authorizer/reload.go1
17:9package-comments
pkg/kubeapiserver/authorizer/reload.go:17:9
package authorizerpkg/scheduler/framework/autoscaler_contract/framework_contract_test.go1
21:9package-directory-mismatch
pkg/scheduler/framework/autoscaler_contract/framework_contract_test.go:21:9
package contractpkg/scheduler/backend/queue/scheduling_queue_test.go1
5563:18possible-nil-dereference
pkg/scheduler/backend/queue/scheduling_queue_test.go:5563:18
if !cmp.Equal(pInfo.Pod, tt.expectedPod) { t.Errorf("Expected pod=%v, but got pod=%v", tt.expectedPod, pInfo.Pod)pkg/proxy/healthcheck/service_health.go1
148:10range-value-address
pkg/proxy/healthcheck/service_health.go:148:10
svc := &hcInstance{nsn: nsn, port: port} err := svc.listenAndServeAll(hcs)pkg/registry/core/namespace/storage/storage.go1
289:7receiver-naming
pkg/registry/core/namespace/storage/storage.go:289:7
func (e *REST) ConvertToTable(ctx context.Context, object runtime.Object, tableOptions runtime.Object) (*metav1.Table, error) { return e.store.ConvertToTable(ctx, object, tableOptions)pkg/proxy/iptables/proxier_test.go1
506:3redefines-builtin-id
pkg/proxy/iptables/proxier_test.go:506:3
input string error string }{pkg/proxy/apis/config/validation/validation_test.go1
400:106redundant-conversion
pkg/proxy/apis/config/validation/validation_test.go:400:106
}, expectedErrs: field.ErrorList{field.Invalid(newPath.Child("KubeProxyLinuxConfiguration.OOMScoreAdj"), int32(-1001), "must be within the range [-1000, 1000]")}, },pkg/proxy/endpointschangetracker_test.go1
25:2redundant-import-alias
pkg/proxy/endpointschangetracker_test.go:25:2
v1 "k8s.io/api/core/v1" discovery "k8s.io/api/discovery/v1"pkg/proxy/apis/config/v1alpha1/conversion.go1
35:2single-case-switch
pkg/proxy/apis/config/v1alpha1/conversion.go:35:2
out.OOMScoreAdj = in.Linux.OOMScoreAdj switch in.Mode { case kubeproxyconfig.ProxyModeNFTables:pkg/proxy/ipvs/netlink_linux.go1
122:6slice-preallocation
pkg/proxy/ipvs/netlink_linux.go:122:6
} var ips []string for _, addr := range addrs {pkg/kubeapiserver/options/authentication.go1
766:5task-comment
pkg/kubeapiserver/options/authentication.go:766:5
func() { // TODO collapse onto shared logic with DynamicEncryptionConfigContent controllerpkg/kubeapiserver/options/authentication_test.go2
282:24test-parallelism
pkg/kubeapiserver/options/authentication_test.go:282:24
for _, testcase := range testCases { t.Run(testcase.name, func(t *testing.T) { options := NewBuiltInAuthenticationOptions()1767:1top-level-declaration-order
pkg/kubeapiserver/options/authentication_test.go:1767:1
type dummyPublicKeyGetter struct {}pkg/proxy/ipvs/proxier_test.go1
1996:22unchecked-type-assertion
pkg/proxy/ipvs/proxier_test.go:1996:22
addrs1 := []net.Addr{&net.IPNet{IP: netutils.ParseIPSloppy("2001:db8::"), Mask: net.CIDRMask(64, 128)}} fp.networkInterfacer.(*proxyutiltest.FakeNetwork).AddInterfaceAddr(&itf, addrs) fp.networkInterfacer.(*proxyutiltest.FakeNetwork).AddInterfaceAddr(&itf1, addrs1)pkg/registry/admissionregistration/validatingadmissionpolicy/strategy.go1
205:75unexported-return
pkg/registry/admissionregistration/validatingadmissionpolicy/strategy.go:205:75
// NewStatusStrategy creates a strategy for operating the status object.func NewStatusStrategy(policyStrategy *validatingAdmissionPolicyStrategy) *validatingAdmissionPolicyStatusStrategy { return &validatingAdmissionPolicyStatusStrategy{validatingAdmissionPolicyStrategy: policyStrategy}pkg/proxy/config/config_test.go1
252:58unused-parameter
pkg/proxy/config/config_test.go:252:58
func (h *EndpointSliceHandlerMock) OnEndpointSliceUpdate(oldSlice, slice *discoveryv1.EndpointSlice) { h.lock.Lock()pkg/proxy/conntrack/sysctls.go1
186:7unused-receiver
pkg/proxy/conntrack/sysctls.go:186:7
func (rct realConntrackConfigurer) setIntSysCtl(ctx context.Context, name string, value int) error { logger := klog.FromContext(ctx)pkg/proxy/config/config.go1
212:46use-any
pkg/proxy/config/config.go:212:46
func (c *ServiceConfig) handleAddService(obj interface{}) { service, ok := obj.(*v1.Service)pkg/kubeapiserver/authorizer/reload.go1
201:22use-errors-new
pkg/kubeapiserver/authorizer/reload.go:201:22
if r.rbacAuthorizer == nil { return nil, nil, fmt.Errorf("authorizer type RBAC is not allowed if it was not enabled at initial server startup") }pkg/proxy/iptables/proxier_test.go1
703:3use-slices-sort
pkg/proxy/iptables/proxier_test.go:703:3
if chain != nil { sort.SliceStable(chain.Rules, func(i, j int) bool { return orderByCommentServiceName(chain.Rules[i], chain.Rules[j])pkg/proxy/endpointschangetracker_test.go1
365:2var-naming
pkg/proxy/endpointschangetracker_test.go:365:2
} multipleSubsetsIPsPorts1_s1 := func(eps *discovery.EndpointSlice) { eps.Endpoints = []discovery.Endpoint{{pkg/kubeapiserver/options/admission_test.go1
80:31add-constant
pkg/kubeapiserver/options/admission_test.go:80:31
name: "choose one", all: []string{"one", "two"}, enabled: []string{"one"},pkg/registry/core/service/storage/storage_test.go1
11806:7boolean-literal-comparison
pkg/registry/core/service/storage/storage_test.go:11806:7
location, _, err := redirector.ResourceLocation(ctx, tc.query) if tc.err == false && err != nil { t.Fatalf("unexpected error: %v", err)pkg/kubeapiserver/options/authentication.go1
490:40cognitive-complexity
pkg/kubeapiserver/options/authentication.go:490:40
// an empty config if o is nil.func (o *BuiltInAuthenticationOptions) ToAuthenticationConfig() (kubeauthenticator.Config, error) { if o == nil {pkg/registry/core/service/ipallocator/bitmap.go1
171:17confusing-naming
pkg/registry/core/service/ipallocator/bitmap.go:171:17
func (r *Range) allocate(ip net.IP, dryRun bool) error { label := r.CIDR()pkg/scheduler/framework/plugins/dynamicresources/extendeddynamicresources.go1
322:90confusing-results
pkg/scheduler/framework/plugins/dynamicresources/extendeddynamicresources.go:322:90
func partitionContainerIndices(containers []v1.Container, numInitContainers int) ([]int, []int) { longLivedContainerIndices := make([]int, 0, len(containers))pkg/proxy/util/localdetector.go1
80:6constructor-interface-return
pkg/proxy/util/localdetector.go:80:6
// assumed to be valid.func NewDetectLocalByCIDR(cidr string) LocalTrafficDetector { nftFamily := "ip"pkg/kubeapiserver/options/authorization.go1
97:39cyclomatic-complexity
pkg/kubeapiserver/options/authorization.go:97:39
// Validate checks invalid config combinationfunc (o *BuiltInAuthorizationOptions) Validate() []error { if o == nil {pkg/registry/batch/job/storage/storage_test.go1
268:41deprecated-api-usage
pkg/registry/batch/job/storage/storage_test.go:268:41
expectWarning: false, deleteOptions: &metav1.DeleteOptions{OrphanDependents: &orphanDependents}, listOptions: &internalversion.ListOptions{},pkg/proxy/config/config.go1
479:28discarded-error-result
pkg/proxy/config/config.go:479:28
handlerRegistration, _ := nodeInformer.Informer().AddEventHandlerWithResyncPeriod( cache.ResourceEventHandlerFuncs{pkg/kubeapiserver/authorizer/modes/modes.go1
22:2doc-comment-period
pkg/kubeapiserver/authorizer/modes/modes.go:22:2
const ( // ModeAlwaysAllow is the mode to set all requests as authorized ModeAlwaysAllow string = "AlwaysAllow"pkg/scheduler/extender.go1
298:4early-return
pkg/scheduler/extender.go:298:4
for i, nodeName := range *result.NodeNames { if n, ok := fromNodeName[nodeName]; ok { nodeResult[i] = npkg/kubeapiserver/options/authentication_test.go1
1238:14error-strings
pkg/kubeapiserver/options/authentication_test.go:1238:14
if len(errs) == 0 && len(tt.expectErr) != 0 { t.Errorf("Got err nil, Expected err: %s", tt.expectErr) }pkg/kubeapiserver/authorizer/config.go1
185:6exported-declaration-comment
pkg/kubeapiserver/authorizer/config.go:185:6
func LoadAndValidateData(data []byte, compiler authorizationcel.Compiler, requireNonWebhookTypes sets.Set[authzconfig.AuthorizerType]) (*authzconfig.AuthorizationConfiguration, error) { // load the file and check for errorspkg/proxy/endpointslicecache_test.go1
1:1file-length-limit
pkg/proxy/endpointslicecache_test.go:1:1
/*Copyright 2019 The Kubernetes Authors.pkg/proxy/iptables/proxier_test.go1
1087:55flag-parameter
pkg/proxy/iptables/proxier_test.go:1087:55
// disabled by passing false for checkConsistency if you are passing a partial set of rules.func assertIPTablesRulesEqual(t *testing.T, line int, checkConsistency bool, expected, result string) { expected = strings.TrimLeft(expected, " \t\n")pkg/kubeapiserver/authorizer/reload.go1
1:1format
pkg/kubeapiserver/authorizer/reload.go:1:1
/*Copyright 2024 The Kubernetes Authors.- Fix (safe): run `strider fmt pkg/kubeapiserver/authorizer/reload.go`
pkg/kubeapiserver/options/authentication_test.go1
58:6function-length
pkg/kubeapiserver/options/authentication_test.go:58:6
func TestAuthenticationValidate(t *testing.T) { testCases := []struct {pkg/registry/core/namespace/storage/storage.go1
60:6function-result-limit
pkg/registry/core/namespace/storage/storage.go:60:6
// NewREST returns a RESTStorage object that will work against namespaces.func NewREST(optsGetter generic.RESTOptionsGetter) (*REST, *StatusREST, *FinalizeREST, error) { store := &genericregistry.Store{pkg/kubeapiserver/options/authentication.go1
746:2import-shadowing
pkg/kubeapiserver/options/authentication.go:746:2
// var openAPIV3SecuritySchemes spec3.SecuritySchemes authenticator, updateAuthenticationConfig, openAPIV2SecurityDefinitions, openAPIV3SecuritySchemes, err := authenticatorConfig.New(ctx) if err != nil {pkg/registry/core/service/storage/transaction_test.go1
82:6increment-decrement
pkg/registry/core/service/storage/transaction_test.go:82:6
revert: func() { temp = temp - 1 },pkg/proxy/ipvs/testing/fake.go1
90:3inefficient-map-lookup
pkg/proxy/ipvs/testing/fake.go:90:3
// create dummy interface if devName is not found in localAddress map h.localAddresses[devName] = make([]string, 0) return false, nilpkg/scheduler/backend/queue/scheduling_queue_test.go1
6012:50inefficient-sprintf
pkg/scheduler/backend/queue/scheduling_queue_test.go:6012:50
newPod := currentPod.DeepCopy() newPod.Annotations = map[string]string{"ver": fmt.Sprintf("%d", iter)} // Update is atomicpkg/kubeapiserver/options/authentication_test.go1
200:24insecure-url-scheme
pkg/kubeapiserver/options/authentication_test.go:200:24
KeyFiles: []string{"cert", "key"}, Issuers: []string{"http://foo.bar.com"}, JWKSURI: "http://baz.com",pkg/scheduler/backend/queue/backoff_queue.go1
42:20interface-method-limit
pkg/scheduler/backend/queue/backoff_queue.go:42:20
// Its methods that relies on the queues, take the lock inside.type backoffQueuer interface { // isEntityBackingoff returns true if an entity is still waiting for its backoff timer.pkg/scheduler/framework/preemption/executor_test.go1
771:8max-control-nesting
pkg/scheduler/framework/preemption/executor_test.go:771:8
if tt.expectedStatus == nil { if status != nil { t.Errorf("expect nil status, but got %v", status)pkg/proxy/node.go1
74:6max-parameters
pkg/proxy/node.go:74:6
// newNodeManager implements NewNodeManager with configurable exit function, poll interval and timeouts.func newNodeManager(ctx context.Context, client clientset.Interface, resyncInterval time.Duration, nodeName string, watchPodCIDRs bool, exitFunc func(int),pkg/registry/core/pod/storage/storage.go1
405:6max-public-structs
pkg/registry/core/pod/storage/storage.go:405:6
// ResizeREST implements the REST endpoint for resizing Pod containers.type ResizeREST struct { store *genericregistry.Storepkg/proxy/apis/config/v1alpha1/conversion.go1
32:2modifies-parameter
pkg/proxy/apis/config/v1alpha1/conversion.go:32:2
} out.WindowsRunAsService = in.Windows.RunAsService out.Conntrack = v1alpha1.KubeProxyConntrackConfiguration(in.Linux.Conntrack)pkg/registry/rbac/validation/rule_test.go1
52:39modifies-value-receiver
pkg/registry/rbac/validation/rule_test.go:52:39
func (b byHash) Less(i, j int) bool { return hashOf(b[i]) < hashOf(b[j]) }func (b byHash) Swap(i, j int) { b[i], b[j] = b[j], b[i] }pkg/kubeapiserver/options/authentication_test.go1
1651:17nested-structs
pkg/kubeapiserver/options/authentication_test.go:1651:17
testCases := []struct { desc stringpkg/registry/core/service/ipallocator/cidrallocator_test.go1
258:4nil-error-return
pkg/registry/core/service/ipallocator/cidrallocator_test.go:258:4
if err != nil { return false, nil }pkg/proxy/nftables/proxier.go1
127:3nil-value-with-nil-error
pkg/proxy/nftables/proxier.go:127:3
if initOnly { return nil, nil }pkg/scheduler/framework/plugins/dynamicresources/dynamicresources.go1
1364:4no-defer-in-loop
pkg/scheduler/framework/plugins/dynamicresources/dynamicresources.go:1364:4
} defer func() { if retStatus.IsSuccess() && successCleanup != nil {pkg/proxy/util/nfacct/nfacct_linux.go1
103:4no-else-after-return
pkg/proxy/util/nfacct/nfacct_linux.go:103:4
return handleError(err) } else { return ErrUnexpectedpkg/scheduler/backend/cache/cache_test.go1
57:6no-init
pkg/scheduler/backend/cache/cache_test.go:57:6
func init() { metrics.Register()pkg/proxy/ipvs/proxier.go1
713:3no-naked-return
pkg/proxy/ipvs/proxier.go:713:3
proxier.logger.Error(err, "Failed to create dummy interface", "interface", defaultDummyDevice) return }pkg/kubeapiserver/options/authentication.go2
873:2no-package-var
pkg/kubeapiserver/options/authentication.go:873:2
cfgScheme = runtime.NewScheme() codecs = serializer.NewCodecFactory(cfgScheme, serializer.EnableStrict))621:8optimize-operands-order
pkg/kubeapiserver/options/authentication.go:621:8
switch { case len(o.ServiceAccounts.KeyFiles) > 0 && o.ServiceAccounts.ExternalPublicKeysGetter != nil: return kubeauthenticator.Config{}, fmt.Errorf("cannot set mutually exclusive flags `--service-account-key-file` and `--service-account-signing-endpoint` at the same time")pkg/registry/rbac/clusterrolebinding/strategy.go1
66:2overwritten-before-use
pkg/registry/rbac/clusterrolebinding/strategy.go:66:2
newClusterRoleBinding := obj.(*rbac.ClusterRoleBinding) oldClusterRoleBinding := old.(*rbac.ClusterRoleBinding)pkg/kubeapiserver/default_storage_factory_builder.go1
17:9package-comments
pkg/kubeapiserver/default_storage_factory_builder.go:17:9
package kubeapiserverpkg/scheduler/framework/autoscaler_contract/lister_contract_test.go1
21:9package-directory-mismatch
pkg/scheduler/framework/autoscaler_contract/lister_contract_test.go:21:9
package contractpkg/scheduler/backend/queue/scheduling_queue_test.go1
5564:65possible-nil-dereference
pkg/scheduler/backend/queue/scheduling_queue_test.go:5564:65
if !cmp.Equal(pInfo.Pod, tt.expectedPod) { t.Errorf("Expected pod=%v, but got pod=%v", tt.expectedPod, pInfo.Pod) }pkg/proxy/healthcheck/service_health.go1
156:6range-value-address
pkg/proxy/healthcheck/service_health.go:156:6
hcs.recorder.Eventf( &v1.ObjectReference{ APIVersion: "v1",pkg/registry/rbac/clusterrole/policybased/storage.go1
73:7receiver-naming
pkg/registry/rbac/clusterrole/policybased/storage.go:73:7
func (s *Storage) Create(ctx context.Context, obj runtime.Object, createValidatingAdmission rest.ValidateObjectFunc, options *metav1.CreateOptions) (runtime.Object, error) { if rbacregistry.EscalationAllowed(ctx) || rbacregistry.RoleEscalationAuthorized(ctx, s.authorizer) {pkg/proxy/iptables/proxier_test.go1
742:3redefines-builtin-id
pkg/proxy/iptables/proxier_test.go:742:3
output string error string }{pkg/proxy/apis/config/validation/validation_test.go1
414:106redundant-conversion
pkg/proxy/apis/config/validation/validation_test.go:414:106
}, expectedErrs: field.ErrorList{field.Invalid(newPath.Child("KubeProxyLinuxConfiguration.OOMScoreAdj"), int32(1001), "must be within the range [-1000, 1000]")}, },pkg/proxy/endpointslicecache_test.go1
25:2redundant-import-alias
pkg/proxy/endpointslicecache_test.go:25:2
v1 "k8s.io/api/core/v1" discovery "k8s.io/api/discovery/v1"pkg/proxy/apis/config/v1alpha1/conversion.go1
42:2single-case-switch
pkg/proxy/apis/config/v1alpha1/conversion.go:42:2
switch in.Mode { case kubeproxyconfig.ProxyModeIPVS:pkg/proxy/ipvs/proxier_test.go1
3640:3slice-preallocation
pkg/proxy/ipvs/proxier_test.go:3640:3
} expectedEntries := []string{} for _, entry := range entries {pkg/proxy/apis/config/validation/validation_test.go1
500:2task-comment
pkg/proxy/apis/config/validation/validation_test.go:500:2
func testValidateProxyModeWindows(t *testing.T) { // TODO: remove skip once the test has been fixed. if runtime.GOOS == "windows" {pkg/kubeapiserver/options/authentication_test.go1
314:6test-parallelism
pkg/kubeapiserver/options/authentication_test.go:314:6
func TestToAuthenticationConfig(t *testing.T) { testOptions := &BuiltInAuthenticationOptions{pkg/kubeapiserver/options/options.go1
33:1top-level-declaration-order
pkg/kubeapiserver/options/options.go:33:1
// DefaultEtcdPathPrefix is the default key prefix of etcd for API Serverconst DefaultEtcdPathPrefix = "/registry"pkg/proxy/ipvs/proxier_test.go1
1997:22unchecked-type-assertion
pkg/proxy/ipvs/proxier_test.go:1997:22
fp.networkInterfacer.(*proxyutiltest.FakeNetwork).AddInterfaceAddr(&itf, addrs) fp.networkInterfacer.(*proxyutiltest.FakeNetwork).AddInterfaceAddr(&itf1, addrs1) fp.nodePortAddresses = proxyutil.NewNodePortAddresses(v1.IPv4Protocol, []string{"100.101.102.0/24"})pkg/registry/admissionregistration/validatingadmissionpolicybinding/strategy.go1
57:136unexported-return
pkg/registry/admissionregistration/validatingadmissionpolicybinding/strategy.go:57:136
// NewStrategy is the default logic that applies when creating and updating ValidatingAdmissionPolicyBinding objects.func NewStrategy(authorizer authorizer.UnconditionalAuthorizer, policyGetter PolicyGetter, resourceResolver resolver.ResourceResolver) *validatingAdmissionPolicyBindingStrategy { return &validatingAdmissionPolicyBindingStrategy{pkg/proxy/conntrack/fake.go1
51:46unused-parameter
pkg/proxy/conntrack/fake.go:51:46
func (f *fakeHandler) ConntrackDeleteFilters(tableType netlink.ConntrackTableType, family netlink.InetFamily, netlinkFilters ...netlink.CustomConntrackFilter) (uint, error) { f.mu.Lock()pkg/proxy/healthcheck/healthcheck_test.go1
76:7unused-receiver
pkg/proxy/healthcheck/healthcheck_test.go:76:7
func (fa fakeAddr) Network() string { return "tcp"pkg/proxy/config/config.go1
224:60use-any
pkg/proxy/config/config.go:224:60
func (c *ServiceConfig) handleUpdateService(oldObj, newObj interface{}) { oldService, ok := oldObj.(*v1.Service)pkg/kubeapiserver/options/admission.go1
98:23use-errors-new
pkg/kubeapiserver/options/admission.go:98:23
(a.GenericAdmission.EnablePlugins != nil || a.GenericAdmission.DisablePlugins != nil) { errs = append(errs, fmt.Errorf("admission-control and enable-admission-plugins/disable-admission-plugins flags are mutually exclusive")) }pkg/proxy/iptables/proxier_test.go1
709:3use-slices-sort
pkg/proxy/iptables/proxier_test.go:709:3
if chain != nil { sort.SliceStable(chain.Rules, func(i, j int) bool { return orderByCommentServiceName(chain.Rules[i], chain.Rules[j])pkg/proxy/endpointschangetracker_test.go1
382:2var-naming
pkg/proxy/endpointschangetracker_test.go:382:2
} multipleSubsetsIPsPorts1_s2 := func(eps *discovery.EndpointSlice) { eps.Endpoints = []discovery.Endpoint{{pkg/kubeapiserver/options/admission_test.go1
80:38add-constant
pkg/kubeapiserver/options/admission_test.go:80:38
name: "choose one", all: []string{"one", "two"}, enabled: []string{"one"},pkg/scheduler/backend/heap/heap_test.go1
254:44boolean-literal-comparison
pkg/scheduler/backend/heap/heap_test.go:254:44
h := New(testHeapObjectKeyFunc, compareInts) if got := h.Has(mkHeapObj("foo", 0, 1)); got != false { t.Errorf("Has(%q) = %v, want %v", "foo", got, false)pkg/kubeapiserver/options/authentication.go1
670:40cognitive-complexity
pkg/kubeapiserver/options/authentication.go:670:40
// The input context controls the lifecycle of background goroutines started to reload the authentication config file.func (o *BuiltInAuthenticationOptions) ApplyTo( ctx context.Context,pkg/registry/core/service/ipallocator/bitmap.go1
214:17confusing-naming
pkg/registry/core/service/ipallocator/bitmap.go:214:17
func (r *Range) allocateNext(dryRun bool) (net.IP, error) { label := r.CIDR()pkg/scheduler/framework/plugins/interpodaffinity/filtering.go1
246:163confusing-results
pkg/scheduler/framework/plugins/interpodaffinity/filtering.go:246:163
// need to check all the pods in the cluster.func (pl *InterPodAffinity) getIncomingAffinityAntiAffinityCounts(ctx context.Context, podInfo fwk.PodInfo, allNodes []fwk.NodeInfo) (topologyToMatchedTermCount, topologyToMatchedTermCount) { affinityCounts := make(topologyToMatchedTermCount)pkg/proxy/util/localdetector.go1
97:6constructor-interface-return
pkg/proxy/util/localdetector.go:97:6
// non-local.func NewDetectLocalByBridgeInterface(interfaceName string) LocalTrafficDetector { return &detectLocal{pkg/proxy/apis/config/v1alpha1/defaults.go1
39:6cyclomatic-complexity
pkg/proxy/apis/config/v1alpha1/defaults.go:39:6
func SetDefaults_KubeProxyConfiguration(obj *kubeproxyconfigv1alpha1.KubeProxyConfiguration) {pkg/registry/certificates/podcertificaterequest/storage/storage_test.go1
106:5deprecated-api-usage
pkg/registry/certificates/podcertificaterequest/storage/storage_test.go:106:5
MaxExpirationSeconds: ptr.To[int32](86400), PKIXPublicKey: ed25519PubPKIX1, ProofOfPossession: ed25519Proof1,pkg/proxy/conntrack/cleanup_test.go1
327:22discarded-error-result
pkg/proxy/conntrack/cleanup_test.go:327:22
CleanStaleEntries(ct, testIPFamily, svcPortMap, endpointsMap) actualEntries, _ := ct.ListEntries(ipFamilyMap[testIPFamily])pkg/kubeapiserver/authorizer/modes/modes.go1
24:2doc-comment-period
pkg/kubeapiserver/authorizer/modes/modes.go:24:2
ModeAlwaysAllow string = "AlwaysAllow" // ModeAlwaysDeny is the mode to set no requests as authorized ModeAlwaysDeny string = "AlwaysDeny"pkg/scheduler/framework/plugins/dynamicresources/nodeallocatabledynamicresources.go1
158:6early-return
pkg/scheduler/framework/plugins/dynamicresources/nodeallocatabledynamicresources.go:158:6
} if consumed, exists := result.ConsumedCapacity[capacityKey]; exists { quantity = consumed.DeepCopy()pkg/kubeapiserver/options/authentication_test.go1
1241:14error-strings
pkg/kubeapiserver/options/authentication_test.go:1241:14
if len(errs) > 0 && len(tt.expectErr) == 0 { t.Errorf("Got err: %v, Expected err nil", errs) }pkg/kubeapiserver/authorizer/reload.go1
81:40exported-declaration-comment
pkg/kubeapiserver/authorizer/reload.go:81:40
func (r *reloadableAuthorizerResolver) Authorize(ctx context.Context, a authorizer.Attributes) (authorized authorizer.Decision, reason string, err error) { return r.current.Load().authorizer.Authorize(ctx, a)pkg/proxy/healthcheck/healthcheck_test.go1
1:1file-length-limit
pkg/proxy/healthcheck/healthcheck_test.go:1:1
/*Copyright 2016 The Kubernetes Authors.pkg/proxy/ipvs/ipset.go1
103:80flag-parameter
pkg/proxy/ipvs/ipset.go:103:80
// NewIPSet initialize a new IPSet structfunc NewIPSet(handle utilipset.Interface, name string, setType utilipset.Type, isIPv6 bool, comment string) *IPSet { hashFamily := utilipset.ProtocolFamilyIPV4pkg/kubeapiserver/default_storage_factory_builder.go1
1:1format
pkg/kubeapiserver/default_storage_factory_builder.go:1:1
/*Copyright 2016 The Kubernetes Authors.- Fix (safe): run `strider fmt pkg/kubeapiserver/default_storage_factory_builder.go`
pkg/kubeapiserver/options/authentication_test.go1
314:6function-length
pkg/kubeapiserver/options/authentication_test.go:314:6
func TestToAuthenticationConfig(t *testing.T) { testOptions := &BuiltInAuthenticationOptions{pkg/registry/core/pod/storage/storage_test.go1
55:6function-result-limit
pkg/registry/core/pod/storage/storage_test.go:55:6
func newStorage(t *testing.T) (*REST, *BindingREST, *StatusREST, *etcd3testing.EtcdTestServer) { etcdStorage, server := registrytest.NewEtcdStorage(t, "")pkg/kubeapiserver/options/authorization_test.go1
39:3import-shadowing
pkg/kubeapiserver/options/authorization_test.go:39:3
name string modes []string policyFile stringpkg/registry/core/service/storage/transaction_test.go1
105:6increment-decrement
pkg/registry/core/service/storage/transaction_test.go:105:6
commit: func() { temp = temp + 1 },pkg/registry/batch/job/strategy.go1
236:3inefficient-map-lookup
pkg/registry/batch/job/strategy.go:236:3
if _, found := obj.Spec.Selector.MatchLabels[batch.ControllerUidLabel]; !found { obj.Spec.Selector.MatchLabels[batch.ControllerUidLabel] = string(obj.ObjectMeta.UID) }pkg/scheduler/framework/parallelize/parallelism_test.go1
53:9inefficient-sprintf
pkg/scheduler/framework/parallelize/parallelism_test.go:53:9
for _, test := range tests { t.Run(fmt.Sprintf("%d", test.input), func(t *testing.T) { if chunkSizeFor(test.input, DefaultParallelism) != test.wantOutput {pkg/kubeapiserver/options/authentication_test.go1
201:15insecure-url-scheme
pkg/kubeapiserver/options/authentication_test.go:201:15
Issuers: []string{"http://foo.bar.com"}, JWKSURI: "http://baz.com", },pkg/scheduler/backend/queue/scheduling_queue.go1
96:22interface-method-limit
pkg/scheduler/backend/queue/scheduling_queue.go:96:22
// makes it easy to use those data structures as a SchedulingQueue.type SchedulingQueue interface { fwk.PodNominatorpkg/scheduler/framework/preemption/executor_test.go1
775:8max-control-nesting
pkg/scheduler/framework/preemption/executor_test.go:775:8
} else { if !cmp.Equal(status, tt.expectedStatus) { t.Errorf("expect status %v, but got %v", tt.expectedStatus, status)pkg/proxy/winkernel/hns.go1
545:16max-parameters
pkg/proxy/winkernel/hns.go:545:16
func (hns hns) updateLoadBalancer(hnsID string, sourceVip,pkg/scheduler/apis/config/types.go1
213:6max-public-structs
pkg/scheduler/apis/config/types.go:213:6
// It is up to the plugin to process these Args.type PluginConfig struct { // Name defines the name of plugin being configuredpkg/proxy/apis/config/v1alpha1/conversion.go1
33:2modifies-parameter
pkg/proxy/apis/config/v1alpha1/conversion.go:33:2
out.WindowsRunAsService = in.Windows.RunAsService out.Conntrack = v1alpha1.KubeProxyConntrackConfiguration(in.Linux.Conntrack) out.OOMScoreAdj = in.Linux.OOMScoreAdjpkg/registry/rbac/validation/rule_test.go1
52:45modifies-value-receiver
pkg/registry/rbac/validation/rule_test.go:52:45
func (b byHash) Less(i, j int) bool { return hashOf(b[i]) < hashOf(b[j]) }func (b byHash) Swap(i, j int) { b[i], b[j] = b[j], b[i] }pkg/kubeapiserver/options/authorization_test.go1
37:17nested-structs
pkg/kubeapiserver/options/authorization_test.go:37:17
testCases := []struct { name stringpkg/registry/core/service/ipallocator/cidrallocator_test.go1
303:4nil-error-return
pkg/registry/core/service/ipallocator/cidrallocator_test.go:303:4
if err != nil { return false, nil }pkg/proxy/nftables/proxier.go1
221:3nil-value-with-nil-error
pkg/proxy/nftables/proxier.go:221:3
logger.Info("System initialized and --init-only specified") return nil, nil }pkg/proxy/winkernel/proxier.go1
358:4no-else-after-return
pkg/proxy/winkernel/proxier.go:358:4
return fmt.Sprintf("%v-%02x-%02x-%02x-%02x", macPrefix, a, b, c, d) } else if ip6 := ip.To16(); ip6 != nil { a, b, c, d := ip6[15], ip6[14], ip6[13], ip6[12]pkg/scheduler/backend/queue/scheduling_queue_test.go1
108:6no-init
pkg/scheduler/backend/queue/scheduling_queue_test.go:108:6
func init() { metrics.Register()pkg/proxy/ipvs/proxier.go1
719:4no-naked-return
pkg/proxy/ipvs/proxier.go:719:4
if err := ensureIPSet(set); err != nil { return }pkg/kubeapiserver/options/options.go1
27:5no-package-var
pkg/kubeapiserver/options/options.go:27:5
// DefaultServiceNodePortRange is the default port range for NodePort services.var DefaultServiceNodePortRange = utilnet.PortRange{Base: 30000, Size: 2768}pkg/kubeapiserver/options/authentication.go1
655:6optimize-operands-order
pkg/kubeapiserver/options/authentication.go:655:6
if len(o.WebHook.ConfigFile) > 0 && o.WebHook.CacheTTL > 0 { if o.TokenSuccessCacheTTL > 0 && o.WebHook.CacheTTL < o.TokenSuccessCacheTTL {pkg/registry/rbac/role/strategy.go1
65:2overwritten-before-use
pkg/registry/rbac/role/strategy.go:65:2
func (strategy) PrepareForUpdate(ctx context.Context, obj, old runtime.Object) { newRole := obj.(*rbac.Role) oldRole := old.(*rbac.Role)pkg/kubeapiserver/options/admission.go1
17:9package-comments
pkg/kubeapiserver/options/admission.go:17:9
package optionspkg/scheduler/framework/plugins/interpodaffinity/plugin.go1
223:105possible-nil-dereference
pkg/scheduler/framework/plugins/interpodaffinity/plugin.go:223:105
originalPodAntiTerms, err := fwk.GetAffinityTerms(originalPod, fwk.GetPodAntiAffinityTerms(originalPod.Spec.Affinity)) if err != nil {pkg/proxy/iptables/proxier_test.go1
671:12range-value-address
pkg/proxy/iptables/proxier_test.go:671:12
for t := range dump.Tables { table := &dump.Tables[t] sort.Slice(table.Chains, func(i, j int) bool {pkg/registry/rbac/clusterrole/policybased/storage.go1
93:7receiver-naming
pkg/registry/rbac/clusterrole/policybased/storage.go:93:7
func (s *Storage) Update(ctx context.Context, name string, obj rest.UpdatedObjectInfo, createValidation rest.ValidateObjectFunc, updateValidation rest.ValidateObjectUpdateFunc, forceAllowCreate bool, options *metav1.UpdateOptions) (runtime.Object, bool, error) { if rbacregistry.EscalationAllowed(ctx) || rbacregistry.RoleEscalationAuthorized(ctx, s.authorizer) {pkg/registry/certificates/clustertrustbundle/strategy.go1
67:57redefines-builtin-id
pkg/registry/certificates/clustertrustbundle/strategy.go:67:57
func (s strategy) PrepareForUpdate(ctx context.Context, new, old runtime.Object) {}pkg/proxy/apis/config/validation/validation_test.go1
440:10redundant-conversion
pkg/proxy/apis/config/validation/validation_test.go:440:10
"blank mode should default": { mode: kubeproxyconfig.ProxyMode(""), },pkg/proxy/healthcheck/healthcheck_test.go1
31:2redundant-import-alias
pkg/proxy/healthcheck/healthcheck_test.go:31:2
v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"pkg/proxy/apis/config/v1alpha1/conversion.go1
68:2single-case-switch
pkg/proxy/apis/config/v1alpha1/conversion.go:68:2
out.Linux.OOMScoreAdj = in.OOMScoreAdj switch kubeproxyconfig.ProxyMode(in.Mode) { case kubeproxyconfig.ProxyModeNFTables:pkg/proxy/ipvs/util/testing/fake.go1
144:2slice-preallocation
pkg/proxy/ipvs/util/testing/fake.go:144:2
func (f *FakeIPVS) GetVirtualServers() ([]*utilipvs.VirtualServer, error) { res := make([]*utilipvs.VirtualServer, 0) for _, svc := range f.Services {pkg/proxy/config/config_test.go1
860:1task-comment
pkg/proxy/config/config_test.go:860:1
// TODO: Add a unittest for interrupts getting processed in a timely manner.pkg/kubeapiserver/options/authentication_test.go1
422:6test-parallelism
pkg/kubeapiserver/options/authentication_test.go:422:6
func TestBuiltInAuthenticationOptionsAddFlags(t *testing.T) { var args = []string{pkg/proxy/apis/config/types.go1
252:1top-level-declaration-order
pkg/proxy/apis/config/types.go:252:1
const ( ProxyModeIPTables ProxyMode = "iptables"pkg/proxy/winkernel/hns.go1
660:11unchecked-type-assertion
pkg/proxy/winkernel/hns.go:660:11
if r := recover(); r != nil { err = r.(error) hash = [20]byte{}pkg/registry/core/rest/storage_core.go1
111:68unexported-return
pkg/registry/core/rest/storage_core.go:111:68
func New(c Config, authorizer authorizer.UnconditionalAuthorizer) (*legacyProvider, error) { rangeRegistries, serviceClusterIPAllocator, serviceIPAllocators, serviceNodePortAllocator, err := c.newServiceIPAllocators()pkg/proxy/conntrack/fake.go1
51:84unused-parameter
pkg/proxy/conntrack/fake.go:51:84
func (f *fakeHandler) ConntrackDeleteFilters(tableType netlink.ConntrackTableType, family netlink.InetFamily, netlinkFilters ...netlink.CustomConntrackFilter) (uint, error) { f.mu.Lock()pkg/proxy/healthcheck/healthcheck_test.go1
79:7unused-receiver
pkg/proxy/healthcheck/healthcheck_test.go:79:7
}func (fa fakeAddr) String() string { return "<test>"pkg/proxy/config/config.go1
241:49use-any
pkg/proxy/config/config.go:241:49
func (c *ServiceConfig) handleDeleteService(obj interface{}) { service, ok := obj.(*v1.Service)pkg/kubeapiserver/options/authentication.go1
267:35use-errors-new
pkg/kubeapiserver/options/authentication.go:267:35
if issuer == "" { allErrors = append(allErrors, fmt.Errorf("service-account-issuer should not be an empty string")) continuepkg/proxy/iptables/proxier_test.go1
718:3use-slices-sort
pkg/proxy/iptables/proxier_test.go:718:3
if chain != nil { sort.SliceStable(chain.Rules, func(i, j int) bool { return orderByCommentServiceName(chain.Rules[i], chain.Rules[j])pkg/proxy/endpointschangetracker_test.go1
426:2var-naming
pkg/proxy/endpointschangetracker_test.go:426:2
} complexBefore2_s1 := func(eps *discovery.EndpointSlice) { eps.Endpoints = []discovery.Endpoint{{pkg/kubeapiserver/options/authentication_test.go1
106:20add-constant
pkg/kubeapiserver/options/authentication_test.go:106:20
testOIDC: &OIDCAuthenticationOptions{ UsernameClaim: "sub", SigningAlgs: []string{"RS256"},pkg/scheduler/backend/heap/heap_test.go1
262:44boolean-literal-comparison
pkg/scheduler/backend/heap/heap_test.go:262:44
h.AddOrUpdate(mkHeapObj("bar", 1, 1)) if got := h.Has(mkHeapObj("foo", 0, 1)); got != false { t.Errorf("Has(%q) = %v, want %v", "foo", got, false)pkg/kubeapiserver/options/authentication_test.go1
58:6cognitive-complexity
pkg/kubeapiserver/options/authentication_test.go:58:6
func TestAuthenticationValidate(t *testing.T) { testCases := []struct {pkg/registry/core/service/ipallocator/bitmap.go1
250:17confusing-naming
pkg/registry/core/service/ipallocator/bitmap.go:250:17
func (r *Range) release(ip net.IP, dryRun bool) error { ok, offset := r.contains(ip)pkg/scheduler/framework/plugins/noderesources/resource_allocation.go1
319:11confusing-results
pkg/scheduler/framework/plugins/noderesources/resource_allocation.go:319:11
draPreScoreState *draPreScoreState,) (int64, int64) { logger := klog.FromContext(ctx)pkg/proxy/util/localdetector.go1
109:6constructor-interface-return
pkg/proxy/util/localdetector.go:109:6
// traffic from other interfaces to be non-local.func NewDetectLocalByInterfaceNamePrefix(interfacePrefix string) LocalTrafficDetector { return &detectLocal{pkg/proxy/conntrack/cleanup.go1
45:6cyclomatic-complexity
pkg/proxy/conntrack/cleanup.go:45:6
// based on the current Services and Endpoints.func CleanStaleEntries(ct Interface, ipFamily v1.IPFamily, svcPortMap proxy.ServicePortMap, endpointsMap proxy.EndpointsMap) {pkg/registry/certificates/podcertificaterequest/storage/storage_test.go1
107:5deprecated-api-usage
pkg/registry/certificates/podcertificaterequest/storage/storage_test.go:107:5
PKIXPublicKey: ed25519PubPKIX1, ProofOfPossession: ed25519Proof1, UnverifiedUserAnnotations: map[string]string{"test/foo": "bar"},pkg/proxy/conntrack/cleanup_test.go1
434:22discarded-error-result
pkg/proxy/conntrack/cleanup_test.go:434:22
CleanStaleEntries(ct, testIPFamily, svcPortMap, endpointsMap) actualEntries, _ := ct.ListEntries(ipFamilyMap[testIPFamily]) if len(actualEntries) != expectedEntries {pkg/kubeapiserver/authorizer/modes/modes.go1
26:2doc-comment-period
pkg/kubeapiserver/authorizer/modes/modes.go:26:2
ModeAlwaysDeny string = "AlwaysDeny" // ModeABAC is the mode to use Attribute Based Access Control to authorize ModeABAC string = "ABAC"pkg/scheduler/framework/plugins/interpodaffinity/filtering.go1
397:3early-return
pkg/scheduler/framework/plugins/interpodaffinity/filtering.go:397:3
for _, term := range state.podInfo.GetRequiredAffinityTerms() { if topologyValue, ok := nodeInfo.Node().Labels[term.TopologyKey]; ok { tp := topologyPair{key: term.TopologyKey, value: topologyValue}pkg/proxy/apis/config/v1alpha1/defaults_test.go1
136:14error-strings
pkg/proxy/apis/config/v1alpha1/defaults_test.go:136:14
if diff := cmp.Diff(tc.expected, tc.original); diff != "" { t.Errorf("Got unexpected defaults (-want, +got):\n%s", diff) }pkg/kubeapiserver/authorizer/reload.go1
95:40exported-declaration-comment
pkg/kubeapiserver/authorizer/reload.go:95:40
func (r *reloadableAuthorizerResolver) RulesFor(ctx context.Context, user user.Info, namespace string) ([]authorizer.ResourceRuleInfo, []authorizer.NonResourceRuleInfo, bool, error) { return r.current.Load().ruleResolver.RulesFor(ctx, user, namespace)pkg/proxy/iptables/proxier.go1
1:1file-length-limit
pkg/proxy/iptables/proxier.go:1:1
//go:build linuxpkg/proxy/ipvs/ipset/ipset.go1
300:45flag-parameter
pkg/proxy/ipvs/ipset/ipset.go:300:45
// otherwise raised when the same set (setname and create parameters are identical) already exists.func (runner *runner) createSet(set *IPSet, ignoreExistErr bool) error { args := []string{"create", set.Name, string(set.SetType)}pkg/kubeapiserver/options/admission.go1
1:1format
pkg/kubeapiserver/options/admission.go:1:1
/*Copyright 2018 The Kubernetes Authors.- Fix (safe): run `strider fmt pkg/kubeapiserver/options/admission.go`
pkg/kubeapiserver/options/authentication_test.go1
422:6function-length
pkg/kubeapiserver/options/authentication_test.go:422:6
func TestBuiltInAuthenticationOptionsAddFlags(t *testing.T) { var args = []string{pkg/registry/core/rest/storage_core.go1
332:18function-result-limit
pkg/registry/core/rest/storage_core.go:332:18
func (c *Config) newServiceIPAllocators() (registries rangeRegistries, primaryClusterIPAllocator ipallocator.Interface, clusterIPAllocators map[api.IPFamily]ipallocator.Interface, nodePortAllocator *portallocator.PortAllocator, err error) { clusterIPAllocators = map[api.IPFamily]ipallocator.Interface{}pkg/proxy/config/config_test.go1
291:6import-shadowing
pkg/proxy/config/config_test.go:291:6
// if the consumer falls behind. Unittests will hard timeout in 5m. var slices []*discoveryv1.EndpointSlice for {pkg/registry/core/service/storage/transaction_test.go1
108:6increment-decrement
pkg/registry/core/service/storage/transaction_test.go:108:6
revert: func() { temp = temp - 1 },pkg/registry/core/pod/strategy.go1
254:4inefficient-map-lookup
pkg/registry/core/pod/strategy.go:254:4
oldGeneration = oldGenerations[0] oldConditionGenerations[newCondition.Type] = oldGenerations[1:] }pkg/scheduler/framework/plugins/dynamicresources/dynamicresources_test.go1
4232:27inefficient-sprintf
pkg/scheduler/framework/plugins/dynamicresources/dynamicresources_test.go:4232:27
inUseUIDs.Insert(obj.GetUID()) obj.SetResourceVersion(fmt.Sprintf("%d", resourceVersionCounter)) resourceVersionCounter++pkg/kubeapiserver/options/authentication_test.go1
216:24insecure-url-scheme
pkg/kubeapiserver/options/authentication_test.go:216:24
KeyFiles: []string{"cert", "key"}, Issuers: []string{"http://foo.bar.com"}, JWKSURI: "https://baz.com",pkg/scheduler/framework/interface.go1
191:16interface-method-limit
pkg/scheduler/framework/interface.go:191:16
// Configured plugins are called at specified points in a scheduling context.type Framework interface { fwk.Handlepkg/scheduler/framework/preemption/executor_test.go1
804:8max-control-nesting
pkg/scheduler/framework/preemption/executor_test.go:804:8
if asyncPreemptionEnabled { if diff := cmp.Diff(tt.expectedActivatedPods, fakeActivator.activatedPods); tt.expectedActivatedPods != nil && diff != "" { lastErrMsg = fmt.Sprintf("Unexpected activated pods (-want,+got):\n%s", diff)pkg/proxy/winkernel/proxier.go1
734:6max-parameters
pkg/proxy/winkernel/proxier.go:734:6
// allow internal testing of proxierfunc newProxierInternal( ipFamily v1.IPFamily,pkg/scheduler/apis/config/types.go1
271:6max-public-structs
pkg/scheduler/apis/config/types.go:271:6
// it is assumed that the extender chose not to provide that extension.type Extender struct { // URLPrefix at which the extender is availablepkg/proxy/apis/config/v1alpha1/conversion.go1
34:2modifies-parameter
pkg/proxy/apis/config/v1alpha1/conversion.go:34:2
out.Conntrack = v1alpha1.KubeProxyConntrackConfiguration(in.Linux.Conntrack) out.OOMScoreAdj = in.Linux.OOMScoreAdj switch in.Mode {pkg/scheduler/framework/plugins/dynamicresources/claims.go1
133:2modifies-value-receiver
pkg/scheduler/framework/plugins/dynamicresources/claims.go:133:2
func (cs claimStore) set(i int, c *resourceapi.ResourceClaim) { cs.claims[i] = c}pkg/proxy/apis/config/v1alpha1/defaults_test.go1
37:17nested-structs
pkg/proxy/apis/config/v1alpha1/defaults_test.go:37:17
ctMin := int32(131072) testCases := []struct { name stringpkg/registry/core/service/ipallocator/cidrallocator_test.go1
341:4nil-error-return
pkg/registry/core/service/ipallocator/cidrallocator_test.go:341:4
if err != nil { return false, nil }pkg/registry/core/pod/storage/eviction_test.go1
1009:2nil-value-with-nil-error
pkg/registry/core/pod/storage/eviction_test.go:1009:2
func (ms *mockStore) Watch(ctx context.Context, options *metainternalversion.ListOptions) (watch.Interface, error) { return nil, nil}pkg/registry/admissionregistration/rest/storage_apiserver.go1
52:4no-else-after-return
pkg/registry/admissionregistration/rest/storage_apiserver.go:52:4
return genericapiserver.APIGroupInfo{}, err } else if len(storageMap) > 0 { apiGroupInfo.VersionedResourcesStorageMap[admissionregistrationv1.SchemeGroupVersion.Version] = storageMappkg/scheduler/framework/plugins/defaultbinder/default_binder_test.go1
42:6no-init
pkg/scheduler/framework/plugins/defaultbinder/default_binder_test.go:42:6
func init() { metrics.Register()pkg/proxy/ipvs/proxier.go1
1197:3no-naked-return
pkg/proxy/ipvs/proxier.go:1197:3
metrics.IPTablesRestoreFailuresTotal.WithLabelValues(string(proxier.ipFamily)).Inc() return }pkg/kubeapiserver/options/options.go1
30:5no-package-var
pkg/kubeapiserver/options/options.go:30:5
// DefaultServiceIPCIDR is a CIDR notation of IP range from which to allocate service cluster IPsvar DefaultServiceIPCIDR = net.IPNet{IP: netutils.ParseIPSloppy("10.0.0.0"), Mask: net.CIDRMask(24, 32)}pkg/kubeapiserver/options/authentication.go1
706:5optimize-operands-order
pkg/kubeapiserver/options/authentication.go:706:5
authInfo.APIAudiences = o.APIAudiences if o.ServiceAccounts != nil && len(o.ServiceAccounts.Issuers) != 0 && len(o.APIAudiences) == 0 { authInfo.APIAudiences = authenticator.Audiences(o.ServiceAccounts.Issuers)pkg/registry/rbac/role/strategy.go1
66:2overwritten-before-use
pkg/registry/rbac/role/strategy.go:66:2
newRole := obj.(*rbac.Role) oldRole := old.(*rbac.Role)pkg/kubeapiserver/options/authentication.go1
17:9package-comments
pkg/kubeapiserver/options/authentication.go:17:9
package optionspkg/scheduler/framework/plugins/nodeaffinity/node_affinity.go1
161:36possible-nil-dereference
pkg/scheduler/framework/plugins/nodeaffinity/node_affinity.go:161:36
if noNodeAffinity || len(affinity.NodeAffinity.RequiredDuringSchedulingIgnoredDuringExecution.NodeSelectorTerms) == 0 { return nil, nilpkg/proxy/ipvs/proxier.go1
864:13range-value-address
pkg/proxy/ipvs/proxier.go:864:13
// ipset call entry := &utilipset.Entry{ IP: externalIP.String(),pkg/registry/rbac/clusterrole/policybased/storage.go1
130:7receiver-naming
pkg/registry/rbac/clusterrole/policybased/storage.go:130:7
func (s *Storage) GetSingularName() string { snp, ok := s.StandardStorage.(rest.SingularNameProvider)pkg/registry/certificates/clustertrustbundle/strategy.go1
69:55redefines-builtin-id
pkg/registry/certificates/clustertrustbundle/strategy.go:69:55
func (s strategy) ValidateUpdate(ctx context.Context, new, old runtime.Object) field.ErrorList { newBundle := new.(*certificates.ClusterTrustBundle)pkg/proxy/apis/config/validation/validation_test.go1
482:18redundant-conversion
pkg/proxy/apis/config/validation/validation_test.go:482:18
"invalid mode non-existent": { mode: kubeproxyconfig.ProxyMode("non-existing"), expectedErrs: field.ErrorList{field.Invalid(newPath.Child("ProxyMode"), "non-existing", "must be iptables, ipvs, nftables or blank (blank means the best-available proxy [currently iptables])")},pkg/proxy/healthcheck/proxy_health.go1
27:2redundant-import-alias
pkg/proxy/healthcheck/proxy_health.go:27:2
v1 "k8s.io/api/core/v1" "k8s.io/klog/v2"pkg/proxy/apis/config/v1alpha1/conversion.go1
75:2single-case-switch
pkg/proxy/apis/config/v1alpha1/conversion.go:75:2
switch kubeproxyconfig.ProxyMode(in.Mode) { case kubeproxyconfig.ProxyModeIPVS:pkg/proxy/servicechangetracker_test.go1
87:6slice-preallocation
pkg/proxy/servicechangetracker_test.go:87:6
func makeIPs(ipStr ...string) []net.IP { var ips []net.IP for _, s := range ipStr {pkg/proxy/endpointschangetracker.go1
105:3task-comment
pkg/proxy/endpointschangetracker.go:105:3
// we want to measure. So we simply ignore it in this cases. // TODO(wojtek-t, robscott): Address the problem for EndpointSlice deletion // when other EndpointSlice for that service still exist.pkg/kubeapiserver/options/authentication_test.go1
513:6test-parallelism
pkg/kubeapiserver/options/authentication_test.go:513:6
func TestWithTokenGetterFunction(t *testing.T) { fakeClientset := fake.NewSimpleClientset()pkg/proxy/config/config.go1
167:1top-level-declaration-order
pkg/proxy/config/config.go:167:1
// ServiceConfig tracks a set of service configurations.type ServiceConfig struct { listerSynced cache.InformerSyncedpkg/proxy/winkernel/proxier_test.go1
490:22unchecked-type-assertion
pkg/proxy/winkernel/proxier_test.go:490:22
hcn := (proxier.hcn).(*fakehcn.HcnMock) // Populating the endpoint to the cache, since it's a local endpoint and local endpoints are managed by CNI and not KubeProxypkg/registry/flowcontrol/ensurer/flowschema_test.go1
396:49unexported-return
pkg/registry/flowcontrol/ensurer/flowschema_test.go:396:49
func (b *fsBuilder) WithGeneration(value int64) *fsBuilder { b.object.SetGeneration(value)pkg/proxy/conntrack/sysctls_test.go1
92:35unused-parameter
pkg/proxy/conntrack/sysctls_test.go:92:35
// SetMax value is calculated based on the number of CPUs by getConntrackMax()func (fc *fakeConntracker) SetMax(ctx context.Context, max int) error { fc.called = append(fc.called, "SetMax")pkg/proxy/healthcheck/healthcheck_test.go1
82:7unused-receiver
pkg/proxy/healthcheck/healthcheck_test.go:82:7
}func (fake *fakeNetListener) Accept() (net.Conn, error) { // Not implementedpkg/proxy/config/config.go1
290:25use-any
pkg/proxy/config/config.go:290:25
cache.ResourceEventHandlerFuncs{ AddFunc: func(obj interface{}) { result.handleChangeNode(obj) }, UpdateFunc: func(_, newObj interface{}) { result.handleChangeNode(newObj) },pkg/kubeapiserver/options/authentication.go1
316:7use-errors-new
pkg/kubeapiserver/options/authentication.go:316:7
allErrors = append(allErrors, fmt.Errorf("--requestheader-client-ca-file and --client-ca-file contain overlapping certificates; --requestheader-allowed-names must be specified to ensure regular client certificates cannot set authenticating proxy headers for arbitrary users")) }pkg/proxy/iptables/proxier_test.go1
724:3use-slices-sort
pkg/proxy/iptables/proxier_test.go:724:3
if chain != nil { sort.SliceStable(chain.Rules, func(i, j int) bool { if chain.Rules[i].Comment != nil && strings.Contains(chain.Rules[i].Comment.Value, "must be the last rule") {pkg/proxy/endpointschangetracker_test.go1
440:2var-naming
pkg/proxy/endpointschangetracker_test.go:440:2
} complexBefore2_s2 := func(eps *discovery.EndpointSlice) { eps.Endpoints = []discovery.Endpoint{{pkg/kubeapiserver/options/authentication_test.go1
107:29add-constant
pkg/kubeapiserver/options/authentication_test.go:107:29
UsernameClaim: "sub", SigningAlgs: []string{"RS256"}, IssuerURL: "https://testIssuerURL",pkg/scheduler/backend/heap/heap_test.go1
270:44boolean-literal-comparison
pkg/scheduler/backend/heap/heap_test.go:270:44
h.AddOrUpdate(mkHeapObj("foo", 10, 1)) if got := h.Has(mkHeapObj("foo", 0, 1)); got != true { t.Errorf("Has(%q) = %v, want %v", "foo", got, true)pkg/kubeapiserver/options/authentication_test.go1
542:6cognitive-complexity
pkg/kubeapiserver/options/authentication_test.go:542:6
func TestToAuthenticationConfig_Anonymous(t *testing.T) { testCases := []struct {pkg/registry/core/service/ipallocator/cidrallocator.go1
104:6confusing-naming
pkg/registry/core/service/ipallocator/cidrallocator.go:104:6
// newMetaAllocator is used to build the allocator for testingfunc newMetaAllocator(client networkingv1client.NetworkingV1Interface, serviceCIDRInformer networkingv1informers.ServiceCIDRInformer,pkg/scheduler/framework/plugins/noderesources/resource_allocation.go1
355:11confusing-results
pkg/scheduler/framework/plugins/noderesources/resource_allocation.go:355:11
func (r *resourceAllocationScorer) calculateDRAResourceTotals(ctx context.Context, node *v1.Node, deviceClass *resourceapi.DeviceClass, allocatedState *structured.AllocatedState, resourceSlices []*resourceapi.ResourceSlice,) (int64, int64, error) { var totalCapacity, totalAllocated int64pkg/registry/admissionregistration/resolver/resolver.go1
64:6constructor-interface-return
pkg/registry/admissionregistration/resolver/resolver.go:64:6
func NewDiscoveryResourceResolver(client discovery.DiscoveryInterface) (ResourceResolver, error) { return &discoveryResourceResolver{client: client}, nilpkg/proxy/conntrack/cleanup_test.go1
89:6cyclomatic-complexity
pkg/proxy/conntrack/cleanup_test.go:89:6
func TestCleanStaleEntries(t *testing.T) { // We need to construct proxy.ServicePortMap and proxy.EndpointsMap to pass topkg/registry/certificates/podcertificaterequest/storage/storage_test.go1
126:5deprecated-api-usage
pkg/registry/certificates/podcertificaterequest/storage/storage_test.go:126:5
MaxExpirationSeconds: ptr.To[int32](86400), PKIXPublicKey: ed25519PubPKIX2, ProofOfPossession: ed25519Proof2,pkg/proxy/conntrack/cleanup_test.go1
551:22discarded-error-result
pkg/proxy/conntrack/cleanup_test.go:551:22
CleanStaleEntries(ct, testIPFamily, svcPortMap, endpointsMap) actualEntries, _ := ct.ListEntries(ipFamilyMap[testIPFamily])pkg/kubeapiserver/authorizer/modes/modes.go1
28:2doc-comment-period
pkg/kubeapiserver/authorizer/modes/modes.go:28:2
ModeABAC string = "ABAC" // ModeWebhook is the mode to make an external webhook call to authorize ModeWebhook string = "Webhook"pkg/scheduler/framework/runtime/framework.go1
492:4early-return
pkg/scheduler/framework/runtime/framework.go:492:4
if gs, ok := f.pluginsMap[names.GangScheduling]; ok { if p, ok := gs.(framework.PlacementFeasiblePlugin); ok { f.placementFeasiblePlugins = append(f.placementFeasiblePlugins, p)pkg/proxy/config/config_test.go1
121:13error-strings
pkg/proxy/config/config_test.go:121:13
case <-time.After(wait.ForeverTestTimeout): t.Errorf("Timed out. Expected %#v, Got %#v", expectedServices, services) returnpkg/kubeapiserver/default_storage_factory_builder.go1
56:6exported-declaration-comment
pkg/kubeapiserver/default_storage_factory_builder.go:56:6
// should be disabled.func DefaultWatchCacheSizes() map[schema.GroupResource]int { return map[schema.GroupResource]int{pkg/proxy/iptables/proxier_test.go1
1:1file-length-limit
pkg/proxy/iptables/proxier_test.go:1:1
//go:build linuxpkg/proxy/ipvs/ipset/ipset.go1
324:58flag-parameter
pkg/proxy/ipvs/ipset/ipset.go:324:58
// the same set (setname and create parameters are identical) already exists.func (runner *runner) AddEntry(entry string, set *IPSet, ignoreExistErr bool) error { args := []string{"add", set.Name, entry}pkg/kubeapiserver/options/admission_test.go1
1:1format
pkg/kubeapiserver/options/admission_test.go:1:1
/*Copyright 2018 The Kubernetes Authors.- Fix (safe): run `strider fmt pkg/kubeapiserver/options/admission_test.go`
pkg/kubeapiserver/options/authentication_test.go1
542:6function-length
pkg/kubeapiserver/options/authentication_test.go:542:6
func TestToAuthenticationConfig_Anonymous(t *testing.T) { testCases := []struct {pkg/registry/core/service/allocator/storage/storage_test.go1
32:6function-result-limit
pkg/registry/core/service/allocator/storage/storage_test.go:32:6
func newStorage(t *testing.T) (*Etcd, *etcd3testing.EtcdTestServer, allocator.Interface, *storagebackend.Config) { etcdStorage, server := registrytest.NewEtcdStorage(t, "")pkg/proxy/healthcheck/proxy_health.go1
71:2import-shadowing
pkg/proxy/healthcheck/proxy_health.go:71:2
httpFactory httpServerFactory clock clock.Clockpkg/registry/core/service/storage/transaction_test.go1
131:6increment-decrement
pkg/registry/core/service/storage/transaction_test.go:131:6
commit: func() { temp = temp + 1 },pkg/registry/core/service/ipallocator/controller/repair.go1
169:5inefficient-map-lookup
pkg/registry/core/service/ipallocator/controller/repair.go:169:5
snapshotByFamily[family] = snapshot }pkg/scheduler/framework/plugins/dynamicresources/dynamicresources_test.go1
4235:41inefficient-sprintf
pkg/scheduler/framework/plugins/dynamicresources/dynamicresources_test.go:4235:41
if obj.GetName() == "" { obj.SetName(obj.GetGenerateName() + fmt.Sprintf("%d", nameCounter)) nameCounter++pkg/kubeapiserver/options/authentication_test.go1
346:22insecure-url-scheme
pkg/kubeapiserver/options/authentication_test.go:346:22
Lookup: true, Issuers: []string{"http://foo.bar.com"}, },pkg/scheduler/framework/types.go1
557:23interface-method-limit
pkg/scheduler/framework/types.go:557:23
// It can be a single Pod (QueuedPodInfo) or a group of Pods (QueuedPodGroupInfo).type QueuedEntityInfo interface { fwk.QueuedEntityInfopkg/scheduler/framework/preemption/executor_test.go1
808:8max-control-nesting
pkg/scheduler/framework/preemption/executor_test.go:808:8
} if tt.expectedActivatedPods == nil && len(fakeActivator.activatedPods) != 0 { lastErrMsg = fmt.Sprintf("expected no activated pods, got %v", fakeActivator.activatedPods)pkg/proxy/winkernel/proxier.go1
1822:25max-parameters
pkg/proxy/winkernel/proxier.go:1822:25
// If it is needed, the function will delete the existing loadbalancer and return true, else false.func (proxier *Proxier) deleteExistingLoadBalancer(hns HostNetworkService, winProxyOptimization bool, lbHnsID *string, vip string, protocol, intPort, extPort uint16, endpoints []endpointInfo, queriedLoadBalancers map[loadBalancerIdentifier]*loadBalancerInfo, lbType loadBalancerType) bool {pkg/scheduler/apis/config/types.go1
315:6max-public-structs
pkg/scheduler/apis/config/types.go:315:6
// managed by an extender.type ExtenderManagedResource struct { // Name is the extended resource name.pkg/proxy/apis/config/v1alpha1/conversion.go1
37:3modifies-parameter
pkg/proxy/apis/config/v1alpha1/conversion.go:37:3
case kubeproxyconfig.ProxyModeNFTables: out.NFTables.MasqueradeAll = in.Linux.MasqueradeAll default:pkg/scheduler/framework/plugins/interpodaffinity/filtering.go1
95:3modifies-value-receiver
pkg/scheduler/framework/plugins/interpodaffinity/filtering.go:95:3
for pair, count := range toMerge { m[pair] += count }pkg/proxy/apis/config/validation/validation_test.go1
68:26nested-structs
pkg/proxy/apis/config/validation/validation_test.go:68:26
testCases := map[string]struct { mutateConfigFunc func(*kubeproxyconfig.KubeProxyConfiguration)pkg/registry/core/service/ipallocator/cidrallocator_test.go1
395:4nil-error-return
pkg/registry/core/service/ipallocator/cidrallocator_test.go:395:4
if err != nil { return false, nil }pkg/registry/core/pod/storage/eviction_test.go1
1025:2nil-value-with-nil-error
pkg/registry/core/pod/storage/eviction_test.go:1025:2
func (ms *mockStore) Create(ctx context.Context, obj runtime.Object, createValidation rest.ValidateObjectFunc, options *metav1.CreateOptions) (runtime.Object, error) { return nil, nil}pkg/registry/admissionregistration/rest/storage_apiserver.go1
58:4no-else-after-return
pkg/registry/admissionregistration/rest/storage_apiserver.go:58:4
return genericapiserver.APIGroupInfo{}, err } else if len(storageMap) > 0 { apiGroupInfo.VersionedResourcesStorageMap[admissionregistrationv1beta1.SchemeGroupVersion.Version] = storageMappkg/scheduler/framework/plugins/defaultpreemption/default_preemption_test.go1
112:6no-init
pkg/scheduler/framework/plugins/defaultpreemption/default_preemption_test.go:112:6
func init() { metrics.Register()pkg/proxy/ipvs/proxier.go1
1253:2no-naked-return
pkg/proxy/ipvs/proxier.go:1253:2
} return}pkg/kubeapiserver/options/plugins.go1
73:5no-package-var
pkg/kubeapiserver/options/plugins.go:73:5
// AllOrderedPlugins is the list of all the plugins in order.var AllOrderedPlugins = []string{ admit.PluginName, // AlwaysAdmitpkg/kubeapiserver/options/authentication.go1
832:5optimize-operands-order
pkg/kubeapiserver/options/authentication.go:832:5
func (o *BuiltInAuthenticationOptions) ApplyAuthorization(authorization *BuiltInAuthorizationOptions) { if o == nil || authorization == nil || o.Anonymous == nil { returnpkg/registry/rbac/rolebinding/strategy.go1
65:2overwritten-before-use
pkg/registry/rbac/rolebinding/strategy.go:65:2
func (strategy) PrepareForUpdate(ctx context.Context, obj, old runtime.Object) { newRoleBinding := obj.(*rbac.RoleBinding) oldRoleBinding := old.(*rbac.RoleBinding)pkg/kubeapiserver/options/authorization.go1
17:9package-comments
pkg/kubeapiserver/options/authorization.go:17:9
package optionspkg/scheduler/framework/plugins/nodeaffinity/node_affinity.go1
166:20possible-nil-dereference
pkg/scheduler/framework/plugins/nodeaffinity/node_affinity.go:166:20
// Check if there is affinity to a specific node and return it. terms := affinity.NodeAffinity.RequiredDuringSchedulingIgnoredDuringExecution.NodeSelectorTerms var nodeNames sets.Set[string]pkg/proxy/ipvs/proxier.go1
887:12range-value-address
pkg/proxy/ipvs/proxier.go:887:12
// ipvs call serv := &utilipvs.VirtualServer{ Address: externalIP,pkg/registry/rbac/clusterrolebinding/policybased/storage.go1
69:7receiver-naming
pkg/registry/rbac/clusterrolebinding/policybased/storage.go:69:7
func (s *Storage) Create(ctx context.Context, obj runtime.Object, createValidation rest.ValidateObjectFunc, options *metav1.CreateOptions) (runtime.Object, error) { if rbacregistry.EscalationAllowed(ctx) {pkg/registry/certificates/podcertificaterequest/strategy.go1
93:58redefines-builtin-id
pkg/registry/certificates/podcertificaterequest/strategy.go:93:58
func (s *Strategy) PrepareForUpdate(ctx context.Context, new, old runtime.Object) { newReq := new.(*certificates.PodCertificateRequest)pkg/proxy/apis/config/validation/validation_test.go1
510:10redundant-conversion
pkg/proxy/apis/config/validation/validation_test.go:510:10
"blank mode should default": { mode: kubeproxyconfig.ProxyMode(""), },pkg/proxy/healthcheck/service_health.go1
30:2redundant-import-alias
pkg/proxy/healthcheck/service_health.go:30:2
v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types"pkg/proxy/apis/config/validation/validation.go1
50:2single-case-switch
pkg/proxy/apis/config/validation/validation.go:50:2
allErrs = append(allErrs, validateKubeProxyIPTablesConfiguration(config.IPTables, newPath.Child("KubeProxyIPTablesConfiguration"))...) switch config.Mode { case kubeproxyconfig.ProxyModeIPVS:pkg/proxy/util/nfacct/nfacct_linux.go1
163:2slice-preallocation
pkg/proxy/util/nfacct/nfacct_linux.go:163:2
counters := make([]*Counter, 0) for _, msg := range msgs {pkg/proxy/endpointschangetracker.go1
148:2task-comment
pkg/proxy/endpointschangetracker.go:148:2
func getLastChangeTriggerTime(annotations map[string]string) time.Time { // TODO(#81360): ignore case when Endpoint is deleted. if _, ok := annotations[v1.EndpointsLastChangeTriggerTime]; !ok {pkg/kubeapiserver/options/authentication_test.go1
542:6test-parallelism
pkg/kubeapiserver/options/authentication_test.go:542:6
func TestToAuthenticationConfig_Anonymous(t *testing.T) { testCases := []struct {pkg/proxy/config/config_test.go1
224:1top-level-declaration-order
pkg/proxy/config/config_test.go:224:1
type EndpointSliceHandlerMock struct { lock sync.Mutexpkg/proxy/winkernel/proxier_test.go1
1409:22unchecked-type-assertion
pkg/proxy/winkernel/proxier_test.go:1409:22
hcn := (proxier.hcn).(*fakehcn.HcnMock) proxier.rootHnsEndpointName = endpointGwpkg/registry/flowcontrol/ensurer/flowschema_test.go1
401:60unexported-return
pkg/registry/flowcontrol/ensurer/flowschema_test.go:401:60
func (b *fsBuilder) WithAutoUpdateAnnotation(value string) *fsBuilder { setAnnotation(b.object, value)pkg/proxy/conntrack/sysctls_test.go1
92:56unused-parameter
pkg/proxy/conntrack/sysctls_test.go:92:56
// SetMax value is calculated based on the number of CPUs by getConntrackMax()func (fc *fakeConntracker) SetMax(ctx context.Context, max int) error { fc.called = append(fc.called, "SetMax")pkg/proxy/healthcheck/healthcheck_test.go1
92:7unused-receiver
pkg/proxy/healthcheck/healthcheck_test.go:92:7
func (fake *fakeNetListener) Addr() net.Addr { // Not implementedpkg/proxy/config/config.go1
291:31use-any
pkg/proxy/config/config.go:291:31
AddFunc: func(obj interface{}) { result.handleChangeNode(obj) }, UpdateFunc: func(_, newObj interface{}) { result.handleChangeNode(newObj) }, DeleteFunc: result.handleDeleteNode,pkg/kubeapiserver/options/authentication.go1
622:39use-errors-new
pkg/kubeapiserver/options/authentication.go:622:39
case len(o.ServiceAccounts.KeyFiles) > 0 && o.ServiceAccounts.ExternalPublicKeysGetter != nil: return kubeauthenticator.Config{}, fmt.Errorf("cannot set mutually exclusive flags `--service-account-key-file` and `--service-account-signing-endpoint` at the same time") case len(o.ServiceAccounts.KeyFiles) > 0:pkg/proxy/nftables/helpers_test.go1
78:2use-slices-sort
pkg/proxy/nftables/helpers_test.go:78:2
// sort remaining lines sort.SliceStable(lines, func(i, j int) bool { li := lines[i]pkg/proxy/endpointschangetracker_test.go1
451:2var-naming
pkg/proxy/endpointschangetracker_test.go:451:2
} complexBefore4_s1 := func(eps *discovery.EndpointSlice) { eps.Endpoints = []discovery.Endpoint{{pkg/kubeapiserver/options/authentication_test.go1
108:20add-constant
pkg/kubeapiserver/options/authentication_test.go:108:20
SigningAlgs: []string{"RS256"}, IssuerURL: "https://testIssuerURL", ClientID: "testClientID",pkg/scheduler/backend/heap/heap_test.go1
280:44boolean-literal-comparison
pkg/scheduler/backend/heap/heap_test.go:280:44
h.AddOrUpdate(mkHeapObj("baz", 11, 1)) if got := h.Has(mkHeapObj("foo", 0, 1)); got != true { t.Errorf("Has(%q) = %v, want %v", "foo", got, true)pkg/kubeapiserver/options/authentication_test.go1
795:6cognitive-complexity
pkg/kubeapiserver/options/authentication_test.go:795:6
func TestToAuthenticationConfig_OIDC(t *testing.T) { testCases := []struct {pkg/registry/core/service/ipallocator/controller/repairip.go1
122:6confusing-naming
pkg/registry/core/service/ipallocator/controller/repairip.go:122:6
// newRepairIPAddress implements NewRepairIPAddress by additionally consuming clock.Clock.func newRepairIPAddress(interval time.Duration, client kubernetes.Interface,pkg/scheduler/framework/plugins/noderesources/resource_allocation_test.go1
637:134confusing-results
pkg/scheduler/framework/plugins/noderesources/resource_allocation_test.go:637:134
// returns (matches, found)func (r *resourceAllocationScorer) getCachedDeviceMatch(expression string, driver string, poolName string, deviceName string) (bool, bool) { key := buildDeviceMatchCacheKey(expression, driver, poolName, deviceName)pkg/registry/flowcontrol/ensurer/strategy.go1
119:6constructor-interface-return
pkg/registry/flowcontrol/ensurer/strategy.go:119:6
func NewObjectOps[ObjectType configurationObjectType](client client[ObjectType], cache cache[ObjectType], deepCopy func(ObjectType) ObjectType,pkg/proxy/conntrack/sysctls.go1
58:6cyclomatic-complexity
pkg/proxy/conntrack/sysctls.go:58:6
func setSysctls(ctx context.Context, ct conntrackConfigurer, config *kubeproxyconfig.KubeProxyConntrackConfiguration) error { max, err := getConntrackMax(ctx, config, detectNumCPU())pkg/registry/certificates/podcertificaterequest/storage/storage_test.go1
127:5deprecated-api-usage
pkg/registry/certificates/podcertificaterequest/storage/storage_test.go:127:5
PKIXPublicKey: ed25519PubPKIX2, ProofOfPossession: ed25519Proof2, UnverifiedUserAnnotations: map[string]string{"test/foo": "bar"},pkg/proxy/conntrack/sysctls.go1
191:15discarded-error-result
pkg/proxy/conntrack/sysctls.go:191:15
sys := sysctl.New() if val, _ := sys.GetSysctl(entry); val != value { logger.Info("Set sysctl", "entry", entry, "value", value)pkg/kubeapiserver/authorizer/modes/modes.go1
30:2doc-comment-period
pkg/kubeapiserver/authorizer/modes/modes.go:30:2
ModeWebhook string = "Webhook" // ModeRBAC is the mode to use Role Based Access Control to authorize ModeRBAC string = "RBAC"pkg/scheduler/framework/runtime/framework.go1
1241:10early-return
pkg/scheduler/framework/runtime/framework.go:1241:10
return res, status.WithPlugin(pl.Name()) } else if status.Code() == fwk.Unschedulable { reasons = append(reasons, status.Reasons()...)pkg/proxy/config/config_test.go1
301:13error-strings
pkg/proxy/config/config_test.go:301:13
case <-time.After(wait.ForeverTestTimeout): t.Errorf("Timed out. Expected %#v, Got %#v", expectedSlices, slices) returnpkg/kubeapiserver/default_storage_factory_builder.go1
112:32exported-declaration-comment
pkg/kubeapiserver/default_storage_factory_builder.go:112:32
// This method mutates the receiver (StorageFactoryConfig). It must never mutate the inputs.func (c *StorageFactoryConfig) Complete(etcdOptions *serveroptions.EtcdOptions) *completedStorageFactoryConfig { c.StorageConfig = etcdOptions.StorageConfigpkg/proxy/ipvs/ipset/ipset.go1
1:1file-length-limit
pkg/proxy/ipvs/ipset/ipset.go:1:1
//go:build linuxpkg/proxy/ipvs/ipset/testing/fake.go1
83:49flag-parameter
pkg/proxy/ipvs/ipset/testing/fake.go:83:49
// CreateSet is part of interface.func (f *FakeIPSet) CreateSet(set *ipset.IPSet, ignoreExistErr bool) error { if f.Sets[set.Name] != nil {pkg/kubeapiserver/options/authentication.go1
1:1format
pkg/kubeapiserver/options/authentication.go:1:1
/*Copyright 2016 The Kubernetes Authors.- Fix (safe): run `strider fmt pkg/kubeapiserver/options/authentication.go`
pkg/kubeapiserver/options/authentication_test.go1
795:6function-length
pkg/kubeapiserver/options/authentication_test.go:795:6
func TestToAuthenticationConfig_OIDC(t *testing.T) { testCases := []struct {pkg/registry/core/service/ipallocator/storage/storage_test.go1
38:6function-result-limit
pkg/registry/core/service/ipallocator/storage/storage_test.go:38:6
func newStorage(t *testing.T) (*etcd3testing.EtcdTestServer, ipallocator.Interface, allocator.Interface, storage.Interface, factory.DestroyFunc) { etcdStorage, server := registrytest.NewEtcdStorage(t, "")pkg/proxy/iptables/proxier.go1
158:2import-shadowing
pkg/proxy/iptables/proxier.go:158:2
masqueradeMark string conntrack conntrack.Interface nfacct nfacct.Interfacepkg/registry/core/service/storage/transaction_test.go1
142:6increment-decrement
pkg/registry/core/service/storage/transaction_test.go:142:6
revert: func() { temp = temp - 1 },pkg/scheduler/backend/cache/cache.go1
812:5inefficient-map-lookup
pkg/scheduler/backend/cache/cache.go:812:5
if _, ok := newSum[name]; !ok { newSum[name] = state }pkg/scheduler/framework/plugins/dynamicresources/dynamicresources_test.go1
4260:27inefficient-sprintf
pkg/scheduler/framework/plugins/dynamicresources/dynamicresources_test.go:4260:27
obj.SetResourceVersion(fmt.Sprintf("%d", resourceVersionCounter)) resourceVersionCounter++pkg/kubeapiserver/options/authentication_test.go1
356:52insecure-url-scheme
pkg/kubeapiserver/options/authentication_test.go:356:52
expectConfig := kubeauthenticator.Config{ APIAudiences: authenticator.Audiences{"http://foo.bar.com"}, Anonymous: apiserver.AnonymousAuthConfig{Enabled: false},pkg/scheduler/framework/preemption/executor_test.go1
821:8max-control-nesting
pkg/scheduler/framework/preemption/executor_test.go:821:8
if len(tt.expectedDeletedPod) == 0 { if deletedPods.Len() != 0 { // When tt.expectedDeletedPod is empty, we expect no pod to be deleted.pkg/registry/core/serviceaccount/storage/storage.go1
42:6max-parameters
pkg/registry/core/serviceaccount/storage/storage.go:42:6
// NewREST returns a RESTStorage object that will work against service accounts.func NewREST(optsGetter generic.RESTOptionsGetter, issuer token.TokenGenerator, auds authenticator.Audiences, max time.Duration, podStorage, secretStorage, nodeStorage rest.Getter, extendExpiration bool, maxExtendedExpiration time.Duration) (*REST, error) { store := &genericregistry.Store{pkg/scheduler/apis/config/types.go1
324:6max-public-structs
pkg/scheduler/apis/config/types.go:324:6
// ExtenderTLSConfig contains settings to enable TLS with extendertype ExtenderTLSConfig struct { // Server should be accessed without verifying the TLS certificate. For testing only.pkg/proxy/apis/config/v1alpha1/conversion.go1
39:3modifies-parameter
pkg/proxy/apis/config/v1alpha1/conversion.go:39:3
default: out.IPTables.MasqueradeAll = in.Linux.MasqueradeAll }pkg/scheduler/framework/plugins/interpodaffinity/filtering.go1
101:3modifies-value-receiver
pkg/scheduler/framework/plugins/interpodaffinity/filtering.go:101:3
for _, tmtc := range toMerge { m[tmtc.topologyPair] += tmtc.count }pkg/proxy/apis/config/validation/validation_test.go1
206:41nested-structs
pkg/proxy/apis/config/validation/validation_test.go:206:41
for name, testCase := range map[string]struct { config kubeproxyconfig.KubeProxyIPTablesConfigurationpkg/registry/core/service/ipallocator/cidrallocator_test.go1
447:4nil-error-return
pkg/registry/core/service/ipallocator/cidrallocator_test.go:447:4
if err != nil { return true, nil }pkg/registry/core/pod/storage/eviction_test.go1
1029:2nil-value-with-nil-error
pkg/registry/core/pod/storage/eviction_test.go:1029:2
func (ms *mockStore) DeleteCollection(ctx context.Context, deleteValidation rest.ValidateObjectFunc, options *metav1.DeleteOptions, listOptions *metainternalversion.ListOptions) (runtime.Object, error) { return nil, nil}pkg/registry/admissionregistration/rest/storage_apiserver.go1
64:4no-else-after-return
pkg/registry/admissionregistration/rest/storage_apiserver.go:64:4
return genericapiserver.APIGroupInfo{}, err } else if len(storageMap) > 0 { apiGroupInfo.VersionedResourcesStorageMap[admissionregistrationv1alpha1.SchemeGroupVersion.Version] = storageMappkg/scheduler/framework/plugins/dynamicresources/dynamicresources_test.go1
79:6no-init
pkg/scheduler/framework/plugins/dynamicresources/dynamicresources_test.go:79:6
func init() { metrics.InitMetrics()pkg/proxy/nftables/cleanup.go1
38:2no-naked-return
pkg/proxy/nftables/cleanup.go:38:2
} return}pkg/proxy/apis/config/register.go1
28:5no-package-var
pkg/proxy/apis/config/register.go:28:5
// SchemeGroupVersion is group version used to register these objectsvar SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal}pkg/kubeapiserver/options/authentication_test.go1
304:25optimize-operands-order
pkg/kubeapiserver/options/authentication_test.go:304:25
errs := options.Validate() if len(errs) > 0 && (!strings.Contains(utilerrors.NewAggregate(errs).Error(), testcase.expectErr) || testcase.expectErr == "") { t.Errorf("Got err: %v, Expected err: %s", errs, testcase.expectErr)pkg/registry/rbac/rolebinding/strategy.go1
66:2overwritten-before-use
pkg/registry/rbac/rolebinding/strategy.go:66:2
newRoleBinding := obj.(*rbac.RoleBinding) oldRoleBinding := old.(*rbac.RoleBinding)pkg/kubeapiserver/options/options.go1
17:9package-comments
pkg/kubeapiserver/options/options.go:17:9
package optionspkg/scheduler/framework/plugins/podtopologyspread/plugin.go1
250:50possible-nil-dereference
pkg/scheduler/framework/plugins/podtopologyspread/plugin.go:250:50
// Pod is deleted. Return Queue when the deleted Pod has a label that matches with topologySpread's selector. if podLabelsMatchSpreadConstraints(constraints, originalPod.Labels) { logger.V(5).Info("a scheduled pod which matches with the pod's topology spread constraints was deleted, and the pod may be schedulable now",pkg/proxy/ipvs/proxier.go1
919:12range-value-address
pkg/proxy/ipvs/proxier.go:919:12
// ipset call entry = &utilipset.Entry{ IP: ingress.String(),pkg/registry/rbac/clusterrolebinding/policybased/storage.go1
94:7receiver-naming
pkg/registry/rbac/clusterrolebinding/policybased/storage.go:94:7
func (s *Storage) Update(ctx context.Context, name string, obj rest.UpdatedObjectInfo, createValidation rest.ValidateObjectFunc, updateValidation rest.ValidateObjectUpdateFunc, forceAllowCreate bool, options *metav1.UpdateOptions) (runtime.Object, bool, error) { if rbacregistry.EscalationAllowed(ctx) {pkg/registry/certificates/podcertificaterequest/strategy.go1
99:56redefines-builtin-id
pkg/registry/certificates/podcertificaterequest/strategy.go:99:56
func (s *Strategy) ValidateUpdate(ctx context.Context, new, old runtime.Object) field.ErrorList { newReq := new.(*certificates.PodCertificateRequest)pkg/proxy/apis/config/validation/validation_test.go1
528:18redundant-conversion
pkg/proxy/apis/config/validation/validation_test.go:528:18
"invalid mode non-existent": { mode: kubeproxyconfig.ProxyMode("non-existing"), expectedErrs: field.ErrorList{field.Invalid(newPath.Child("ProxyMode"), "non-existing", "must be kernelspace or blank (blank means the most-available proxy [currently kernelspace])")},pkg/proxy/iptables/number_generated_rules_test.go1
26:2redundant-import-alias
pkg/proxy/iptables/number_generated_rules_test.go:26:2
v1 "k8s.io/api/core/v1" discovery "k8s.io/api/discovery/v1"pkg/proxy/apis/config/validation/validation.go1
315:2single-case-switch
pkg/proxy/apis/config/validation/validation.go:315:2
allErrs := field.ErrorList{} switch { case len(cidrStrings) == 0:pkg/proxy/util/utils_test.go1
248:8slice-preallocation
pkg/proxy/util/utils_test.go:248:8
var ipStr []string for _, ip := range ipMap[ipFamily] {pkg/proxy/endpointschangetracker.go1
293:2task-comment
pkg/proxy/endpointschangetracker.go:293:2
func (em EndpointsMap) LocalReadyEndpoints() map[types.NamespacedName]int { // TODO: If this will appear to be computationally expensive, consider // computing this incrementally similarly to endpointsMap.pkg/kubeapiserver/options/authentication_test.go1
761:24test-parallelism
pkg/kubeapiserver/options/authentication_test.go:761:24
for _, testcase := range testCases { t.Run(testcase.name, func(t *testing.T) { opts := NewBuiltInAuthenticationOptions().WithAnonymous()pkg/proxy/conntrack/cleanup.go1
170:1top-level-declaration-order
pkg/proxy/conntrack/cleanup.go:170:1
// ipFamilyMap maps v1.IPFamily to the corresponding unix constant.var ipFamilyMap = map[v1.IPFamily]uint8{ v1.IPv4Protocol: unix.AF_INET,pkg/proxy/winkernel/proxier_test.go1
1828:28unchecked-type-assertion
pkg/proxy/winkernel/proxier_test.go:1828:28
hcnMock := (v4Proxier.hcn).(*fakehcn.HcnMock) v4Proxier.rootHnsEndpointName = endpointGwpkg/registry/flowcontrol/ensurer/prioritylevelconfiguration_test.go1
476:49unexported-return
pkg/registry/flowcontrol/ensurer/prioritylevelconfiguration_test.go:476:49
func (b *plBuilder) WithGeneration(value int64) *plBuilder { b.object.SetGeneration(value)pkg/proxy/conntrack/sysctls_test.go1
96:53unused-parameter
pkg/proxy/conntrack/sysctls_test.go:96:53
}func (fc *fakeConntracker) SetTCPEstablishedTimeout(ctx context.Context, seconds int) error { fc.called = append(fc.called, fmt.Sprintf("SetTCPEstablishedTimeout(%d)", seconds))pkg/proxy/healthcheck/healthcheck_test.go1
103:7unused-receiver
pkg/proxy/healthcheck/healthcheck_test.go:103:7
func (fake *fakeHTTPServerFactory) New(handler http.Handler) httpServer { return &fakeHTTPServer{pkg/proxy/config/config.go1
321:43use-any
pkg/proxy/config/config.go:321:43
func (c *NodeConfig) handleChangeNode(obj interface{}) { node, ok := obj.(*v1.Node)pkg/kubeapiserver/options/authentication.go1
855:34use-errors-new
pkg/kubeapiserver/options/authentication.go:855:34
if o.OIDC != nil && o.OIDC.FlagsSet && (len(o.OIDC.IssuerURL) == 0 || len(o.OIDC.ClientID) == 0) { allErrors = append(allErrors, fmt.Errorf("oidc-issuer-url and oidc-client-id must be specified together when any oidc-* flags are set")) }pkg/scheduler/framework/plugins/defaultpreemption/default_preemption.go1
345:2use-slices-sort
pkg/scheduler/framework/plugins/defaultpreemption/default_preemption.go:345:2
// higher importance victims first. sort.Slice(potentialVictims, func(i, j int) bool { return pl.MoreImportantVictim(potentialVictims[i], potentialVictims[j])pkg/proxy/endpointschangetracker_test.go1
465:2var-naming
pkg/proxy/endpointschangetracker_test.go:465:2
} complexBefore4_s2 := func(eps *discovery.EndpointSlice) { eps.Endpoints = []discovery.Endpoint{{pkg/kubeapiserver/options/authentication_test.go1
113:23add-constant
pkg/kubeapiserver/options/authentication_test.go:113:23
testSA: &ServiceAccountAuthenticationOptions{ Issuers: []string{"http://foo.bar.com"}, },pkg/scheduler/backend/heap/heap_test.go1
289:44boolean-literal-comparison
pkg/scheduler/backend/heap/heap_test.go:289:44
h.Delete(mkHeapObj("foo", 0, 1)) if got := h.Has(mkHeapObj("foo", 0, 1)); got != false { t.Errorf("Has(%q) = %v, want %v", "foo", got, false)pkg/kubeapiserver/options/authentication_test.go1
1090:6cognitive-complexity
pkg/kubeapiserver/options/authentication_test.go:1090:6
func TestValidateOIDCOptions(t *testing.T) { testCases := []struct {pkg/registry/core/service/ipallocator/ipallocator.go1
189:21confusing-naming
pkg/registry/core/service/ipallocator/ipallocator.go:189:21
func (a *Allocator) allocateService(svc *api.Service, ip net.IP, dryRun bool) error { if !a.ready.Load() || !a.ipAddressSynced() {pkg/scheduler/framework/plugins/noderesources/resource_allocation_test.go1
758:148confusing-results
pkg/scheduler/framework/plugins/noderesources/resource_allocation_test.go:758:148
// getCachedNodeMatch checks the cache for a NodeMatches resultfunc (r *resourceAllocationScorer) getCachedNodeMatch(nodeName string, nodeNameToMatch string, allNodesMatch bool, nodeSelectorHash string) (bool, bool) { key := buildNodeMatchCacheKey(nodeName, nodeNameToMatch, allNodesMatch, nodeSelectorHash)pkg/registry/flowcontrol/ensurer/strategy.go1
142:6constructor-interface-return
pkg/registry/flowcontrol/ensurer/strategy.go:142:6
// NewSuggestedEnsureStrategy returns an EnsureStrategy for suggested config objectsfunc NewSuggestedEnsureStrategy[ObjectType configurationObjectType]() EnsureStrategy[ObjectType] { return &strategy[ObjectType]{pkg/proxy/endpointschangetracker.go1
193:24cyclomatic-complexity
pkg/proxy/endpointschangetracker.go:193:24
// changes map.func (em EndpointsMap) Update(ect *EndpointsChangeTracker) UpdateEndpointsMapResult { result := UpdateEndpointsMapResult{pkg/registry/certificates/podcertificaterequest/storage/storage_test.go1
166:5deprecated-api-usage
pkg/registry/certificates/podcertificaterequest/storage/storage_test.go:166:5
MaxExpirationSeconds: ptr.To[int32](86400), PKIXPublicKey: ed25519PubPKIX1, ProofOfPossession: ed25519Proof1,pkg/proxy/healthcheck/healthcheck_test.go1
159:2discarded-error-result
pkg/proxy/healthcheck/healthcheck_test.go:159:2
// sync nothing hcs.SyncServices(nil) if len(hcs.services) != 0 {pkg/kubeapiserver/authorizer/modes/modes.go1
36:1doc-comment-period
pkg/kubeapiserver/authorizer/modes/modes.go:36:1
// AuthorizationModeChoices is the list of supported authorization modesvar AuthorizationModeChoices = []string{ModeAlwaysAllow, ModeAlwaysDeny, ModeABAC, ModeWebhook, ModeRBAC, ModeNode}pkg/scheduler/framework/runtime/framework.go1
2041:4early-return
pkg/scheduler/framework/runtime/framework.go:2041:4
} if status.IsWait() { // Not allowed to be greater than maxTimeout.pkg/proxy/config/config_test.go1
504:13error-strings
pkg/proxy/config/config_test.go:504:13
case <-time.After(wait.ForeverTestTimeout): t.Errorf("Timed out. Expected %#v, Got %#v", expectedNodes, nodes) returnpkg/kubeapiserver/options/admission.go1
39:6exported-declaration-comment
pkg/kubeapiserver/options/admission.go:39:6
// It is a wrap of generic AdmissionOptions.type AdmissionOptions struct { // GenericAdmission holds the generic admission options.pkg/proxy/ipvs/ipset/ipset_test.go1
1:1file-length-limit
pkg/proxy/ipvs/ipset/ipset_test.go:1:1
//go:build linuxpkg/proxy/ipvs/ipset/testing/fake.go1
98:62flag-parameter
pkg/proxy/ipvs/ipset/testing/fake.go:98:62
// AddEntry is part of interface.func (f *FakeIPSet) AddEntry(entry string, set *ipset.IPSet, ignoreExistErr bool) error { if f.Entries[set.Name].Has(entry) {pkg/kubeapiserver/options/authentication_test.go2
1:1format
pkg/kubeapiserver/options/authentication_test.go:1:1
/*Copyright 2018 The Kubernetes Authors.- Fix (safe): run `strider fmt pkg/kubeapiserver/options/authentication_test.go`
1090:6function-length
pkg/kubeapiserver/options/authentication_test.go:1090:6
func TestValidateOIDCOptions(t *testing.T) { testCases := []struct {pkg/registry/core/service/portallocator/storage/storage_test.go1
43:6function-result-limit
pkg/registry/core/service/portallocator/storage/storage_test.go:43:6
func newStorage(t *testing.T) (*etcd3testing.EtcdTestServer, portallocator.Interface, allocator.Interface, storage.Interface, factory.DestroyFunc) { etcdStorage, server := registrytest.NewEtcdStorage(t, "")pkg/proxy/iptables/proxier.go1
159:2import-shadowing
pkg/proxy/iptables/proxier.go:159:2
conntrack conntrack.Interface nfacct nfacct.Interface localDetector proxyutil.LocalTrafficDetectorpkg/scheduler/backend/cache/cache_test.go1
1892:6inefficient-map-lookup
pkg/scheduler/backend/cache/cache_test.go:1892:6
} imageStates[name] = state } else {pkg/scheduler/framework/preemption/executor_test.go1
181:9inefficient-sprintf
pkg/scheduler/framework/preemption/executor_test.go:181:9
for _, tt := range tests { t.Run(fmt.Sprintf("%v", tt.name), func(t *testing.T) {pkg/kubeapiserver/options/authentication_test.go1
379:41insecure-url-scheme
pkg/kubeapiserver/options/authentication_test.go:379:41
ServiceAccountLookup: true, ServiceAccountIssuers: []string{"http://foo.bar.com"}, WebhookTokenAuthnConfigFile: "/token-webhook-config",pkg/scheduler/framework/preemption/executor_test.go1
831:8max-control-nesting
pkg/scheduler/framework/preemption/executor_test.go:831:8
for _, podName := range tt.expectedDeletedPod { if deletedPods.Has(podName) || // If podName is empty, we expect no pod to be deleted.pkg/scheduler/framework/plugins/dynamicresources/dynamicresources_test.go1
4066:6max-parameters
pkg/scheduler/framework/plugins/dynamicresources/dynamicresources_test.go:4066:6
func setup(tCtx ktesting.TContext, args *config.DynamicResourcesArgs, nodes []*v1.Node, claims []*resourceapi.ResourceClaim, classes []*resourceapi.DeviceClass, podGroups []*schedulingapi.PodGroup, objs []apiruntime.Object, features feature.Features, failPatch bool, apiReactors []cgotesting.Reactor) (result *testContext) { tCtx.Helper()pkg/scheduler/apis/config/types_pluginargs.go1
131:6max-public-structs
pkg/scheduler/apis/config/types_pluginargs.go:131:6
// UtilizationShapePoint represents a single point of a priority function shape.type UtilizationShapePoint struct { // Utilization (x axis). Valid values are 0 to 100. Fully utilized node maps to 100.pkg/proxy/apis/config/v1alpha1/conversion.go1
44:3modifies-parameter
pkg/proxy/apis/config/v1alpha1/conversion.go:44:3
case kubeproxyconfig.ProxyModeIPVS: out.IPVS.SyncPeriod = in.SyncPeriod out.IPVS.MinSyncPeriod = in.MinSyncPeriodpkg/scheduler/framework/plugins/interpodaffinity/filtering.go1
114:3modifies-value-receiver
pkg/scheduler/framework/plugins/interpodaffinity/filtering.go:114:3
pair := topologyPair{key: tk, value: tv} m[pair] += value // value could be negative, hence we delete the entry if it is down to zero.pkg/proxy/apis/config/validation/validation_test.go1
232:41nested-structs
pkg/proxy/apis/config/validation/validation_test.go:232:41
newPath := field.NewPath("KubeProxyConfiguration") for name, testCase := range map[string]struct { config kubeproxyconfig.KubeProxyIPVSConfigurationpkg/registry/core/service/ipallocator/cidrallocator_test.go1
459:4nil-error-return
pkg/registry/core/service/ipallocator/cidrallocator_test.go:459:4
if err != nil { return false, nil }pkg/registry/core/pod/storage/eviction_test.go1
1033:2nil-value-with-nil-error
pkg/registry/core/pod/storage/eviction_test.go:1033:2
func (ms *mockStore) List(ctx context.Context, options *metainternalversion.ListOptions) (runtime.Object, error) { return nil, nil}pkg/registry/apiserverinternal/rest/storage.go1
39:4no-else-after-return
pkg/registry/apiserverinternal/rest/storage.go:39:4
return genericapiserver.APIGroupInfo{}, err } else if len(storageMap) > 0 { apiGroupInfo.VersionedResourcesStorageMap[apiserverv1alpha1.SchemeGroupVersion.Version] = storageMappkg/scheduler/framework/plugins/gangscheduling/gangscheduling_test.go1
46:6no-init
pkg/scheduler/framework/plugins/gangscheduling/gangscheduling_test.go:46:6
func init() { // This is required for tests where cache is initialized, and cache attempts to update metrics.pkg/proxy/nftables/proxier.go1
1072:3no-naked-return
pkg/proxy/nftables/proxier.go:1072:3
proxier.logger.V(2).Info("Not syncing nftables until Services and Endpoints have been received from master") return }pkg/proxy/apis/config/register.go1
32:2no-package-var
pkg/proxy/apis/config/register.go:32:2
// SchemeBuilder is the scheme builder with scheme init functions to run for this API package SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) // AddToScheme is a global function that registers this API group & version to a schemepkg/kubeapiserver/options/authentication_test.go1
1234:25optimize-operands-order
pkg/kubeapiserver/options/authentication_test.go:1234:25
errs := opts.Validate() if len(errs) > 0 && (!strings.Contains(utilerrors.NewAggregate(errs).Error(), tt.expectErr) || tt.expectErr == "") { t.Errorf("Got err: %v, Expected err: %s", errs, tt.expectErr)pkg/kubeapiserver/options/plugins.go1
17:9package-comments
pkg/kubeapiserver/options/plugins.go:17:9
package optionspkg/scheduler/framework/preemption/podgrouppreemption_test.go1
1462:26possible-nil-dereference
pkg/scheduler/framework/preemption/podgrouppreemption_test.go:1462:26
gotNames := sets.Set[string]{} for _, p := range res.victims.Pods { gotNames.Insert(p.Name)pkg/proxy/ipvs/proxier.go1
954:14range-value-address
pkg/proxy/ipvs/proxier.go:954:14
// ipset call entry = &utilipset.Entry{ IP: ingress.String(),pkg/registry/rbac/clusterrolebinding/policybased/storage.go1
133:7receiver-naming
pkg/registry/rbac/clusterrolebinding/policybased/storage.go:133:7
func (s *Storage) GetSingularName() string { snp, ok := s.StandardStorage.(rest.SingularNameProvider)pkg/registry/certificates/podcertificaterequest/strategy.go1
150:62redefines-builtin-id
pkg/registry/certificates/podcertificaterequest/strategy.go:150:62
func (s *StatusStrategy) ValidateUpdate(ctx context.Context, new, old runtime.Object) field.ErrorList { oldPCR := old.(*certificates.PodCertificateRequest)pkg/proxy/apis/config/validation/validation_test.go1
555:72redundant-conversion
pkg/proxy/apis/config/validation/validation_test.go:555:72
ccc: componentbaseconfig.ClientConnectionConfiguration{Burst: -5}, expectedErrs: field.ErrorList{field.Invalid(newPath.Child("Burst"), int64(-5), "must be greater than or equal to 0")}, },pkg/proxy/iptables/proxier.go1
34:2redundant-import-alias
pkg/proxy/iptables/proxier.go:34:2
v1 "k8s.io/api/core/v1" discovery "k8s.io/api/discovery/v1"pkg/proxy/apis/config/validation/validation.go1
338:2single-case-switch
pkg/proxy/apis/config/validation/validation.go:338:2
allErrs := field.ErrorList{} switch mode { case kubeproxyconfig.LocalModeBridgeInterface:pkg/proxy/util/utils_test.go1
358:8slice-preallocation
pkg/proxy/util/utils_test.go:358:8
var cidrStr []string for _, cidr := range cidrMap[ipFamily] {pkg/proxy/endpointslicecache.go1
177:4task-comment
pkg/proxy/endpointslicecache.go:177:4
} // TODO: handle nil ports to mean "all" if port.Port == nil || *port.Port == int32(0) {pkg/kubeapiserver/options/authentication_test.go1
795:6test-parallelism
pkg/kubeapiserver/options/authentication_test.go:795:6
func TestToAuthenticationConfig_OIDC(t *testing.T) { testCases := []struct {pkg/proxy/conntrack/conntrack.go1
48:1top-level-declaration-order
pkg/proxy/conntrack/conntrack.go:48:1
var _ Interface = &conntracker{}pkg/proxy/winkernel/proxier_test.go1
2094:26unchecked-type-assertion
pkg/proxy/winkernel/proxier_test.go:2094:26
// Pre-populate the local HNS endpoint at sharedEPIP (as CNI would create it) hcnMock := (proxier.hcn).(*fakehcn.HcnMock) hcnMock.PopulateQueriedEndpoints(endpointLocal1, networkId, sharedEPIP, macAddressLocal1, prefixLen)pkg/registry/flowcontrol/ensurer/prioritylevelconfiguration_test.go1
481:60unexported-return
pkg/registry/flowcontrol/ensurer/prioritylevelconfiguration_test.go:481:60
func (b *plBuilder) WithAutoUpdateAnnotation(value string) *plBuilder { setAnnotation(b.object, value)pkg/proxy/conntrack/sysctls_test.go1
100:51unused-parameter
pkg/proxy/conntrack/sysctls_test.go:100:51
}func (fc *fakeConntracker) SetTCPCloseWaitTimeout(ctx context.Context, seconds int) error { fc.called = append(fc.called, fmt.Sprintf("SetTCPCloseWaitTimeout(%d)", seconds))pkg/proxy/healthcheck/healthcheck_test.go1
113:7unused-receiver
pkg/proxy/healthcheck/healthcheck_test.go:113:7
func (fake *fakeHTTPServer) Serve(listener net.Listener) error { return nil // Cause the goroutine to returnpkg/proxy/config/config.go1
333:43use-any
pkg/proxy/config/config.go:333:43
func (c *NodeConfig) handleDeleteNode(obj interface{}) { node, ok := obj.(*v1.Node)pkg/kubeapiserver/options/authentication.go1
865:33use-errors-new
pkg/kubeapiserver/options/authentication.go:865:33
if o.OIDC != nil && o.OIDC.FlagsSet { allErrors = append(allErrors, fmt.Errorf("authentication-config file and oidc-* flags are mutually exclusive")) }pkg/scheduler/framework/plugins/defaultpreemption/default_preemption.go1
396:3use-slices-sort
pkg/scheduler/framework/plugins/defaultpreemption/default_preemption.go:396:3
if len(violatingVictims) != 0 && len(nonViolatingVictims) != 0 { sort.Slice(victims, func(i, j int) bool { return pl.MoreImportantVictim(victims[i], victims[j]) }) }pkg/proxy/endpointschangetracker_test.go1
476:2var-naming
pkg/proxy/endpointschangetracker_test.go:476:2
} complexAfter1_s1 := func(eps *discovery.EndpointSlice) { eps.Endpoints = []discovery.Endpoint{{pkg/kubeapiserver/options/authentication_test.go2
123:20add-constant
pkg/kubeapiserver/options/authentication_test.go:123:20
IssuerURL: "https://testIssuerURL", ClientID: "testClientID", FlagsSet: true,1612:6cognitive-complexity
pkg/kubeapiserver/options/authentication_test.go:1612:6
func TestToAuthenticationConfigForServiceAccount(t *testing.T) {pkg/registry/core/service/ipallocator/ipallocator.go1
237:21confusing-naming
pkg/registry/core/service/ipallocator/ipallocator.go:237:21
// It starts allocating from a random IP within each range.func (a *Allocator) allocateNextService(svc *api.Service, dryRun bool) (net.IP, error) { if !a.ready.Load() || !a.ipAddressSynced() {pkg/scheduler/framework/plugins/nodevolumelimits/csi.go1
499:127confusing-results
pkg/scheduler/framework/plugins/nodevolumelimits/csi.go:499:127
// the information of the CSI driver that the plugin has been migrated to.func (pl *CSILimits) getCSIDriverInfo(logger klog.Logger, csiNode *storagev1.CSINode, pvc *v1.PersistentVolumeClaim) (string, string) { pvName := pvc.Spec.VolumeNamepkg/registry/flowcontrol/ensurer/strategy.go1
150:6constructor-interface-return
pkg/registry/flowcontrol/ensurer/strategy.go:150:6
// NewMandatoryEnsureStrategy returns an EnsureStrategy for mandatory config objectsfunc NewMandatoryEnsureStrategy[ObjectType configurationObjectType]() EnsureStrategy[ObjectType] { return &strategy[ObjectType]{pkg/proxy/endpointschangetracker_test.go1
186:6cyclomatic-complexity
pkg/proxy/endpointschangetracker_test.go:186:6
func TestUpdateEndpointsMap(t *testing.T) { emptyEndpoint := func(eps *discovery.EndpointSlice) {pkg/registry/certificates/podcertificaterequest/storage/storage_test.go1
167:5deprecated-api-usage
pkg/registry/certificates/podcertificaterequest/storage/storage_test.go:167:5
PKIXPublicKey: ed25519PubPKIX1, ProofOfPossession: ed25519Proof1, UnverifiedUserAnnotations: map[string]string{"test/foo": "bar"},pkg/proxy/healthcheck/healthcheck_test.go1
163:2discarded-error-result
pkg/proxy/healthcheck/healthcheck_test.go:163:2
} hcs.SyncEndpoints(nil) if len(hcs.services) != 0 {pkg/kubeapiserver/authorizer/modes/modes.go1
39:1doc-comment-period
pkg/kubeapiserver/authorizer/modes/modes.go:39:1
// IsValidAuthorizationMode returns true if the given authorization mode is a valid one for the apiserverfunc IsValidAuthorizationMode(authzMode string) bool {pkg/scheduler/framework/runtime/registry_test.go1
80:3early-return
pkg/scheduler/framework/runtime/registry_test.go:80:3
for name, pluginFactory := range registryY { if val, ok := registryX[name]; ok { p1, _ := pluginFactory(nil, nil, nil)pkg/proxy/config/config_test.go1
653:13error-strings
pkg/proxy/config/config_test.go:653:13
case <-time.After(wait.ForeverTestTimeout): t.Errorf("Timed out. Expected %#v, Got %#v", expectedServiceCIDRs, serviceCIDRs) returnpkg/kubeapiserver/options/admission.go1
56:6exported-declaration-comment
pkg/kubeapiserver/options/admission.go:56:6
// Servers that do care can overwrite/append that field after creation.func NewAdmissionOptions() *AdmissionOptions { options := genericoptions.NewAdmissionOptions()pkg/proxy/ipvs/proxier.go2
1:1file-length-limit
pkg/proxy/ipvs/proxier.go:1:1
//go:build linux122:2flag-parameter
pkg/proxy/ipvs/proxier.go:122:2
healthzServer *healthcheck.ProxyHealthServer, initOnly bool,) (proxy.Provider, error) {pkg/kubeapiserver/options/authorization.go1
1:1format
pkg/kubeapiserver/options/authorization.go:1:1
/*Copyright 2016 The Kubernetes Authors.- Fix (safe): run `strider fmt pkg/kubeapiserver/options/authorization.go`
pkg/kubeapiserver/options/authentication_test.go1
1247:6function-length
pkg/kubeapiserver/options/authentication_test.go:1247:6
func TestLoadAuthenticationConfig(t *testing.T) { testCases := []struct {pkg/registry/core/service/storage/storage.go1
74:6function-result-limit
pkg/registry/core/service/storage/storage.go:74:6
// NewREST returns a REST object that will work against services.func NewREST( optsGetter generic.RESTOptionsGetter,pkg/proxy/ipvs/ipset/ipset.go1
423:2import-shadowing
pkg/proxy/ipvs/ipset/ipset.go:423:2
cmd.SetStdin(bytes.NewReader([]byte{})) bytes, err := cmd.CombinedOutput() if err != nil {pkg/scheduler/backend/cache/node_tree.go1
60:3inefficient-map-lookup
pkg/scheduler/backend/cache/node_tree.go:60:3
} nt.tree[zone] = append(na, n.Name) } else {pkg/scheduler/framework/preemption/executor_test.go1
1841:9inefficient-sprintf
pkg/scheduler/framework/preemption/executor_test.go:1841:9
for _, tt := range tests { t.Run(fmt.Sprintf("%v", tt.name), func(t *testing.T) {pkg/kubeapiserver/options/authentication_test.go1
477:36insecure-url-scheme
pkg/kubeapiserver/options/authentication_test.go:477:36
Lookup: true, Issuers: []string{"http://foo.bar.com"}, JWKSURI: "https://qux.com",pkg/scheduler/framework/plugins/volumebinding/binder.go1
243:6max-parameters
pkg/scheduler/framework/plugins/volumebinding/binder.go:243:6
// capacityCheck determines how storage capacity is checked (CSIStorageCapacity feature).func NewVolumeBinder( logger klog.Logger,pkg/scheduler/apis/config/types_pluginargs.go1
139:6max-public-structs
pkg/scheduler/apis/config/types_pluginargs.go:139:6
// ResourceSpec represents single resource.type ResourceSpec struct { // Name of the resource.pkg/proxy/apis/config/v1alpha1/conversion.go1
45:3modifies-parameter
pkg/proxy/apis/config/v1alpha1/conversion.go:45:3
out.IPVS.SyncPeriod = in.SyncPeriod out.IPVS.MinSyncPeriod = in.MinSyncPeriod case kubeproxyconfig.ProxyModeNFTables:pkg/scheduler/framework/plugins/interpodaffinity/scoring.go1
55:5modifies-value-receiver
pkg/scheduler/framework/plugins/interpodaffinity/scoring.go:55:5
if m[term.TopologyKey] == nil { m[term.TopologyKey] = make(map[string]int64) }pkg/proxy/apis/config/validation/validation_test.go1
272:41nested-structs
pkg/proxy/apis/config/validation/validation_test.go:272:41
newPath := field.NewPath("KubeProxyConfiguration") for name, testCase := range map[string]struct { config kubeproxyconfig.KubeProxyLinuxConfigurationpkg/registry/core/service/ipallocator/cidrallocator_test.go1
508:4nil-error-return
pkg/registry/core/service/ipallocator/cidrallocator_test.go:508:4
t.Logf("unexpected error %v", err) return false, nil }pkg/registry/core/pod/storage/eviction_test.go1
1041:2nil-value-with-nil-error
pkg/registry/core/pod/storage/eviction_test.go:1041:2
func (ms *mockStore) ConvertToTable(ctx context.Context, object runtime.Object, tableOptions runtime.Object) (*metav1.Table, error) { return nil, nil}pkg/registry/apps/rest/storage_apps.go1
45:4no-else-after-return
pkg/registry/apps/rest/storage_apps.go:45:4
return genericapiserver.APIGroupInfo{}, err } else if len(storageMap) > 0 { apiGroupInfo.VersionedResourcesStorageMap[appsapiv1.SchemeGroupVersion.Version] = storageMappkg/scheduler/framework/plugins/interpodaffinity/filtering_test.go1
47:6no-init
pkg/scheduler/framework/plugins/interpodaffinity/filtering_test.go:47:6
func init() { metrics.Register()pkg/proxy/nftables/proxier.go1
1734:3no-naked-return
pkg/proxy/nftables/proxier.go:1734:3
proxier.logFailure(tx) return }pkg/proxy/apis/config/register.go1
34:2no-package-var
pkg/proxy/apis/config/register.go:34:2
// AddToScheme is a global function that registers this API group & version to a scheme AddToScheme = SchemeBuilder.AddToScheme)pkg/kubeapiserver/options/authorization.go1
199:10optimize-operands-order
pkg/kubeapiserver/options/authorization.go:199:10
return fs.Changed(authorizationModeFlag) || fs.Changed(authorizationWebhookConfigFileFlag) ||pkg/proxy/apis/config/doc.go1
20:9package-comments
pkg/proxy/apis/config/doc.go:20:9
package configpkg/scheduler/framework/preemption/podgrouppreemption_test.go1
1469:11possible-nil-dereference
pkg/scheduler/framework/preemption/podgrouppreemption_test.go:1469:11
} if res.numPodGroupDisruptions != tt.expectedNumPodGroupDisruptions { t.Errorf("numPodGroupDisruptions mismatch. Want %d, Got %d", tt.expectedNumPodGroupDisruptions, res.numPodGroupDisruptions)pkg/proxy/ipvs/proxier.go1
954:14range-value-address
pkg/proxy/ipvs/proxier.go:954:14
// ipset call entry = &utilipset.Entry{ IP: ingress.String(),pkg/registry/rbac/role/policybased/storage.go1
67:7receiver-naming
pkg/registry/rbac/role/policybased/storage.go:67:7
func (s *Storage) Create(ctx context.Context, obj runtime.Object, createValidation rest.ValidateObjectFunc, options *metav1.CreateOptions) (runtime.Object, error) { if rbacregistry.EscalationAllowed(ctx) || rbacregistry.RoleEscalationAuthorized(ctx, s.authorizer) {pkg/registry/core/pod/strategy.go1
392:40redefines-builtin-id
pkg/registry/core/pod/strategy.go:392:40
func dropNonResizeUpdatesForContainers(new, old []api.Container) []api.Container { if len(new) == 0 {pkg/proxy/conntrack/cleanup.go1
84:29redundant-conversion
pkg/proxy/conntrack/cleanup.go:84:29
if endpoint.IsServing() { portStr := strconv.Itoa(int(endpoint.Port())) endpoints.Insert(net.JoinHostPort(endpoint.IP(), portStr))pkg/proxy/iptables/proxier_test.go1
38:2redundant-import-alias
pkg/proxy/iptables/proxier_test.go:38:2
v1 "k8s.io/api/core/v1" discovery "k8s.io/api/discovery/v1"pkg/proxy/endpointschangetracker_test.go1
1059:5single-case-switch
pkg/proxy/endpointschangetracker_test.go:1059:5
prev, curr := tc.previousEndpointSlices[i], tc.currentEndpointSlices[i] switch { case prev == nil && curr == nil:pkg/proxy/util/utils_test.go1
362:8slice-preallocation
pkg/proxy/util/utils_test.go:362:8
} var cidrStrOther []string for _, cidr := range cidrMap[otherIPFamily] {pkg/proxy/iptables/proxier_test.go1
85:2task-comment
pkg/proxy/iptables/proxier_test.go:85:2
func NewFakeProxier(ipt utiliptables.Interface) *Proxier { // TODO: Call NewProxier after refactoring out the goroutine // invocation into a Run() method.pkg/kubeapiserver/options/authentication_test.go1
1066:24test-parallelism
pkg/kubeapiserver/options/authentication_test.go:1066:24
for _, testcase := range testCases { t.Run(testcase.name, func(t *testing.T) { opts := NewBuiltInAuthenticationOptions().WithOIDC()pkg/proxy/conntrack/fake.go1
36:1top-level-declaration-order
pkg/proxy/conntrack/fake.go:36:1
var _ netlinkHandler = (*fakeHandler)(nil)pkg/proxy/winkernel/proxier_test.go1
2256:26unchecked-type-assertion
pkg/proxy/winkernel/proxier_test.go:2256:26
// Pre-populate the local HNS endpoint (as CNI would create it). hcnMock := (proxier.hcn).(*fakehcn.HcnMock) hcnMock.PopulateQueriedEndpoints(endpointLocal1, networkId, localIP, macAddressLocal1, prefixLen)pkg/registry/flowcontrol/ensurer/prioritylevelconfiguration_test.go1
486:65unexported-return
pkg/registry/flowcontrol/ensurer/prioritylevelconfiguration_test.go:486:65
func (b *plBuilder) WithLimited(nominalConcurrencyShares int32) *plBuilder { b.object.Spec.Type = flowcontrolv1.PriorityLevelEnablementLimitedpkg/proxy/conntrack/sysctls_test.go1
104:44unused-parameter
pkg/proxy/conntrack/sysctls_test.go:104:44
}func (fc *fakeConntracker) SetTCPBeLiberal(ctx context.Context, value int) error { fc.called = append(fc.called, fmt.Sprintf("SetTCPBeLiberal(%d)", value))pkg/proxy/healthcheck/healthcheck_test.go1
117:7unused-receiver
pkg/proxy/healthcheck/healthcheck_test.go:117:7
func (fake *fakeHTTPServer) Close() error { return nilpkg/proxy/config/config.go1
378:22use-any
pkg/proxy/config/config.go:378:22
cache.ResourceEventHandlerFuncs{ AddFunc: func(obj interface{}) { result.handleServiceCIDREvent(nil, obj)pkg/kubeapiserver/options/authentication.go1
897:15use-errors-new
pkg/kubeapiserver/options/authentication.go:897:15
if len(data) == 0 { return nil, fmt.Errorf("empty config data") }pkg/scheduler/framework/plugins/defaultpreemption/default_preemption_test.go1
1242:4use-slices-sort
pkg/scheduler/framework/plugins/defaultpreemption/default_preemption_test.go:1242:4
} sort.Slice(nodeInfos, func(i, j int) bool { return nodeInfos[i].Node().Name < nodeInfos[j].Node().Namepkg/proxy/endpointschangetracker_test.go1
488:2var-naming
pkg/proxy/endpointschangetracker_test.go:488:2
} complexAfter1_s2 := func(eps *discovery.EndpointSlice) { eps.Endpoints = []discovery.Endpoint{{pkg/kubeapiserver/options/authentication_test.go1
215:24add-constant
pkg/kubeapiserver/options/authentication_test.go:215:24
testSA: &ServiceAccountAuthenticationOptions{ KeyFiles: []string{"cert", "key"}, Issuers: []string{"http://foo.bar.com"},pkg/kubeapiserver/options/authorization.go1
97:39cognitive-complexity
pkg/kubeapiserver/options/authorization.go:97:39
// Validate checks invalid config combinationfunc (o *BuiltInAuthorizationOptions) Validate() []error { if o == nil {pkg/registry/core/service/ipallocator/ipallocator.go1
375:21confusing-naming
pkg/registry/core/service/ipallocator/ipallocator.go:375:21
func (a *Allocator) release(ip net.IP, dryRun bool) error { if dryRun {pkg/scheduler/framework/plugins/nodevolumelimits/csi.go1
552:133confusing-results
pkg/scheduler/framework/plugins/nodevolumelimits/csi.go:552:133
// getCSIDriverInfoFromSC returns the CSI driver name and a random volume ID of a given PVC's StorageClass.func (pl *CSILimits) getCSIDriverInfoFromSC(logger klog.Logger, csiNode *storagev1.CSINode, pvc *v1.PersistentVolumeClaim) (string, string) { namespace := pvc.Namespacepkg/registry/rbac/clusterrole/registry.go1
42:6constructor-interface-return
pkg/registry/rbac/clusterrole/registry.go:42:6
// types will panic.func NewRegistry(s rest.StandardStorage) Registry { return &storage{s}pkg/proxy/endpointschangetracker_test.go1
1612:6cyclomatic-complexity
pkg/proxy/endpointschangetracker_test.go:1612:6
func compareEndpointsMapsStr(t *testing.T, newMap EndpointsMap, expected map[ServicePortName][]*BaseEndpointInfo) { t.Helper()pkg/registry/certificates/podcertificaterequest/storage/storage_test.go1
221:5deprecated-api-usage
pkg/registry/certificates/podcertificaterequest/storage/storage_test.go:221:5
MaxExpirationSeconds: ptr.To[int32](86400), PKIXPublicKey: ed25519PubPKIX1, ProofOfPossession: ed25519Proof1,pkg/proxy/healthcheck/healthcheck_test.go1
169:2discarded-error-result
pkg/proxy/healthcheck/healthcheck_test.go:169:2
// sync unknown endpoints, should be dropped hcs.SyncEndpoints(map[types.NamespacedName]int{mknsn("a", "b"): 93}) if len(hcs.services) != 0 {pkg/kubeapiserver/options/admission.go1
70:1doc-comment-period
pkg/kubeapiserver/options/admission.go:70:1
// AddFlags adds flags related to admission for kube-apiserver to the specified FlagSetfunc (a *AdmissionOptions) AddFlags(fs *pflag.FlagSet) {pkg/scheduler/testing/framework/fake_extender.go1
326:10early-return
pkg/scheduler/testing/framework/fake_extender.go:326:10
failedNodesMap[node.Node().Name] = fmt.Sprintf("FakeExtender: node %q failed", node.Node().Name) } else if status.Code() == fwk.UnschedulableAndUnresolvable { failedAndUnresolvableMap[node.Node().Name] = fmt.Sprintf("FakeExtender: node %q failed and unresolvable", node.Node().Name)pkg/proxy/conntrack/conntrack_test.go1
155:14error-strings
pkg/proxy/conntrack/conntrack_test.go:155:14
if n != tc.expectedDeleted { t.Errorf("DeleteEntries() = %d, want %d", n, tc.expectedDeleted) }pkg/kubeapiserver/options/admission.go1
91:28exported-declaration-comment
pkg/kubeapiserver/options/admission.go:91:28
// Kube-apiserver verifies PluginNames and then call generic AdmissionOptions.Validate.func (a *AdmissionOptions) Validate() []error { if a == nil {pkg/proxy/ipvs/proxier_test.go1
1:1file-length-limit
pkg/proxy/ipvs/proxier_test.go:1:1
//go:build linuxpkg/proxy/ipvs/proxier.go1
255:2flag-parameter
pkg/proxy/ipvs/proxier.go:255:2
healthzServer *healthcheck.ProxyHealthServer, initOnly bool,) (*Proxier, error) {pkg/kubeapiserver/options/authorization_test.go1
1:1format
pkg/kubeapiserver/options/authorization_test.go:1:1
/*Copyright 2018 The Kubernetes Authors.- Fix (safe): run `strider fmt pkg/kubeapiserver/options/authorization_test.go`
pkg/kubeapiserver/options/authentication_test.go1
1612:6function-length
pkg/kubeapiserver/options/authentication_test.go:1612:6
func TestToAuthenticationConfigForServiceAccount(t *testing.T) {pkg/scheduler/backend/cache/snapshot_test.go1
1159:6function-result-limit
pkg/scheduler/backend/cache/snapshot_test.go:1159:6
// simplifySnapshot for comparison in unit testsfunc simplifySnapshot(s *Snapshot) (map[string][]string, []string, []string, []string, map[string]int, map[string][]string) { nodeInfoMap := make(map[string][]string)pkg/proxy/ipvs/proxier.go1
186:2import-shadowing
pkg/proxy/ipvs/proxier.go:186:2
ipset utilipset.Interface conntrack conntrack.Interface masqueradeAll boolpkg/scheduler/backend/cache/node_tree.go1
75:5inefficient-map-lookup
pkg/scheduler/backend/cache/node_tree.go:75:5
if nodeName == n.Name { nt.tree[zone] = append(na[:i], na[i+1:]...) if len(nt.tree[zone]) == 0 {pkg/kubeapiserver/options/authentication_test.go1
1664:41insecure-url-scheme
pkg/kubeapiserver/options/authentication_test.go:1664:41
Lookup: true, Issuers: []string{"http://foo.bar.com"}, KeyFiles: []string{},pkg/scheduler/metrics/resources/resources.go1
162:6max-parameters
pkg/scheduler/metrics/resources/resources.go:162:6
func recordMetricWithUnit( ch chan<- metrics.Metric,pkg/scheduler/apis/config/types_pluginargs.go1
149:6max-public-structs
pkg/scheduler/apis/config/types_pluginargs.go:149:6
// VolumeBindingArgs holds arguments used to configure the VolumeBinding plugin.type VolumeBindingArgs struct { metav1.TypeMetapkg/proxy/apis/config/v1alpha1/conversion.go1
47:3modifies-parameter
pkg/proxy/apis/config/v1alpha1/conversion.go:47:3
case kubeproxyconfig.ProxyModeNFTables: out.NFTables.SyncPeriod = in.SyncPeriod out.NFTables.MinSyncPeriod = in.MinSyncPeriodpkg/scheduler/framework/plugins/interpodaffinity/scoring.go1
57:4modifies-value-receiver
pkg/scheduler/framework/plugins/interpodaffinity/scoring.go:57:4
} m[term.TopologyKey][tpValue] += int64(weight * multiplier) }pkg/proxy/apis/config/validation/validation_test.go1
434:41nested-structs
pkg/proxy/apis/config/validation/validation_test.go:434:41
newPath := field.NewPath("KubeProxyConfiguration") for name, testCase := range map[string]struct { mode kubeproxyconfig.ProxyModepkg/registry/core/service/ipallocator/cidrallocator_test.go1
576:4nil-error-return
pkg/registry/core/service/ipallocator/cidrallocator_test.go:576:4
t.Logf("unexpected error %v", err) return false, nil }pkg/registry/core/pod/strategy_test.go1
964:2nil-value-with-nil-error
pkg/registry/core/pod/strategy_test.go:964:2
func (f fakeTransport) RoundTrip(*http.Request) (*http.Response, error) { return nil, nil}pkg/registry/autoscaling/rest/storage_autoscaling.go1
53:4no-else-after-return
pkg/registry/autoscaling/rest/storage_autoscaling.go:53:4
return genericapiserver.APIGroupInfo{}, err } else if len(storageMap) > 0 { apiGroupInfo.VersionedResourcesStorageMap[autoscalingapiv2.SchemeGroupVersion.Version] = storageMappkg/scheduler/framework/plugins/podgrouppodscount/podgroup_pods_count_test.go1
40:6no-init
pkg/scheduler/framework/plugins/podgrouppodscount/podgroup_pods_count_test.go:40:6
func init() { metrics.Register()pkg/proxy/nftables/proxier.go1
1768:2no-naked-return
pkg/proxy/nftables/proxier.go:1768:2
} return}pkg/proxy/apis/config/scheme/scheme.go1
29:2no-package-var
pkg/proxy/apis/config/scheme/scheme.go:29:2
// Scheme defines methods for serializing and deserializing API objects. Scheme = runtime.NewScheme() // Codecs provides methods for retrieving codecs and serializers for specificpkg/kubeapiserver/options/authorization.go1
199:10optimize-operands-order
pkg/kubeapiserver/options/authorization.go:199:10
return fs.Changed(authorizationModeFlag) || fs.Changed(authorizationWebhookConfigFileFlag) ||pkg/proxy/apis/config/fuzzer/fuzzer.go1
17:9package-comments
pkg/proxy/apis/config/fuzzer/fuzzer.go:17:9
package fuzzerpkg/scheduler/framework/preemption/podgrouppreemption_test.go1
1470:105possible-nil-dereference
pkg/scheduler/framework/preemption/podgrouppreemption_test.go:1470:105
if res.numPodGroupDisruptions != tt.expectedNumPodGroupDisruptions { t.Errorf("numPodGroupDisruptions mismatch. Want %d, Got %d", tt.expectedNumPodGroupDisruptions, res.numPodGroupDisruptions) }pkg/proxy/ipvs/proxier.go1
976:14range-value-address
pkg/proxy/ipvs/proxier.go:976:14
if allowFromNode { entry = &utilipset.Entry{ IP: ingress.String(),pkg/registry/rbac/role/policybased/storage.go1
80:7receiver-naming
pkg/registry/rbac/role/policybased/storage.go:80:7
func (s *Storage) Update(ctx context.Context, name string, obj rest.UpdatedObjectInfo, createValidation rest.ValidateObjectFunc, updateValidation rest.ValidateObjectUpdateFunc, forceAllowCreate bool, options *metav1.UpdateOptions) (runtime.Object, bool, error) { if rbacregistry.EscalationAllowed(ctx) || rbacregistry.RoleEscalationAuthorized(ctx, s.authorizer) {pkg/registry/core/rest/storage_core.go1
346:81redefines-builtin-id
pkg/registry/core/rest/storage_core.go:346:81
if !utilfeature.DefaultFeatureGate.Enabled(features.MultiCIDRServiceAllocator) { primaryClusterIPAllocator, err = ipallocator.New(&serviceClusterIPRange, func(max int, rangeSpec string, offset int) (allocator.Interface, error) { var mem allocator.Snapshottablepkg/proxy/conntrack/cleanup_test.go1
161:22redundant-conversion
pkg/proxy/conntrack/cleanup_test.go:161:22
Name: ptr.To("test-tcp"), Port: ptr.To(int32(testEndpointPort)), Protocol: ptr.To(v1.ProtocolTCP),pkg/proxy/ipvs/cleanup.go1
25:2redundant-import-alias
pkg/proxy/ipvs/cleanup.go:25:2
v1 "k8s.io/api/core/v1" "k8s.io/klog/v2"pkg/proxy/healthcheck/service_health.go1
66:2single-case-switch
pkg/proxy/healthcheck/service_health.go:66:2
switch serviceFamily { case v1.IPv4Protocol:pkg/registry/core/namespace/storage/storage.go1
226:6slice-preallocation
pkg/registry/core/namespace/storage/storage.go:226:6
if changeNeeded { newFinalizers := []string{} for f := range currentFinalizers {pkg/proxy/iptables/proxier_test.go1
4098:1task-comment
pkg/proxy/iptables/proxier_test.go:4098:1
// TODO(thockin): add *more* tests for syncProxyRules() or break it down further and test the pieces.pkg/kubeapiserver/options/authentication_test.go1
1090:6test-parallelism
pkg/kubeapiserver/options/authentication_test.go:1090:6
func TestValidateOIDCOptions(t *testing.T) { testCases := []struct {pkg/proxy/conntrack/filter.go1
34:1top-level-declaration-order
pkg/proxy/conntrack/filter.go:34:1
var _ netlink.CustomConntrackFilter = (*flowFilter)(nil)pkg/proxy/winkernel/proxier_test.go1
2513:26unchecked-type-assertion
pkg/proxy/winkernel/proxier_test.go:2513:26
// Pre-populate the local HNS endpoint (as CNI would create it). hcnMock := (proxier.hcn).(*fakehcn.HcnMock) hcnMock.PopulateQueriedEndpoints(endpointLocal1, networkId, localIP, macAddressLocal1, prefixLen)pkg/registry/flowcontrol/ensurer/prioritylevelconfiguration_test.go1
499:75unexported-return
pkg/registry/flowcontrol/ensurer/prioritylevelconfiguration_test.go:499:75
// must be called after WithLimitedfunc (b *plBuilder) WithQueuing(queues, handSize, queueLengthLimit int32) *plBuilder { limited := b.object.Spec.Limitedpkg/proxy/conntrack/sysctls_test.go1
108:42unused-parameter
pkg/proxy/conntrack/sysctls_test.go:108:42
}func (fc *fakeConntracker) SetUDPTimeout(ctx context.Context, seconds int) error { fc.called = append(fc.called, fmt.Sprintf("SetUDPTimeout(%d)", seconds))pkg/proxy/healthcheck/service_health.go1
302:7unused-receiver
pkg/proxy/healthcheck/service_health.go:302:7
// SyncServices is part of ServiceHealthServerfunc (fake FakeServiceHealthServer) SyncServices(_ map[types.NamespacedName]uint16) error { return nilpkg/proxy/config/config.go1
381:36use-any
pkg/proxy/config/config.go:381:36
}, UpdateFunc: func(oldObj, newObj interface{}) { result.handleServiceCIDREvent(oldObj, newObj)pkg/kubeapiserver/options/authentication.go1
909:15use-errors-new
pkg/kubeapiserver/options/authentication.go:909:15
if configuration == nil { // sanity check, this should never happen but check just in case since we rely on it return nil, fmt.Errorf("expected non-nil AuthenticationConfiguration") }pkg/scheduler/framework/plugins/defaultpreemption/default_preemption_test.go1
1270:6use-slices-sort
pkg/scheduler/framework/plugins/defaultpreemption/default_preemption_test.go:1270:6
victims := got[i].Victims().Pods sort.Slice(victims, func(i, j int) bool { return victims[i].Name < victims[j].Namepkg/proxy/endpointschangetracker_test.go1
1090:2var-naming
pkg/proxy/endpointschangetracker_test.go:1090:2
startTime := time.Date(2018, 01, 01, 0, 0, 0, 0, time.UTC) t_1 := startTime.Add(-time.Second) t0 := startTime.Add(time.Second)pkg/kubeapiserver/options/authentication_test.go1
215:32add-constant
pkg/kubeapiserver/options/authentication_test.go:215:32
testSA: &ServiceAccountAuthenticationOptions{ KeyFiles: []string{"cert", "key"}, Issuers: []string{"http://foo.bar.com"},pkg/kubeapiserver/options/authorization.go1
208:39cognitive-complexity
pkg/kubeapiserver/options/authorization.go:208:39
// ToAuthorizationConfig convert BuiltInAuthorizationOptions to authorizer.Configfunc (o *BuiltInAuthorizationOptions) ToAuthorizationConfig(versionedInformerFactory versionedinformers.SharedInformerFactory) (*authorizer.Config, error) { if o == nil {pkg/registry/core/service/storage/transaction.go1
52:31confusing-naming
pkg/registry/core/service/storage/transaction.go:52:31
func (cb callbackTransaction) Commit() { if cb.commit != nil {pkg/scheduler/framework/plugins/volumebinding/binder.go1
837:132confusing-results
pkg/scheduler/framework/plugins/volumebinding/binder.go:837:132
func (b *volumeBinder) checkBoundClaims(logger klog.Logger, claims []*v1.PersistentVolumeClaim, node *v1.Node, pod *v1.Pod) (bool, bool, error) { csiNode, err := b.csiNodeLister.Get(node.Name)pkg/registry/rbac/clusterrolebinding/registry.go1
42:6constructor-interface-return
pkg/registry/rbac/clusterrolebinding/registry.go:42:6
// types will panic.func NewRegistry(s rest.StandardStorage) Registry { return &storage{s}pkg/proxy/endpointslicecache.go1
197:34cyclomatic-complexity
pkg/proxy/endpointslicecache.go:197:34
// addEndpoints adds an Endpoint for each unique endpoint.func (cache *EndpointSliceCache) addEndpoints(svcPortName *ServicePortName, portNum int, endpointSet map[string]Endpoint, endpoints []discovery.Endpoint) map[string]Endpoint { if endpointSet == nil {pkg/registry/certificates/podcertificaterequest/storage/storage_test.go1
222:5deprecated-api-usage
pkg/registry/certificates/podcertificaterequest/storage/storage_test.go:222:5
PKIXPublicKey: ed25519PubPKIX1, ProofOfPossession: ed25519Proof1, UnverifiedUserAnnotations: map[string]string{"test/foo": "bar"},pkg/proxy/healthcheck/healthcheck_test.go1
176:2discarded-error-result
pkg/proxy/healthcheck/healthcheck_test.go:176:2
nsn := mknsn("a", "b") hcs.SyncServices(map[types.NamespacedName]uint16{nsn: 9376}) if len(hcs.services) != 1 {pkg/kubeapiserver/options/authentication.go1
84:1doc-comment-period
pkg/kubeapiserver/options/authentication.go:84:1
// BuiltInAuthenticationOptions contains all build-in authentication options for API Servertype BuiltInAuthenticationOptions struct {pkg/proxy/conntrack/conntrack_test.go1
163:14error-strings
pkg/proxy/conntrack/conntrack_test.go:163:14
if len(left) != tc.expectedLeft { t.Errorf("ListEntries() left = %d, want %d", len(left), tc.expectedLeft) }pkg/kubeapiserver/options/admission.go1
115:28exported-declaration-comment
pkg/kubeapiserver/options/admission.go:115:28
// Kube-apiserver just call generic AdmissionOptions.ApplyTo.func (a *AdmissionOptions) ApplyTo( c *server.Config,pkg/proxy/nftables/helpers_test.go1
1:1file-length-limit
pkg/proxy/nftables/helpers_test.go:1:1
//go:build linuxpkg/proxy/ipvs/proxier.go1
393:18flag-parameter
pkg/proxy/ipvs/proxier.go:393:18
func filterCIDRs(wantIPv6 bool, cidrs []string) []string { var filteredCIDRs []stringpkg/kubeapiserver/options/options.go1
1:1format
pkg/kubeapiserver/options/options.go:1:1
/*Copyright 2017 The Kubernetes Authors.- Fix (safe): run `strider fmt pkg/kubeapiserver/options/options.go`
pkg/kubeapiserver/options/authorization_test.go1
34:6function-length
pkg/kubeapiserver/options/authorization_test.go:34:6
func TestAuthzValidate(t *testing.T) { examplePolicyFile := "../../auth/authorizer/abac/example_policy_file.jsonl"pkg/scheduler/extender.go1
249:24function-result-limit
pkg/scheduler/extender.go:249:24
// unresolvable.func (h *HTTPExtender) Filter( pod *v1.Pod,pkg/proxy/ipvs/proxier.go1
1492:2import-shadowing
pkg/proxy/ipvs/proxier.go:1492:2
func (proxier *Proxier) acceptIPVSTraffic() { sets := []string{kubeClusterIPSet, kubeLoadBalancerSet} for _, set := range sets {pkg/scheduler/backend/cache/node_tree.go1
76:12inefficient-map-lookup
pkg/scheduler/backend/cache/node_tree.go:76:12
nt.tree[zone] = append(na[:i], na[i+1:]...) if len(nt.tree[zone]) == 0 { nt.removeZone(zone)pkg/kubeapiserver/options/authentication_test.go1
1670:52insecure-url-scheme
pkg/kubeapiserver/options/authentication_test.go:1670:52
expectConfig: kubeauthenticator.Config{ APIAudiences: authenticator.Audiences{"http://foo.bar.com"}, ServiceAccountLookup: true,pkg/scheduler/schedule_one_test.go1
4661:6max-parameters
pkg/scheduler/schedule_one_test.go:4661:6
// cache: scheduler cache that might contain assumed pods.func setupTestSchedulerWithOnePodOnNode(ctx context.Context, t *testing.T, client clientset.Interface, queuedPodStore *clientcache.FIFO, scache internalcache.Cache, apiDispatcher *apidispatcher.APIDispatcher, pod *v1.Pod, node *v1.Node, bindingChan chan *v1.Binding, fns ...tf.RegisterPluginFunc) (*Scheduler, chan error) {pkg/scheduler/apis/config/types_pluginargs.go1
176:6max-public-structs
pkg/scheduler/apis/config/types_pluginargs.go:176:6
// NodeAffinityArgs holds arguments to configure the NodeAffinity plugin.type NodeAffinityArgs struct { metav1.TypeMetapkg/proxy/apis/config/v1alpha1/conversion.go1
48:3modifies-parameter
pkg/proxy/apis/config/v1alpha1/conversion.go:48:3
out.NFTables.SyncPeriod = in.SyncPeriod out.NFTables.MinSyncPeriod = in.MinSyncPeriod default:pkg/scheduler/framework/plugins/interpodaffinity/scoring.go1
72:4modifies-value-receiver
pkg/scheduler/framework/plugins/interpodaffinity/scoring.go:72:4
if scores == nil { m[topology] = oScores continuepkg/proxy/apis/config/validation/validation_test.go1
505:41nested-structs
pkg/proxy/apis/config/validation/validation_test.go:505:41
newPath := field.NewPath("KubeProxyConfiguration") for name, testCase := range map[string]struct { mode kubeproxyconfig.ProxyModepkg/registry/core/service/ipallocator/cidrallocator_test.go1
635:4nil-error-return
pkg/registry/core/service/ipallocator/cidrallocator_test.go:635:4
t.Logf("unexpected error %v", err) return false, nil }pkg/registry/core/rest/storage_core_test.go1
45:2nil-value-with-nil-error
pkg/registry/core/rest/storage_core_test.go:45:2
func (f fakeStorageFactory) NewConfig(groupResource schema.GroupResource, example runtime.Object) (*storagebackend.ConfigForResource, error) { return nil, nil}pkg/registry/autoscaling/rest/storage_autoscaling.go1
59:4no-else-after-return
pkg/registry/autoscaling/rest/storage_autoscaling.go:59:4
return genericapiserver.APIGroupInfo{}, err } else if len(storageMap) > 0 { apiGroupInfo.VersionedResourcesStorageMap[autoscalingapiv1.SchemeGroupVersion.Version] = storageMappkg/scheduler/framework/plugins/podtopologyspread/filtering_test.go1
68:6no-init
pkg/scheduler/framework/plugins/podtopologyspread/filtering_test.go:68:6
func init() { metrics.Register()pkg/proxy/topology.go1
51:3no-naked-return
pkg/proxy/topology.go:51:3
// If there are no endpoints, we have nothing to categorize return }pkg/proxy/apis/config/scheme/scheme.go1
32:2no-package-var
pkg/proxy/apis/config/scheme/scheme.go:32:2
// versions and content types. Codecs = serializer.NewCodecFactory(Scheme, serializer.EnableStrict))pkg/kubeapiserver/options/authorization.go1
199:10optimize-operands-order
pkg/kubeapiserver/options/authorization.go:199:10
return fs.Changed(authorizationModeFlag) || fs.Changed(authorizationWebhookConfigFileFlag) ||pkg/proxy/apis/config/register.go1
17:9package-comments
pkg/proxy/apis/config/register.go:17:9
package configpkg/scheduler/framework/preemption/podgrouppreemption_test.go1
1472:11possible-nil-dereference
pkg/scheduler/framework/preemption/podgrouppreemption_test.go:1472:11
} if res.victims.NumPDBViolations != int64(tt.expectedNumPDBViolations) { t.Errorf("NumPDBViolations mismatch. Want %d, Got %d", tt.expectedNumPDBViolations, res.victims.NumPDBViolations)pkg/proxy/ipvs/proxier.go1
996:12range-value-address
pkg/proxy/ipvs/proxier.go:996:12
// ipvs call serv := &utilipvs.VirtualServer{ Address: ingress,pkg/registry/rbac/role/policybased/storage.go1
105:7receiver-naming
pkg/registry/rbac/role/policybased/storage.go:105:7
func (s *Storage) GetSingularName() string { snp, ok := s.StandardStorage.(rest.SingularNameProvider)pkg/registry/core/rest/storage_core.go1
367:72redefines-builtin-id
pkg/registry/core/rest/storage_core.go:367:72
if !utilfeature.DefaultFeatureGate.Enabled(features.DisableAllocatorDualWrite) { bitmapAllocator, err = ipallocator.New(&serviceClusterIPRange, func(max int, rangeSpec string, offset int) (allocator.Interface, error) { mem := allocator.NewAllocationMapWithOffset(max, rangeSpec, offset)pkg/proxy/conntrack/cleanup_test.go1
166:22redundant-conversion
pkg/proxy/conntrack/cleanup_test.go:166:22
Name: ptr.To("test-udp"), Port: ptr.To(int32(testEndpointPort)), Protocol: ptr.To(v1.ProtocolUDP),pkg/proxy/ipvs/cleanup_test.go1
28:2redundant-import-alias
pkg/proxy/ipvs/cleanup_test.go:28:2
v1 "k8s.io/api/core/v1" discovery "k8s.io/api/discovery/v1"pkg/proxy/iptables/proxier_test.go1
673:4single-case-switch
pkg/proxy/iptables/proxier_test.go:673:4
sort.Slice(table.Chains, func(i, j int) bool { switch { case table.Chains[i].Name == kubeNodePortsChain:pkg/registry/core/pod/storage/eviction.go1
504:6slice-preallocation
pkg/registry/core/pod/storage/eviction.go:504:6
var pdbs []policyv1.PodDisruptionBudget for _, pdb := range pdbList.Items {pkg/proxy/ipvs/cleanup_test.go1
162:2task-comment
pkg/proxy/ipvs/cleanup_test.go:162:2
// FIXME: check ipvs and ipset state}pkg/kubeapiserver/options/authentication_test.go1
1224:18test-parallelism
pkg/kubeapiserver/options/authentication_test.go:1224:18
for _, tt := range testCases { t.Run(tt.name, func(t *testing.T) { opts := NewBuiltInAuthenticationOptions().WithOIDC()pkg/proxy/conntrack/sysctls.go1
43:1top-level-declaration-order
pkg/proxy/conntrack/sysctls.go:43:1
// https://www.kernel.org/doc/Documentation/networking/nf_conntrack-sysctl.txttype conntrackConfigurer interface { // SetMax adjusts nf_conntrack_max.pkg/proxy/winkernel/proxier_test.go1
2554:46unchecked-type-assertion
pkg/proxy/winkernel/proxier_test.go:2554:46
// Record the old LB IDs for both services. svc1Info := proxier.svcPortMap[svcPortName1].(*serviceInfo) svc2Info := proxier.svcPortMap[svcPortName2].(*serviceInfo)pkg/registry/resource/resourceclaim/strategy.go1
58:97unexported-return
pkg/registry/resource/resourceclaim/strategy.go:58:97
// NewStrategy is the default logic that applies when creating and updating ResourceClaim objects.func NewStrategy(nsClient v1.NamespaceInterface, authorizer authorizer.UnconditionalAuthorizer) *resourceclaimStrategy { return &resourceclaimStrategy{pkg/proxy/conntrack/sysctls_test.go1
112:48unused-parameter
pkg/proxy/conntrack/sysctls_test.go:112:48
}func (fc *fakeConntracker) SetUDPStreamTimeout(ctx context.Context, seconds int) error { fc.called = append(fc.called, fmt.Sprintf("SetUDPStreamTimeout(%d)", seconds))pkg/proxy/healthcheck/service_health.go1
307:7unused-receiver
pkg/proxy/healthcheck/service_health.go:307:7
// SyncEndpoints is part of ServiceHealthServerfunc (fake FakeServiceHealthServer) SyncEndpoints(_ map[types.NamespacedName]int) error { return nilpkg/proxy/config/config.go1
384:25use-any
pkg/proxy/config/config.go:384:25
}, DeleteFunc: func(obj interface{}) { result.handleServiceCIDREvent(obj, nil)pkg/kubeapiserver/options/authentication_test.go1
1691:17use-errors-new
pkg/kubeapiserver/options/authentication_test.go:1691:17
}, expectedErr: fmt.Errorf("cannot set mutually exclusive flags `--service-account-key-file` and `--service-account-signing-endpoint` at the same time"), },pkg/scheduler/framework/plugins/defaultpreemption/default_preemption_test.go1
1274:5use-slices-sort
pkg/scheduler/framework/plugins/defaultpreemption/default_preemption_test.go:1274:5
} sort.Slice(got, func(i, j int) bool { return got[i].Name() < got[j].Name()pkg/proxy/nftables/proxier.go1
406:2var-naming
pkg/proxy/nftables/proxier.go:406:2
ipX := "ip" ipvX_addr := "ipv4_addr" //nolint:staticcheck // var name intentionally resembles value noLocalhost := "ip daddr != 127.0.0.0/8"pkg/kubeapiserver/options/authentication_test.go1
239:34add-constant
pkg/kubeapiserver/options/authentication_test.go:239:34
name: "test when authentication config file and oidc-* flags are set", testAuthenticationConfigFile: "configfile", testOIDC: &OIDCAuthenticationOptions{pkg/kubeapiserver/options/authorization_test.go1
34:6cognitive-complexity
pkg/kubeapiserver/options/authorization_test.go:34:6
func TestAuthzValidate(t *testing.T) { examplePolicyFile := "../../auth/authorizer/abac/example_policy_file.jsonl"pkg/registry/core/service/storage/transaction.go1
58:31confusing-naming
pkg/registry/core/service/storage/transaction.go:58:31
func (cb callbackTransaction) Revert() { if cb.revert != nil {pkg/scheduler/framework/preemption/preemption_test.go1
81:80confusing-results
pkg/scheduler/framework/preemption/preemption_test.go:81:80
func (pl *FakePostFilterPlugin) GetOffsetAndNumCandidates(nodes int32) (int32, int32) { return 0, nodespkg/registry/rbac/role/registry.go1
42:6constructor-interface-return
pkg/registry/rbac/role/registry.go:42:6
// types will panic.func NewRegistry(s rest.StandardStorage) Registry { return &storage{s}pkg/proxy/healthcheck/healthcheck_test.go1
146:6cyclomatic-complexity
pkg/proxy/healthcheck/healthcheck_test.go:146:6
func TestServer(t *testing.T) { listener := newFakeListener()pkg/registry/certificates/podcertificaterequest/storage/storage_test.go1
271:5deprecated-api-usage
pkg/registry/certificates/podcertificaterequest/storage/storage_test.go:271:5
MaxExpirationSeconds: ptr.To[int32](86400), PKIXPublicKey: ed25519PubPKIX1, ProofOfPossession: ed25519Proof1,pkg/proxy/healthcheck/healthcheck_test.go1
193:2discarded-error-result
pkg/proxy/healthcheck/healthcheck_test.go:193:2
// sync an endpoint hcs.SyncEndpoints(map[types.NamespacedName]int{nsn: 18}) if len(hcs.services) != 1 {pkg/kubeapiserver/options/authentication.go1
102:1doc-comment-period
pkg/kubeapiserver/options/authentication.go:102:1
// AnonymousAuthenticationOptions contains anonymous authentication options for API Servertype AnonymousAuthenticationOptions struct {pkg/proxy/conntrack/filter_test.go1
85:14error-strings
pkg/proxy/conntrack/filter_test.go:85:14
if match != tc.expectedMatch { t.Errorf("MatchConntrackFlow() = %v, want %v", match, tc.expectedMatch) }pkg/kubeapiserver/options/authentication.go1
82:5exported-declaration-comment
pkg/kubeapiserver/options/authentication.go:82:5
// Exported as a variable so that it can be overridden in integration tests.var UpdateAuthenticationConfigTimeout = time.Minutepkg/proxy/nftables/proxier.go1
1:1file-length-limit
pkg/proxy/nftables/proxier.go:1:1
//go:build linuxpkg/proxy/ipvs/proxier.go1
568:40flag-parameter
pkg/proxy/ipvs/proxier.go:568:40
func (proxier *Proxier) setInitialized(value bool) { var initialized int32pkg/proxy/apis/config/fuzzer/fuzzer.go1
1:1format
pkg/proxy/apis/config/fuzzer/fuzzer.go:1:1
/*Copyright 2018 The Kubernetes Authors.- Fix (safe): run `strider fmt pkg/proxy/apis/config/fuzzer/fuzzer.go`
pkg/proxy/apis/config/v1alpha1/defaults.go1
39:6function-length
pkg/proxy/apis/config/v1alpha1/defaults.go:39:6
func SetDefaults_KubeProxyConfiguration(obj *kubeproxyconfigv1alpha1.KubeProxyConfiguration) {pkg/scheduler/framework/plugins/volumebinding/binder.go1
873:24function-result-limit
pkg/scheduler/framework/plugins/volumebinding/binder.go:873:24
// and return unbound claims for further provision.func (b *volumeBinder) findMatchingVolumes(logger klog.Logger, pod *v1.Pod, claimsToBind []*v1.PersistentVolumeClaim, unboundVolumesDelayBinding map[string][]*v1.PersistentVolume, node *v1.Node) (foundMatches bool, bindings []*BindingInfo, unboundClaims []*v1.PersistentVolumeClaim, err error) { // Sort all the claims by increasing size request to get the smallest fitspkg/proxy/nftables/proxier.go1
165:2import-shadowing
pkg/proxy/nftables/proxier.go:165:2
masqueradeRule string conntrack conntrack.Interface localDetector proxyutil.LocalTrafficDetectorpkg/scheduler/backend/cache/snapshot.go1
295:4inefficient-map-lookup
pkg/scheduler/backend/cache/snapshot.go:295:4
if _, ok := nodeNameToInfo[nodeName]; !ok { nodeNameToInfo[nodeName] = framework.NewNodeInfo() }pkg/kubeapiserver/options/authentication_test.go1
1672:37insecure-url-scheme
pkg/kubeapiserver/options/authentication_test.go:1672:37
ServiceAccountLookup: true, ServiceAccountIssuers: []string{"http://foo.bar.com"}, },pkg/scheduler/schedule_one_test.go1
4692:6max-parameters
pkg/scheduler/schedule_one_test.go:4692:6
// scache: scheduler cache that might contain assumed pods.func setupTestScheduler(ctx context.Context, t *testing.T, client clientset.Interface, queuedPodStore *clientcache.FIFO, cache internalcache.Cache, apiDispatcher *apidispatcher.APIDispatcher, informerFactory informers.SharedInformerFactory, broadcaster events.EventBroadcaster, fns ...tf.RegisterPluginFunc) (*Scheduler, chan error) {pkg/scheduler/apis/config/types_pluginargs.go1
202:6max-public-structs
pkg/scheduler/apis/config/types_pluginargs.go:202:6
// ScoringStrategy define ScoringStrategyType for node resource plugintype ScoringStrategy struct { // Type selects which strategy to run.pkg/proxy/apis/config/v1alpha1/conversion.go1
50:3modifies-parameter
pkg/proxy/apis/config/v1alpha1/conversion.go:50:3
default: out.IPTables.SyncPeriod = in.SyncPeriod out.IPTables.MinSyncPeriod = in.MinSyncPeriodpkg/scheduler/framework/plugins/volumebinding/binder.go1
60:54modifies-value-receiver
pkg/scheduler/framework/plugins/volumebinding/binder.go:60:54
func (reasons ConflictReasons) Less(i, j int) bool { return reasons[i] < reasons[j] }func (reasons ConflictReasons) Swap(i, j int) { reasons[i], reasons[j] = reasons[j], reasons[i] }pkg/proxy/apis/config/validation/validation_test.go1
541:41nested-structs
pkg/proxy/apis/config/validation/validation_test.go:541:41
newPath := field.NewPath("KubeProxyConfiguration") for name, testCase := range map[string]struct { ccc componentbaseconfig.ClientConnectionConfigurationpkg/registry/core/service/ipallocator/cidrallocator_test.go1
698:4nil-error-return
pkg/registry/core/service/ipallocator/cidrallocator_test.go:698:4
if err != nil { return false, nil }pkg/registry/rbac/clusterrole/policybased/storage_test.go1
185:2nil-value-with-nil-error
pkg/registry/rbac/clusterrole/policybased/storage_test.go:185:2
f.created++ return nil, nil}pkg/registry/batch/rest/storage_batch.go1
40:4no-else-after-return
pkg/registry/batch/rest/storage_batch.go:40:4
return genericapiserver.APIGroupInfo{}, err } else if len(storageMap) > 0 { apiGroupInfo.VersionedResourcesStorageMap[batchapiv1.SchemeGroupVersion.Version] = storageMappkg/scheduler/framework/preemption/preemption_test.go1
68:6no-init
pkg/scheduler/framework/preemption/preemption_test.go:68:6
func init() { metrics.Register()pkg/proxy/topology.go1
93:3no-naked-return
pkg/proxy/topology.go:93:3
allReachableEndpoints = clusterEndpoints return }pkg/proxy/apis/config/v1alpha1/register.go1
28:5no-package-var
pkg/proxy/apis/config/v1alpha1/register.go:28:5
// SchemeGroupVersion is group version used to register these objectsvar SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"}pkg/kubeapiserver/options/authorization_test.go1
128:7optimize-operands-order
pkg/kubeapiserver/options/authorization_test.go:128:7
errs := options.Validate() if len(errs) > 0 && !testcase.expectErr { t.Errorf("got unexpected err %v", errs)pkg/proxy/apis/config/scheme/scheme.go1
17:9package-comments
pkg/proxy/apis/config/scheme/scheme.go:17:9
package schemepkg/scheduler/framework/preemption/podgrouppreemption_test.go1
1473:93possible-nil-dereference
pkg/scheduler/framework/preemption/podgrouppreemption_test.go:1473:93
if res.victims.NumPDBViolations != int64(tt.expectedNumPDBViolations) { t.Errorf("NumPDBViolations mismatch. Want %d, Got %d", tt.expectedNumPDBViolations, res.victims.NumPDBViolations) }