From fa56e879c773aace699afdc14a1b86fa2226b3b5 Mon Sep 17 00:00:00 2001 From: mattjmcnaughton Date: Mon, 25 Sep 2017 09:25:05 -0400 Subject: [PATCH] Improve `horizontal.go` documentation Resolve the remaining `golint` errors in the `pkg/controller/podautoscaler` package by improving the documentation in `horizontal.go`. Now all public methods have comments. --- pkg/controller/podautoscaler/horizontal.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/controller/podautoscaler/horizontal.go b/pkg/controller/podautoscaler/horizontal.go index 6c02a72c8e0..726301155f3 100644 --- a/pkg/controller/podautoscaler/horizontal.go +++ b/pkg/controller/podautoscaler/horizontal.go @@ -79,6 +79,9 @@ func UnsafeConvertToVersionVia(obj runtime.Object, externalVersion schema.GroupV return objExt, err } +// HorizontalController is responsible for the synchronizing HPA objects stored +// in the system with the actual deployments/replication controllers they +// control. type HorizontalController struct { scaleNamespacer extensionsclient.ScalesGetter hpaNamespacer autoscalingclient.HorizontalPodAutoscalersGetter @@ -98,6 +101,7 @@ type HorizontalController struct { queue workqueue.RateLimitingInterface } +// NewHorizontalController creates a new HorizontalController. func NewHorizontalController( evtNamespacer v1core.EventsGetter, scaleNamespacer extensionsclient.ScalesGetter, @@ -138,6 +142,7 @@ func NewHorizontalController( return hpaController } +// Run begins watching and syncing. func (a *HorizontalController) Run(stopCh <-chan struct{}) { defer utilruntime.HandleCrash() defer a.queue.ShutDown()