mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
Modification: revise some errors about golint in some packages
1. pkg/client 2. staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/testing Related to: https://github.com/kubernetes/kubernetes/issues/68026
This commit is contained in:
parent
88a0987f93
commit
1fbb8b20e2
@ -99,9 +99,6 @@ pkg/apis/storage/v1beta1
|
|||||||
pkg/apis/storage/v1beta1/util
|
pkg/apis/storage/v1beta1/util
|
||||||
pkg/auth/authorizer/abac
|
pkg/auth/authorizer/abac
|
||||||
pkg/capabilities
|
pkg/capabilities
|
||||||
pkg/client/chaosclient
|
|
||||||
pkg/client/leaderelectionconfig
|
|
||||||
pkg/client/tests
|
|
||||||
pkg/cloudprovider
|
pkg/cloudprovider
|
||||||
pkg/cloudprovider/providers/aws
|
pkg/cloudprovider/providers/aws
|
||||||
pkg/cloudprovider/providers/fake
|
pkg/cloudprovider/providers/fake
|
||||||
|
@ -62,9 +62,11 @@ type ChaosNotifier interface {
|
|||||||
// error.
|
// error.
|
||||||
type ChaosFunc func(req *http.Request) (bool, *http.Response, 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) {
|
func (fn ChaosFunc) Intercept(req *http.Request) (bool, *http.Response, error) {
|
||||||
return fn.Intercept(req)
|
return fn.Intercept(req)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (fn ChaosFunc) String() string {
|
func (fn ChaosFunc) String() string {
|
||||||
return runtime.FuncForPC(reflect.ValueOf(fn).Pointer()).Name()
|
return runtime.FuncForPC(reflect.ValueOf(fn).Pointer()).Name()
|
||||||
}
|
}
|
||||||
@ -141,7 +143,7 @@ type Error struct {
|
|||||||
error
|
error
|
||||||
}
|
}
|
||||||
|
|
||||||
// C returns the nested error
|
// Intercept returns the nested error
|
||||||
func (e Error) Intercept(_ *http.Request) (bool, *http.Response, error) {
|
func (e Error) Intercept(_ *http.Request) (bool, *http.Response, error) {
|
||||||
return true, nil, e.error
|
return true, nil, e.error
|
||||||
}
|
}
|
||||||
|
@ -24,6 +24,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
// DefaultLeaseDuration defines a default duration of lease.
|
||||||
DefaultLeaseDuration = 15 * time.Second
|
DefaultLeaseDuration = 15 * time.Second
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -14,5 +14,5 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
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
|
package tests
|
||||||
|
@ -43,10 +43,10 @@ var matchEverythingRules = []registrationv1beta1.RuleWithOperations{{
|
|||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
|
|
||||||
var sideEffectsUnknown registrationv1beta1.SideEffectClass = registrationv1beta1.SideEffectClassUnknown
|
var sideEffectsUnknown = registrationv1beta1.SideEffectClassUnknown
|
||||||
var sideEffectsNone registrationv1beta1.SideEffectClass = registrationv1beta1.SideEffectClassNone
|
var sideEffectsNone = registrationv1beta1.SideEffectClassNone
|
||||||
var sideEffectsSome registrationv1beta1.SideEffectClass = registrationv1beta1.SideEffectClassSome
|
var sideEffectsSome = registrationv1beta1.SideEffectClassSome
|
||||||
var sideEffectsNoneOnDryRun registrationv1beta1.SideEffectClass = registrationv1beta1.SideEffectClassNoneOnDryRun
|
var sideEffectsNoneOnDryRun = registrationv1beta1.SideEffectClassNoneOnDryRun
|
||||||
|
|
||||||
// NewFakeDataSource returns a mock client and informer returning the given webhooks.
|
// 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) {
|
func NewFakeDataSource(name string, webhooks []registrationv1beta1.Webhook, mutating bool, stopCh <-chan struct{}) (clientset kubernetes.Interface, factory informers.SharedInformerFactory) {
|
||||||
|
Loading…
Reference in New Issue
Block a user