diff --git a/hack/.golint_failures b/hack/.golint_failures index 2b401afcb9e..21c4ab11f36 100644 --- a/hack/.golint_failures +++ b/hack/.golint_failures @@ -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 diff --git a/pkg/controller/namespace/deletion/namespaced_resources_deleter.go b/pkg/controller/namespace/deletion/namespaced_resources_deleter.go index 21e3f6f814d..6e7152c1c77 100644 --- a/pkg/controller/namespace/deletion/namespaced_resources_deleter.go +++ b/pkg/controller/namespace/deletion/namespaced_resources_deleter.go @@ -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), diff --git a/pkg/controller/namespace/deletion/namespaced_resources_deleter_test.go b/pkg/controller/namespace/deletion/namespaced_resources_deleter_test.go index e7ca633351b..079e280199b 100644 --- a/pkg/controller/namespace/deletion/namespaced_resources_deleter_test.go +++ b/pkg/controller/namespace/deletion/namespaced_resources_deleter_test.go @@ -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 } diff --git a/pkg/controller/serviceaccount/serviceaccounts_controller.go b/pkg/controller/serviceaccount/serviceaccounts_controller.go index 52d50d7fb15..c31ba1e0ee6 100644 --- a/pkg/controller/serviceaccount/serviceaccounts_controller.go +++ b/pkg/controller/serviceaccount/serviceaccounts_controller.go @@ -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() diff --git a/pkg/controller/serviceaccount/tokens_controller.go b/pkg/controller/serviceaccount/tokens_controller.go index 7b97036e836..9404a64c800 100644 --- a/pkg/controller/serviceaccount/tokens_controller.go +++ b/pkg/controller/serviceaccount/tokens_controller.go @@ -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()