mirror of https://github.com/k3s-io/k3s
Merge pull request #78232 from SataQiu/fix-golint-20190523
Fix golint failures of pkg/controller/namespace/deletion pkg/controller/serviceaccountk3s-v1.15.3
commit
501092c7d0
|
@ -70,7 +70,6 @@ pkg/controller/job
|
|||
pkg/controller/job/config/v1alpha1
|
||||
pkg/controller/namespace
|
||||
pkg/controller/namespace/config/v1alpha1
|
||||
pkg/controller/namespace/deletion
|
||||
pkg/controller/nodeipam/config/v1alpha1
|
||||
pkg/controller/nodelifecycle/config/v1alpha1
|
||||
pkg/controller/podautoscaler
|
||||
|
@ -87,7 +86,6 @@ pkg/controller/resourcequota/config/v1alpha1
|
|||
pkg/controller/route
|
||||
pkg/controller/service
|
||||
pkg/controller/service/config/v1alpha1
|
||||
pkg/controller/serviceaccount
|
||||
pkg/controller/serviceaccount/config/v1alpha1
|
||||
pkg/controller/statefulset
|
||||
pkg/controller/ttl
|
||||
|
|
|
@ -37,11 +37,12 @@ import (
|
|||
v1clientset "k8s.io/client-go/kubernetes/typed/core/v1"
|
||||
)
|
||||
|
||||
// Interface to delete a namespace with all resources in it.
|
||||
// NamespacedResourcesDeleterInterface is the interface to delete a namespace with all resources in it.
|
||||
type NamespacedResourcesDeleterInterface interface {
|
||||
Delete(nsName string) error
|
||||
}
|
||||
|
||||
// NewNamespacedResourcesDeleter returns a new NamespacedResourcesDeleter.
|
||||
func NewNamespacedResourcesDeleter(nsClient v1clientset.NamespaceInterface,
|
||||
dynamicClient dynamic.Interface, podsGetter v1clientset.PodsGetter,
|
||||
discoverResourcesFn func() ([]*metav1.APIResourceList, error),
|
||||
|
|
|
@ -213,7 +213,7 @@ func TestRetryOnConflictError(t *testing.T) {
|
|||
retryOnce := func(namespace *v1.Namespace) (*v1.Namespace, error) {
|
||||
numTries++
|
||||
if numTries <= 1 {
|
||||
return namespace, errors.NewConflict(api.Resource("namespaces"), namespace.Name, fmt.Errorf("ERROR!"))
|
||||
return namespace, errors.NewConflict(api.Resource("namespaces"), namespace.Name, fmt.Errorf("ERROR"))
|
||||
}
|
||||
return namespace, nil
|
||||
}
|
||||
|
|
|
@ -52,6 +52,7 @@ type ServiceAccountsControllerOptions struct {
|
|||
NamespaceResync time.Duration
|
||||
}
|
||||
|
||||
// DefaultServiceAccountsControllerOptions returns the default options for creating a ServiceAccountsController.
|
||||
func DefaultServiceAccountsControllerOptions() ServiceAccountsControllerOptions {
|
||||
return ServiceAccountsControllerOptions{
|
||||
ServiceAccounts: []v1.ServiceAccount{
|
||||
|
@ -108,6 +109,7 @@ type ServiceAccountsController struct {
|
|||
queue workqueue.RateLimitingInterface
|
||||
}
|
||||
|
||||
// Run runs the ServiceAccountsController blocks until receiving signal from stopCh.
|
||||
func (c *ServiceAccountsController) Run(workers int, stopCh <-chan struct{}) {
|
||||
defer utilruntime.HandleCrash()
|
||||
defer c.queue.ShutDown()
|
||||
|
|
|
@ -162,7 +162,7 @@ type TokensController struct {
|
|||
maxRetries int
|
||||
}
|
||||
|
||||
// Runs controller blocks until stopCh is closed
|
||||
// Run runs controller blocks until stopCh is closed
|
||||
func (e *TokensController) Run(workers int, stopCh <-chan struct{}) {
|
||||
// Shut down queues
|
||||
defer utilruntime.HandleCrash()
|
||||
|
|
Loading…
Reference in New Issue