diff --git a/hack/.golint_failures b/hack/.golint_failures index 4bc9f0c10a..8d9b58b04a 100644 --- a/hack/.golint_failures +++ b/hack/.golint_failures @@ -531,7 +531,6 @@ staging/src/k8s.io/apiserver/pkg/endpoints staging/src/k8s.io/apiserver/pkg/endpoints/discovery staging/src/k8s.io/apiserver/pkg/endpoints/filters staging/src/k8s.io/apiserver/pkg/endpoints/handlers -staging/src/k8s.io/apiserver/pkg/endpoints/handlers/negotiation staging/src/k8s.io/apiserver/pkg/endpoints/metrics staging/src/k8s.io/apiserver/pkg/endpoints/openapi/testing staging/src/k8s.io/apiserver/pkg/endpoints/request diff --git a/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/negotiation/errors.go b/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/negotiation/errors.go index 93b17cfb09..9a38abddbc 100644 --- a/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/negotiation/errors.go +++ b/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/negotiation/errors.go @@ -29,6 +29,7 @@ type errNotAcceptable struct { accepted []string } +// NewNotAcceptableError returns an error of NotAcceptable which contains specified string func NewNotAcceptableError(accepted []string) error { return errNotAcceptable{accepted} } @@ -51,6 +52,7 @@ type errUnsupportedMediaType struct { accepted []string } +// NewUnsupportedMediaTypeError returns an error of UnsupportedMediaType which contains specified string func NewUnsupportedMediaTypeError(accepted []string) error { return errUnsupportedMediaType{accepted} } diff --git a/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/negotiation/negotiate.go b/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/negotiation/negotiate.go index 7aadce7342..ec8861cc63 100644 --- a/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/negotiation/negotiate.go +++ b/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/negotiation/negotiate.go @@ -133,6 +133,8 @@ type EndpointRestrictions interface { AllowsStreamSchema(schema string) bool } +// DefaultEndpointRestrictions is the default EndpointRestrictions which allows +// content-type negotiation to verify server support for specific options var DefaultEndpointRestrictions = emptyEndpointRestrictions{} type emptyEndpointRestrictions struct{}