Using const() defines constants together

Signed-off-by: xichengliudui <1693291525@qq.com>
pull/5599/head
xichengliudui 7 years ago
parent 8494d133bf
commit eb457460b1

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

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

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

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

Loading…
Cancel
Save