Merge pull request #5599 from xichengliudui/addconstants

Using const() defines constants together
pull/5603/head
Matthew Fisher 7 years ago committed by GitHub
commit 2b36b1ad46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -27,27 +27,26 @@ import (
"k8s.io/helm/pkg/chartutil" "k8s.io/helm/pkg/chartutil"
) )
const inspectDesc = ` const (
inspectDesc = `
This command inspects a chart and displays information. It takes a chart reference 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. ('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. Inspect prints the contents of the Chart.yaml file and the values.yaml file.
` `
inspectValuesDesc = `
const inspectValuesDesc = `
This command inspects a chart (directory, file, or URL) and displays the contents This command inspects a chart (directory, file, or URL) and displays the contents
of the values.yaml file of the values.yaml file
` `
inspectChartDesc = `
const inspectChartDesc = `
This command inspects a chart (directory, file, or URL) and displays the contents This command inspects a chart (directory, file, or URL) and displays the contents
of the Charts.yaml file of the Charts.yaml file
` `
readmeChartDesc = `
const readmeChartDesc = `
This command inspects a chart (directory, file, or URL) and displays the contents This command inspects a chart (directory, file, or URL) and displays the contents
of the README file of the README file
` `
)
type inspectCmd struct { type inspectCmd struct {
chartpath string chartpath string

@ -20,14 +20,14 @@ import (
"k8s.io/helm/pkg/proto/hapi/release" "k8s.io/helm/pkg/proto/hapi/release"
) )
// HookAnno is the label name for a hook const (
const HookAnno = "helm.sh/hook" // HookAnno is the label name for a hook
HookAnno = "helm.sh/hook"
// HookWeightAnno is the label name for a hook weight // HookWeightAnno is the label name for a hook weight
const HookWeightAnno = "helm.sh/hook-weight" HookWeightAnno = "helm.sh/hook-weight"
// HookDeleteAnno is the label name for the delete policy for a hook
// HookDeleteAnno is the label name for the delete policy for a hook HookDeleteAnno = "helm.sh/hook-delete-policy"
const HookDeleteAnno = "helm.sh/hook-delete-policy" )
// Types of hooks // Types of hooks
const ( const (

@ -26,13 +26,14 @@ import (
var values = []byte{} var values = []byte{}
const namespace = "testNamespace" const (
const strict = false namespace = "testNamespace"
strict = false
const badChartDir = "rules/testdata/badchartfile" badChartDir = "rules/testdata/badchartfile"
const badValuesFileDir = "rules/testdata/badvaluesfile" badValuesFileDir = "rules/testdata/badvaluesfile"
const badYamlFileDir = "rules/testdata/albatross" badYamlFileDir = "rules/testdata/albatross"
const goodChartDir = "rules/testdata/goodone" goodChartDir = "rules/testdata/goodone"
)
func TestBadChart(t *testing.T) { func TestBadChart(t *testing.T) {
m := All(badChartDir, values, namespace, strict).Messages m := All(badChartDir, values, namespace, strict).Messages

@ -25,7 +25,11 @@ import (
"k8s.io/helm/pkg/lint/support" "k8s.io/helm/pkg/lint/support"
) )
const templateTestBasedir = "./testdata/albatross" const (
strict = false
namespace = "testNamespace"
templateTestBasedir = "./testdata/albatross"
)
func TestValidateAllowedExtension(t *testing.T) { func TestValidateAllowedExtension(t *testing.T) {
var failTest = []string{"/foo", "/test.toml"} var failTest = []string{"/foo", "/test.toml"}
@ -46,9 +50,6 @@ func TestValidateAllowedExtension(t *testing.T) {
var values = []byte("nameOverride: ''\nhttpPort: 80") var values = []byte("nameOverride: ''\nhttpPort: 80")
const namespace = "testNamespace"
const strict = false
func TestTemplateParsing(t *testing.T) { func TestTemplateParsing(t *testing.T) {
linter := support.Linter{ChartDir: templateTestBasedir} linter := support.Linter{ChartDir: templateTestBasedir}
Templates(&linter, values, namespace, strict) Templates(&linter, values, namespace, strict)

Loading…
Cancel
Save