diff --git a/hack/.golint_failures b/hack/.golint_failures index 80aa3b0e3b4..c1eb18d21ec 100644 --- a/hack/.golint_failures +++ b/hack/.golint_failures @@ -99,9 +99,6 @@ pkg/apis/storage/v1beta1 pkg/apis/storage/v1beta1/util pkg/auth/authorizer/abac pkg/capabilities -pkg/client/chaosclient -pkg/client/leaderelectionconfig -pkg/client/tests pkg/cloudprovider pkg/cloudprovider/providers/aws pkg/cloudprovider/providers/fake diff --git a/pkg/client/chaosclient/chaosclient.go b/pkg/client/chaosclient/chaosclient.go index eeb2c7f05d0..c985891d9dd 100644 --- a/pkg/client/chaosclient/chaosclient.go +++ b/pkg/client/chaosclient/chaosclient.go @@ -62,9 +62,11 @@ type ChaosNotifier interface { // error. type ChaosFunc func(req *http.Request) (bool, *http.Response, error) +// Intercept calls the nested method `Intercept` func (fn ChaosFunc) Intercept(req *http.Request) (bool, *http.Response, error) { return fn.Intercept(req) } + func (fn ChaosFunc) String() string { return runtime.FuncForPC(reflect.ValueOf(fn).Pointer()).Name() } @@ -141,7 +143,7 @@ type Error struct { error } -// C returns the nested error +// Intercept returns the nested error func (e Error) Intercept(_ *http.Request) (bool, *http.Response, error) { return true, nil, e.error } diff --git a/pkg/client/leaderelectionconfig/config.go b/pkg/client/leaderelectionconfig/config.go index 310f1313795..cc9ae7efac9 100644 --- a/pkg/client/leaderelectionconfig/config.go +++ b/pkg/client/leaderelectionconfig/config.go @@ -24,6 +24,7 @@ import ( ) const ( + // DefaultLeaseDuration defines a default duration of lease. DefaultLeaseDuration = 15 * time.Second ) diff --git a/pkg/client/tests/doc.go b/pkg/client/tests/doc.go index 46cb11fe851..342982e5fad 100644 --- a/pkg/client/tests/doc.go +++ b/pkg/client/tests/doc.go @@ -14,5 +14,5 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This package runs tests against the client which require an internal client +// Package tests runs tests against the client which require an internal client package tests diff --git a/staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/testing/testcase.go b/staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/testing/testcase.go index 30af14e74f3..ad3efee0e62 100644 --- a/staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/testing/testcase.go +++ b/staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/testing/testcase.go @@ -43,10 +43,10 @@ var matchEverythingRules = []registrationv1beta1.RuleWithOperations{{ }, }} -var sideEffectsUnknown registrationv1beta1.SideEffectClass = registrationv1beta1.SideEffectClassUnknown -var sideEffectsNone registrationv1beta1.SideEffectClass = registrationv1beta1.SideEffectClassNone -var sideEffectsSome registrationv1beta1.SideEffectClass = registrationv1beta1.SideEffectClassSome -var sideEffectsNoneOnDryRun registrationv1beta1.SideEffectClass = registrationv1beta1.SideEffectClassNoneOnDryRun +var sideEffectsUnknown = registrationv1beta1.SideEffectClassUnknown +var sideEffectsNone = registrationv1beta1.SideEffectClassNone +var sideEffectsSome = registrationv1beta1.SideEffectClassSome +var sideEffectsNoneOnDryRun = registrationv1beta1.SideEffectClassNoneOnDryRun // NewFakeDataSource returns a mock client and informer returning the given webhooks. func NewFakeDataSource(name string, webhooks []registrationv1beta1.Webhook, mutating bool, stopCh <-chan struct{}) (clientset kubernetes.Interface, factory informers.SharedInformerFactory) {