From c5389815a93453452245ede673fb2be190a534ad Mon Sep 17 00:00:00 2001 From: tcharding Date: Wed, 30 Aug 2017 17:25:42 +1000 Subject: [PATCH] kubectl: Clean up documentation for rollout_status.go `golint` emits various warnings about missing comments for exported funcitons and types. This PR adds missing documentation strings to functions and types. Also adds punctuation to current documentation strings in line with Go coding standards. --- pkg/kubectl/rollout_status.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pkg/kubectl/rollout_status.go b/pkg/kubectl/rollout_status.go index 9aa64d10c9f..d7d40af1601 100644 --- a/pkg/kubectl/rollout_status.go +++ b/pkg/kubectl/rollout_status.go @@ -34,6 +34,7 @@ type StatusViewer interface { Status(namespace, name string, revision int64) (string, bool, error) } +// StatusViewerFor returns a StatusViewer for the resource specified by kind. func StatusViewerFor(kind schema.GroupKind, c internalclientset.Interface) (StatusViewer, error) { switch kind { case extensions.Kind("Deployment"), apps.Kind("Deployment"): @@ -46,19 +47,22 @@ func StatusViewerFor(kind schema.GroupKind, c internalclientset.Interface) (Stat return nil, fmt.Errorf("no status viewer has been implemented for %v", kind) } +// DeploymentStatusViewer implements the StatusViewer interface. type DeploymentStatusViewer struct { c extensionsclient.DeploymentsGetter } +// DaemonSetStatusViewer implements the StatusViewer interface. type DaemonSetStatusViewer struct { c extensionsclient.DaemonSetsGetter } +// StatefulSetStatusViewer implements the StatusViewer interface. type StatefulSetStatusViewer struct { c appsclient.StatefulSetsGetter } -// Status returns a message describing deployment status, and a bool value indicating if the status is considered done +// Status returns a message describing deployment status, and a bool value indicating if the status is considered done. func (s *DeploymentStatusViewer) Status(namespace, name string, revision int64) (string, bool, error) { deployment, err := s.c.Deployments(namespace).Get(name, metav1.GetOptions{}) if err != nil { @@ -92,7 +96,7 @@ func (s *DeploymentStatusViewer) Status(namespace, name string, revision int64) return fmt.Sprintf("Waiting for deployment spec update to be observed...\n"), false, nil } -// Status returns a message describing daemon set status, and a bool value indicating if the status is considered done +// Status returns a message describing daemon set status, and a bool value indicating if the status is considered done. func (s *DaemonSetStatusViewer) Status(namespace, name string, revision int64) (string, bool, error) { //ignoring revision as DaemonSets does not have history yet @@ -115,7 +119,7 @@ func (s *DaemonSetStatusViewer) Status(namespace, name string, revision int64) ( return fmt.Sprintf("Waiting for daemon set spec update to be observed...\n"), false, nil } -// Status returns a message describing statefulset status, and a bool value indicating if the status is considered done +// Status returns a message describing statefulset status, and a bool value indicating if the status is considered done. func (s *StatefulSetStatusViewer) Status(namespace, name string, revision int64) (string, bool, error) { sts, err := s.c.StatefulSets(namespace).Get(name, metav1.GetOptions{}) if err != nil {