mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 11:21:47 +00:00
Merge pull request #102629 from tiloso/staticcheck-cluster-apimachinery-apiserver
Fix staticcheck in cluster & k8s.io/{apimachinery,apiserver}
This commit is contained in:
commit
d89c11a0d4
@ -126,6 +126,7 @@ func ParseEtcdVersionPair(s string) (*EtcdVersionPair, error) {
|
||||
|
||||
// MustParseEtcdVersionPair parses a "<version>/<storage-version>" string to an EtcdVersionPair
|
||||
// or panics if the parse fails.
|
||||
//lint:ignore U1000 Keep unused but exported MustParseEtcdVersionPair until deprecated package is being removed
|
||||
func MustParseEtcdVersionPair(s string) *EtcdVersionPair {
|
||||
pair, err := ParseEtcdVersionPair(s)
|
||||
if err != nil {
|
||||
@ -188,6 +189,7 @@ func ParseSupportedVersions(list []string) (SupportedVersions, error) {
|
||||
}
|
||||
|
||||
// MustParseSupportedVersions parses a comma separated list of etcd versions or panics if the parse fails.
|
||||
//lint:ignore U1000 Keep unused but exported MustParseSupportedVersions until deprecated package is being removed
|
||||
func MustParseSupportedVersions(list []string) SupportedVersions {
|
||||
versions, err := ParseSupportedVersions(list)
|
||||
if err != nil {
|
||||
|
@ -1,8 +1,3 @@
|
||||
cluster/images/etcd/migrate
|
||||
vendor/k8s.io/apimachinery/pkg/api/apitesting/roundtrip
|
||||
vendor/k8s.io/apimachinery/pkg/apis/meta/v1/validation
|
||||
vendor/k8s.io/apiserver/pkg/endpoints/filters
|
||||
vendor/k8s.io/apiserver/pkg/endpoints/metrics
|
||||
vendor/k8s.io/apiserver/pkg/server/dynamiccertificates
|
||||
vendor/k8s.io/apiserver/pkg/server/filters
|
||||
vendor/k8s.io/apiserver/pkg/server/routes
|
||||
|
@ -25,6 +25,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
//lint:ignore SA1019 Keep using deprecated module; it still seems to be maintained and the api of the recommended replacement differs
|
||||
"github.com/golang/protobuf/proto"
|
||||
fuzz "github.com/google/gofuzz"
|
||||
flag "github.com/spf13/pflag"
|
||||
|
@ -81,6 +81,7 @@ func ValidateLabels(labels map[string]string, fldPath *field.Path) field.ErrorLi
|
||||
|
||||
func ValidateDeleteOptions(options *metav1.DeleteOptions) field.ErrorList {
|
||||
allErrs := field.ErrorList{}
|
||||
//lint:file-ignore SA1019 Keep validation for deprecated OrphanDependents option until it's being removed
|
||||
if options.OrphanDependents != nil && options.PropagationPolicy != nil {
|
||||
allErrs = append(allErrs, field.Invalid(field.NewPath("propagationPolicy"), options.PropagationPolicy, "orphanDependents and deletionPropagation cannot be both set"))
|
||||
}
|
||||
|
@ -173,6 +173,7 @@ func decorateResponseWriter(ctx context.Context, responseWriter http.ResponseWri
|
||||
|
||||
// check if the ResponseWriter we're wrapping is the fancy one we need
|
||||
// or if the basic is sufficient
|
||||
//lint:file-ignore SA1019 Keep supporting deprecated http.CloseNotifier
|
||||
_, cn := responseWriter.(http.CloseNotifier)
|
||||
_, fl := responseWriter.(http.Flusher)
|
||||
_, hj := responseWriter.(http.Hijacker)
|
||||
|
@ -469,6 +469,7 @@ func InstrumentRouteFunc(verb, group, version, resource, subresource, scope, com
|
||||
|
||||
delegate := &ResponseWriterDelegator{ResponseWriter: response.ResponseWriter}
|
||||
|
||||
//lint:file-ignore SA1019 Keep supporting deprecated http.CloseNotifier
|
||||
_, cn := response.ResponseWriter.(http.CloseNotifier)
|
||||
_, fl := response.ResponseWriter.(http.Flusher)
|
||||
_, hj := response.ResponseWriter.(http.Hijacker)
|
||||
|
Loading…
Reference in New Issue
Block a user