fix(*): correct numerous golint errors

pull/677/head
Matt Butcher 9 years ago
parent 613ce7e1a9
commit 75a1aa648e

@ -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

@ -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)
}

@ -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

@ -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)
}

@ -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
}

@ -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{}

Loading…
Cancel
Save