Commit 9546b27d authored by Matt Butcher's avatar Matt Butcher

Merge pull request #677 from technosophos/fix/style-pkg

fix(*): correct numerous golint errors
parents 68653814 75a1aa64
...@@ -150,6 +150,10 @@ func (p *PrintingKubeClient) Create(ns string, r io.Reader) error { ...@@ -150,6 +150,10 @@ func (p *PrintingKubeClient) Create(ns string, r io.Reader) error {
_, err := io.Copy(p.Out, r) _, err := io.Copy(p.Out, r)
return err 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 { func (p *PrintingKubeClient) Delete(ns string, r io.Reader) error {
_, err := io.Copy(p.Out, r) _, err := io.Copy(p.Out, r)
return err return err
......
...@@ -41,6 +41,7 @@ func (v Values) Table(name string) (Values, error) { ...@@ -41,6 +41,7 @@ func (v Values) Table(name string) (Values, error) {
return table, err return table, err
} }
// Encode writes serialized Values information to the given io.Writer.
func (v Values) Encode(w io.Writer) error { func (v Values) Encode(w io.Writer) error {
return toml.NewEncoder(w).Encode(v) return toml.NewEncoder(w).Encode(v)
} }
......
...@@ -7,6 +7,7 @@ import ( ...@@ -7,6 +7,7 @@ import (
chartpbs "github.com/kubernetes/helm/pkg/proto/hapi/chart" 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) { func ChartToProto(ch *chartutil.Chart) (chpb *chartpbs.Chart, err error) {
chpb = new(chartpbs.Chart) chpb = new(chartpbs.Chart)
...@@ -42,6 +43,7 @@ func ChartToProto(ch *chartutil.Chart) (chpb *chartpbs.Chart, err error) { ...@@ -42,6 +43,7 @@ func ChartToProto(ch *chartutil.Chart) (chpb *chartpbs.Chart, err error) {
return return
} }
// MetadataToProto converts Chart.yaml data into protocol buffere Metadata.
func MetadataToProto(ch *chartutil.Chart) (*chartpbs.Metadata, error) { func MetadataToProto(ch *chartutil.Chart) (*chartpbs.Metadata, error) {
if ch == nil { if ch == nil {
return nil, ErrMissingChart return nil, ErrMissingChart
...@@ -72,6 +74,7 @@ func MetadataToProto(ch *chartutil.Chart) (*chartpbs.Metadata, error) { ...@@ -72,6 +74,7 @@ func MetadataToProto(ch *chartutil.Chart) (*chartpbs.Metadata, error) {
return md, nil return md, nil
} }
// TemplatesToProto converts chart templates to their protobuf representation.
func TemplatesToProto(ch *chartutil.Chart) (tpls []*chartpbs.Template, err error) { func TemplatesToProto(ch *chartutil.Chart) (tpls []*chartpbs.Template, err error) {
if ch == nil { if ch == nil {
return nil, ErrMissingChart return nil, ErrMissingChart
...@@ -98,6 +101,7 @@ func TemplatesToProto(ch *chartutil.Chart) (tpls []*chartpbs.Template, err error ...@@ -98,6 +101,7 @@ func TemplatesToProto(ch *chartutil.Chart) (tpls []*chartpbs.Template, err error
return return
} }
// ValuesToProto converts a chart's values.toml data to protobuf.
func ValuesToProto(ch *chartutil.Chart) (*chartpbs.Config, error) { func ValuesToProto(ch *chartutil.Chart) (*chartpbs.Config, error) {
if ch == nil { if ch == nil {
return nil, ErrMissingChart return nil, ErrMissingChart
......
package helm package helm
const ( const (
// ErrNotImplemented indicates that this API is not implemented.
ErrNotImplemented = Error("helm api not implemented") ErrNotImplemented = Error("helm api not implemented")
// ErrInvalidSrvAddr indicates an invalid address to the Tiller server.
ErrInvalidSrvAddr = Error("invalid tiller address") ErrInvalidSrvAddr = Error("invalid tiller address")
ErrMissingTpls = Error("missing chart templates") // ErrMissingTpls indicates that the templates are missing from a chart.
ErrMissingChart = Error("missing chart metadata") ErrMissingTpls = Error("missing chart templates")
ErrMissingValues = Error("missing chart values") // 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. // Error represents a Helm client error.
type Error string type Error string
// Error returns a string representation of this error.
func (e Error) Error() string { func (e Error) Error() string {
return string(e) return string(e)
} }
...@@ -50,6 +50,10 @@ import ( ...@@ -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) { func WalkChartFile(chfi *chartutil.Chart) (*chartObj, error) {
root := &chartObj{file: chfi} root := &chartObj{file: chfi}
err := root.walkChartDeps(chfi) err := root.walkChartDeps(chfi)
...@@ -62,6 +66,7 @@ type chartObj struct { ...@@ -62,6 +66,7 @@ type chartObj struct {
deps []*chartObj deps []*chartObj
} }
// File returns the *chartutil.Chart associated with this *chartObj.
func (chd *chartObj) File() *chartutil.Chart { func (chd *chartObj) File() *chartutil.Chart {
return chd.file return chd.file
} }
......
...@@ -7,6 +7,7 @@ import ( ...@@ -7,6 +7,7 @@ import (
chartutil "github.com/kubernetes/helm/pkg/chart" chartutil "github.com/kubernetes/helm/pkg/chart"
) )
// Chartfile checks the Chart.yaml file for errors and warnings.
func Chartfile(basepath string) (m []Message) { func Chartfile(basepath string) (m []Message) {
m = []Message{} m = []Message{}
......
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