Skip to content

Commit 501092c

Browse files
authored
Merge pull request kubernetes#78232 from SataQiu/fix-golint-20190523
Fix golint failures of pkg/controller/namespace/deletion pkg/controller/serviceaccount
2 parents 5cb9405 + b87d006 commit 501092c

File tree

5 files changed

+6
-5
lines changed

5 files changed

+6
-5
lines changed

hack/.golint_failures

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ pkg/controller/job
7070
pkg/controller/job/config/v1alpha1
7171
pkg/controller/namespace
7272
pkg/controller/namespace/config/v1alpha1
73-
pkg/controller/namespace/deletion
7473
pkg/controller/nodeipam/config/v1alpha1
7574
pkg/controller/nodelifecycle/config/v1alpha1
7675
pkg/controller/podautoscaler
@@ -87,7 +86,6 @@ pkg/controller/resourcequota/config/v1alpha1
8786
pkg/controller/route
8887
pkg/controller/service
8988
pkg/controller/service/config/v1alpha1
90-
pkg/controller/serviceaccount
9189
pkg/controller/serviceaccount/config/v1alpha1
9290
pkg/controller/statefulset
9391
pkg/controller/ttl

pkg/controller/namespace/deletion/namespaced_resources_deleter.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,12 @@ import (
3737
v1clientset "k8s.io/client-go/kubernetes/typed/core/v1"
3838
)
3939

40-
// Interface to delete a namespace with all resources in it.
40+
// NamespacedResourcesDeleterInterface is the interface to delete a namespace with all resources in it.
4141
type NamespacedResourcesDeleterInterface interface {
4242
Delete(nsName string) error
4343
}
4444

45+
// NewNamespacedResourcesDeleter returns a new NamespacedResourcesDeleter.
4546
func NewNamespacedResourcesDeleter(nsClient v1clientset.NamespaceInterface,
4647
dynamicClient dynamic.Interface, podsGetter v1clientset.PodsGetter,
4748
discoverResourcesFn func() ([]*metav1.APIResourceList, error),

pkg/controller/namespace/deletion/namespaced_resources_deleter_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ func TestRetryOnConflictError(t *testing.T) {
213213
retryOnce := func(namespace *v1.Namespace) (*v1.Namespace, error) {
214214
numTries++
215215
if numTries <= 1 {
216-
return namespace, errors.NewConflict(api.Resource("namespaces"), namespace.Name, fmt.Errorf("ERROR!"))
216+
return namespace, errors.NewConflict(api.Resource("namespaces"), namespace.Name, fmt.Errorf("ERROR"))
217217
}
218218
return namespace, nil
219219
}

pkg/controller/serviceaccount/serviceaccounts_controller.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ type ServiceAccountsControllerOptions struct {
5252
NamespaceResync time.Duration
5353
}
5454

55+
// DefaultServiceAccountsControllerOptions returns the default options for creating a ServiceAccountsController.
5556
func DefaultServiceAccountsControllerOptions() ServiceAccountsControllerOptions {
5657
return ServiceAccountsControllerOptions{
5758
ServiceAccounts: []v1.ServiceAccount{
@@ -108,6 +109,7 @@ type ServiceAccountsController struct {
108109
queue workqueue.RateLimitingInterface
109110
}
110111

112+
// Run runs the ServiceAccountsController blocks until receiving signal from stopCh.
111113
func (c *ServiceAccountsController) Run(workers int, stopCh <-chan struct{}) {
112114
defer utilruntime.HandleCrash()
113115
defer c.queue.ShutDown()

pkg/controller/serviceaccount/tokens_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ type TokensController struct {
162162
maxRetries int
163163
}
164164

165-
// Runs controller blocks until stopCh is closed
165+
// Run runs controller blocks until stopCh is closed
166166
func (e *TokensController) Run(workers int, stopCh <-chan struct{}) {
167167
// Shut down queues
168168
defer utilruntime.HandleCrash()

0 commit comments

Comments
 (0)