diff --git a/hack/.staticcheck_failures b/hack/.staticcheck_failures index c1b0e8f22ae..08f0cba4765 100644 --- a/hack/.staticcheck_failures +++ b/hack/.staticcheck_failures @@ -23,7 +23,6 @@ pkg/controller/resourcequota pkg/controller/statefulset pkg/credentialprovider pkg/credentialprovider/aws -pkg/credentialprovider/azure pkg/kubeapiserver/admission pkg/kubectl/cmd/get pkg/kubelet/apis/podresources @@ -37,7 +36,6 @@ pkg/printers/internalversion pkg/probe/http pkg/proxy/healthcheck pkg/proxy/iptables -pkg/proxy/ipvs pkg/proxy/userspace pkg/proxy/winkernel pkg/proxy/winuserspace @@ -53,9 +51,7 @@ pkg/scheduler pkg/scheduler/algorithm/predicates pkg/scheduler/algorithm/priorities pkg/scheduler/api/v1 -pkg/scheduler/apis/config/v1alpha1 pkg/scheduler/internal/queue -pkg/security/podsecuritypolicy/sysctl pkg/util/coverage pkg/util/ebtables pkg/util/ipconfig diff --git a/pkg/controller/statefulset/stateful_set_utils.go b/pkg/controller/statefulset/stateful_set_utils.go index 27f72e0b50e..921286ff054 100644 --- a/pkg/controller/statefulset/stateful_set_utils.go +++ b/pkg/controller/statefulset/stateful_set_utils.go @@ -37,9 +37,7 @@ import ( // maxUpdateRetries is the maximum number of retries used for update conflict resolution prior to failure const maxUpdateRetries = 10 -// updateConflictError is the error used to indicate that the maximum number of retries against the API server have // been attempted and we need to back off -var updateConflictError = fmt.Errorf("aborting update after %d attempts", maxUpdateRetries) var patchCodec = scheme.Codecs.LegacyCodec(apps.SchemeGroupVersion) // overlappingStatefulSets sorts a list of StatefulSets by creation timestamp, using their names as a tie breaker. diff --git a/pkg/credentialprovider/azure/azure_acr_helper.go b/pkg/credentialprovider/azure/azure_acr_helper.go index a8604b0e261..839ccd6947a 100644 --- a/pkg/credentialprovider/azure/azure_acr_helper.go +++ b/pkg/credentialprovider/azure/azure_acr_helper.go @@ -68,7 +68,6 @@ type acrAuthResponse struct { } // 5 minutes buffer time to allow timeshift between local machine and AAD -const timeShiftBuffer = 300 const userAgentHeader = "User-Agent" const userAgent = "kubernetes-credentialprovider-acr" diff --git a/pkg/kubelet/pluginmanager/pluginwatcher/example_handler.go b/pkg/kubelet/pluginmanager/pluginwatcher/example_handler.go index a74f1b1c784..a428ec24c06 100644 --- a/pkg/kubelet/pluginmanager/pluginwatcher/example_handler.go +++ b/pkg/kubelet/pluginmanager/pluginwatcher/example_handler.go @@ -50,7 +50,6 @@ const ( exampleEventValidate examplePluginEvent = 0 exampleEventRegister examplePluginEvent = 1 exampleEventDeRegister examplePluginEvent = 2 - exampleEventError examplePluginEvent = 3 ) // NewExampleHandler provide a example handler diff --git a/pkg/kubelet/stats/cri_stats_provider_test.go b/pkg/kubelet/stats/cri_stats_provider_test.go index 8d65e71ea4c..00391d1eccb 100644 --- a/pkg/kubelet/stats/cri_stats_provider_test.go +++ b/pkg/kubelet/stats/cri_stats_provider_test.go @@ -61,15 +61,12 @@ const ( seedContainer2 = 5000 seedSandbox2 = 6000 seedContainer3 = 7000 - seedSandbox3 = 8000 - seedContainer5 = 9000 ) const ( pName0 = "pod0" pName1 = "pod1" pName2 = "pod2" - pName3 = "pod3" ) const ( diff --git a/pkg/proxy/ipvs/ipset.go b/pkg/proxy/ipvs/ipset.go index bed64ff75c0..b304a69cf01 100644 --- a/pkg/proxy/ipvs/ipset.go +++ b/pkg/proxy/ipvs/ipset.go @@ -66,16 +66,6 @@ const ( kubeNodePortLocalSetUDPComment = "Kubernetes nodeport UDP port with externalTrafficPolicy=local" kubeNodePortLocalSetUDP = "KUBE-NODE-PORT-LOCAL-UDP" - // This ipset is no longer active but still used in previous versions. - // DO NOT create an ipset using this name - legacyKubeNodePortSetSCTPComment = "Kubernetes nodeport SCTP port for masquerade purpose" - legacyKubeNodePortSetSCTP = "KUBE-NODE-PORT-SCTP" - - // This ipset is no longer active but still used in previous versions. - // DO NOT create an ipset using this name - legacyKubeNodePortLocalSetSCTPComment = "Kubernetes nodeport SCTP port with externalTrafficPolicy=local" - legacyKubeNodePortLocalSetSCTP = "KUBE-NODE-PORT-LOCAL-SCTP" - kubeNodePortSetSCTPComment = "Kubernetes nodeport SCTP port for masquerade purpose with type 'hash ip:port'" kubeNodePortSetSCTP = "KUBE-NODE-PORT-SCTP-HASH" diff --git a/pkg/scheduler/apis/config/v1alpha1/BUILD b/pkg/scheduler/apis/config/v1alpha1/BUILD index 881255ab564..f32f086017d 100644 --- a/pkg/scheduler/apis/config/v1alpha1/BUILD +++ b/pkg/scheduler/apis/config/v1alpha1/BUILD @@ -17,7 +17,6 @@ go_library( "//pkg/apis/core:go_default_library", "//pkg/master/ports:go_default_library", "//pkg/scheduler/apis/config:go_default_library", - "//staging/src/k8s.io/api/core/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/conversion:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", diff --git a/pkg/scheduler/apis/config/v1alpha1/defaults.go b/pkg/scheduler/apis/config/v1alpha1/defaults.go index 5b417ae23c5..3d71f2f76fe 100644 --- a/pkg/scheduler/apis/config/v1alpha1/defaults.go +++ b/pkg/scheduler/apis/config/v1alpha1/defaults.go @@ -20,7 +20,6 @@ import ( "net" "strconv" - "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/runtime" componentbaseconfigv1alpha1 "k8s.io/component-base/config/v1alpha1" kubeschedulerconfigv1alpha1 "k8s.io/kube-scheduler/config/v1alpha1" @@ -30,10 +29,6 @@ import ( "k8s.io/kubernetes/pkg/master/ports" ) -// When the --failure-domains scheduler flag is not specified, -// DefaultFailureDomains defines the set of label keys used when TopologyKey is empty in PreferredDuringScheduling anti-affinity. -var defaultFailureDomains string = v1.LabelHostname + "," + v1.LabelZoneFailureDomain + "," + v1.LabelZoneRegion - func addDefaultingFuncs(scheme *runtime.Scheme) error { return RegisterDefaults(scheme) } diff --git a/pkg/security/podsecuritypolicy/sysctl/mustmatchpatterns.go b/pkg/security/podsecuritypolicy/sysctl/mustmatchpatterns.go index 6c33276c563..cab5f59f3e7 100644 --- a/pkg/security/podsecuritypolicy/sysctl/mustmatchpatterns.go +++ b/pkg/security/podsecuritypolicy/sysctl/mustmatchpatterns.go @@ -46,8 +46,6 @@ type mustMatchPatterns struct { var ( _ SysctlsStrategy = &mustMatchPatterns{} - - defaultSysctlsPatterns = []string{"*"} ) // NewMustMatchPatterns creates a new mustMatchPatterns strategy that will provide validation.