Commit c5389815 authored by tcharding's avatar tcharding

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.
parent 01e961b3
...@@ -34,6 +34,7 @@ type StatusViewer interface { ...@@ -34,6 +34,7 @@ type StatusViewer interface {
Status(namespace, name string, revision int64) (string, bool, error) 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) { func StatusViewerFor(kind schema.GroupKind, c internalclientset.Interface) (StatusViewer, error) {
switch kind { switch kind {
case extensions.Kind("Deployment"), apps.Kind("Deployment"): case extensions.Kind("Deployment"), apps.Kind("Deployment"):
...@@ -46,19 +47,22 @@ func StatusViewerFor(kind schema.GroupKind, c internalclientset.Interface) (Stat ...@@ -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) return nil, fmt.Errorf("no status viewer has been implemented for %v", kind)
} }
// DeploymentStatusViewer implements the StatusViewer interface.
type DeploymentStatusViewer struct { type DeploymentStatusViewer struct {
c extensionsclient.DeploymentsGetter c extensionsclient.DeploymentsGetter
} }
// DaemonSetStatusViewer implements the StatusViewer interface.
type DaemonSetStatusViewer struct { type DaemonSetStatusViewer struct {
c extensionsclient.DaemonSetsGetter c extensionsclient.DaemonSetsGetter
} }
// StatefulSetStatusViewer implements the StatusViewer interface.
type StatefulSetStatusViewer struct { type StatefulSetStatusViewer struct {
c appsclient.StatefulSetsGetter 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) { func (s *DeploymentStatusViewer) Status(namespace, name string, revision int64) (string, bool, error) {
deployment, err := s.c.Deployments(namespace).Get(name, metav1.GetOptions{}) deployment, err := s.c.Deployments(namespace).Get(name, metav1.GetOptions{})
if err != nil { if err != nil {
...@@ -92,7 +96,7 @@ func (s *DeploymentStatusViewer) Status(namespace, name string, revision int64) ...@@ -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 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) { func (s *DaemonSetStatusViewer) Status(namespace, name string, revision int64) (string, bool, error) {
//ignoring revision as DaemonSets does not have history yet //ignoring revision as DaemonSets does not have history yet
...@@ -115,7 +119,7 @@ func (s *DaemonSetStatusViewer) Status(namespace, name string, revision int64) ( ...@@ -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 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) { func (s *StatefulSetStatusViewer) Status(namespace, name string, revision int64) (string, bool, error) {
sts, err := s.c.StatefulSets(namespace).Get(name, metav1.GetOptions{}) sts, err := s.c.StatefulSets(namespace).Get(name, metav1.GetOptions{})
if err != nil { if err != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment