diff --git a/cmd/helm/inspect.go b/cmd/helm/inspect.go index 52e681e48..9330b900f 100644 --- a/cmd/helm/inspect.go +++ b/cmd/helm/inspect.go @@ -27,27 +27,26 @@ import ( "k8s.io/helm/pkg/chartutil" ) -const inspectDesc = ` +const ( + inspectDesc = ` This command inspects a chart and displays information. It takes a chart reference ('stable/drupal'), a full path to a directory or packaged chart, or a URL. Inspect prints the contents of the Chart.yaml file and the values.yaml file. ` - -const inspectValuesDesc = ` + inspectValuesDesc = ` This command inspects a chart (directory, file, or URL) and displays the contents of the values.yaml file ` - -const inspectChartDesc = ` + inspectChartDesc = ` This command inspects a chart (directory, file, or URL) and displays the contents of the Charts.yaml file ` - -const readmeChartDesc = ` + readmeChartDesc = ` This command inspects a chart (directory, file, or URL) and displays the contents of the README file ` +) type inspectCmd struct { chartpath string diff --git a/pkg/hooks/hooks.go b/pkg/hooks/hooks.go index 5083672cd..13a09b08b 100644 --- a/pkg/hooks/hooks.go +++ b/pkg/hooks/hooks.go @@ -20,14 +20,14 @@ import ( "k8s.io/helm/pkg/proto/hapi/release" ) -// HookAnno is the label name for a hook -const HookAnno = "helm.sh/hook" - -// HookWeightAnno is the label name for a hook weight -const HookWeightAnno = "helm.sh/hook-weight" - -// HookDeleteAnno is the label name for the delete policy for a hook -const HookDeleteAnno = "helm.sh/hook-delete-policy" +const ( + // HookAnno is the label name for a hook + HookAnno = "helm.sh/hook" + // HookWeightAnno is the label name for a hook weight + HookWeightAnno = "helm.sh/hook-weight" + // HookDeleteAnno is the label name for the delete policy for a hook + HookDeleteAnno = "helm.sh/hook-delete-policy" +) // Types of hooks const ( diff --git a/pkg/lint/lint_test.go b/pkg/lint/lint_test.go index 84dfbf508..8bf5a0927 100644 --- a/pkg/lint/lint_test.go +++ b/pkg/lint/lint_test.go @@ -26,13 +26,14 @@ import ( var values = []byte{} -const namespace = "testNamespace" -const strict = false - -const badChartDir = "rules/testdata/badchartfile" -const badValuesFileDir = "rules/testdata/badvaluesfile" -const badYamlFileDir = "rules/testdata/albatross" -const goodChartDir = "rules/testdata/goodone" +const ( + namespace = "testNamespace" + strict = false + badChartDir = "rules/testdata/badchartfile" + badValuesFileDir = "rules/testdata/badvaluesfile" + badYamlFileDir = "rules/testdata/albatross" + goodChartDir = "rules/testdata/goodone" +) func TestBadChart(t *testing.T) { m := All(badChartDir, values, namespace, strict).Messages diff --git a/pkg/lint/rules/template_test.go b/pkg/lint/rules/template_test.go index 41a7384e7..a294d3c57 100644 --- a/pkg/lint/rules/template_test.go +++ b/pkg/lint/rules/template_test.go @@ -25,7 +25,11 @@ import ( "k8s.io/helm/pkg/lint/support" ) -const templateTestBasedir = "./testdata/albatross" +const ( + strict = false + namespace = "testNamespace" + templateTestBasedir = "./testdata/albatross" +) func TestValidateAllowedExtension(t *testing.T) { var failTest = []string{"/foo", "/test.toml"} @@ -46,9 +50,6 @@ func TestValidateAllowedExtension(t *testing.T) { var values = []byte("nameOverride: ''\nhttpPort: 80") -const namespace = "testNamespace" -const strict = false - func TestTemplateParsing(t *testing.T) { linter := support.Linter{ChartDir: templateTestBasedir} Templates(&linter, values, namespace, strict)