Merge pull request #102629 from tiloso/staticcheck-cluster-apimachinery-apiserver

Fix staticcheck in cluster & k8s.io/{apimachinery,apiserver}
This commit is contained in:
Kubernetes Prow Robot 2021-06-18 09:52:06 -07:00 committed by GitHub
commit d89c11a0d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 6 additions and 5 deletions

View File

@ -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 {

View File

@ -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

View File

@ -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"

View File

@ -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"))
}

View File

@ -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)

View File

@ -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)