diff --git a/cmd/tiller/environment/environment.go b/cmd/tiller/environment/environment.go index 5d904af11..3adcfe128 100644 --- a/cmd/tiller/environment/environment.go +++ b/cmd/tiller/environment/environment.go @@ -150,6 +150,10 @@ func (p *PrintingKubeClient) Create(ns string, r io.Reader) error { _, err := io.Copy(p.Out, r) return err } + +// Delete implements KubeClient delete. +// +// It only prints out the content to be deleted. func (p *PrintingKubeClient) Delete(ns string, r io.Reader) error { _, err := io.Copy(p.Out, r) return err diff --git a/pkg/chart/values.go b/pkg/chart/values.go index f86d2a368..b00da1b3e 100644 --- a/pkg/chart/values.go +++ b/pkg/chart/values.go @@ -41,6 +41,7 @@ func (v Values) Table(name string) (Values, error) { return table, err } +// Encode writes serialized Values information to the given io.Writer. func (v Values) Encode(w io.Writer) error { return toml.NewEncoder(w).Encode(v) } diff --git a/pkg/helm/convert.go b/pkg/helm/convert.go index f8e24e37c..19914a2d0 100644 --- a/pkg/helm/convert.go +++ b/pkg/helm/convert.go @@ -7,6 +7,7 @@ import ( chartpbs "github.com/kubernetes/helm/pkg/proto/hapi/chart" ) +// ChartToProto converts a chart to its Protobuf struct representation. func ChartToProto(ch *chartutil.Chart) (chpb *chartpbs.Chart, err error) { chpb = new(chartpbs.Chart) @@ -42,6 +43,7 @@ func ChartToProto(ch *chartutil.Chart) (chpb *chartpbs.Chart, err error) { return } +// MetadataToProto converts Chart.yaml data into protocol buffere Metadata. func MetadataToProto(ch *chartutil.Chart) (*chartpbs.Metadata, error) { if ch == nil { return nil, ErrMissingChart @@ -72,6 +74,7 @@ func MetadataToProto(ch *chartutil.Chart) (*chartpbs.Metadata, error) { return md, nil } +// TemplatesToProto converts chart templates to their protobuf representation. func TemplatesToProto(ch *chartutil.Chart) (tpls []*chartpbs.Template, err error) { if ch == nil { return nil, ErrMissingChart @@ -98,6 +101,7 @@ func TemplatesToProto(ch *chartutil.Chart) (tpls []*chartpbs.Template, err error return } +// ValuesToProto converts a chart's values.toml data to protobuf. func ValuesToProto(ch *chartutil.Chart) (*chartpbs.Config, error) { if ch == nil { return nil, ErrMissingChart diff --git a/pkg/helm/error.go b/pkg/helm/error.go index 781b670b8..88dd2cd90 100644 --- a/pkg/helm/error.go +++ b/pkg/helm/error.go @@ -1,16 +1,22 @@ package helm const ( + // ErrNotImplemented indicates that this API is not implemented. ErrNotImplemented = Error("helm api not implemented") + // ErrInvalidSrvAddr indicates an invalid address to the Tiller server. ErrInvalidSrvAddr = Error("invalid tiller address") - ErrMissingTpls = Error("missing chart templates") - ErrMissingChart = Error("missing chart metadata") - ErrMissingValues = Error("missing chart values") + // ErrMissingTpls indicates that the templates are missing from a chart. + ErrMissingTpls = Error("missing chart templates") + // ErrMissingChart indicates that the Chart.yaml data is missing. + ErrMissingChart = Error("missing chart metadata") + // ErrMissingValues indicates that the config values.toml data is missing. + ErrMissingValues = Error("missing chart values") ) // Error represents a Helm client error. type Error string +// Error returns a string representation of this error. func (e Error) Error() string { return string(e) } diff --git a/pkg/helm/traverse.go b/pkg/helm/traverse.go index 4edcb409f..8d02f05a0 100644 --- a/pkg/helm/traverse.go +++ b/pkg/helm/traverse.go @@ -50,6 +50,10 @@ import ( // // +// WalkChartFile walks a chart and returns a *chartObj. +// +// FIXME: Why does an exported function return an unexported struct whose only +// exported method is to return the object passed into this method? func WalkChartFile(chfi *chartutil.Chart) (*chartObj, error) { root := &chartObj{file: chfi} err := root.walkChartDeps(chfi) @@ -62,6 +66,7 @@ type chartObj struct { deps []*chartObj } +// File returns the *chartutil.Chart associated with this *chartObj. func (chd *chartObj) File() *chartutil.Chart { return chd.file } diff --git a/pkg/lint/chartfile.go b/pkg/lint/chartfile.go index 2eb8d2aa6..ff5c833ea 100644 --- a/pkg/lint/chartfile.go +++ b/pkg/lint/chartfile.go @@ -7,6 +7,7 @@ import ( chartutil "github.com/kubernetes/helm/pkg/chart" ) +// Chartfile checks the Chart.yaml file for errors and warnings. func Chartfile(basepath string) (m []Message) { m = []Message{}