Commit 5edb79df authored by xichengliudui's avatar xichengliudui

Using const() defines constants together (part:1)

Signed-off-by: 's avatarxichengliudui <1693291525@qq.com>

update pull request
Signed-off-by: 's avatarxichengliudui <1693291525@qq.com>

update pull request
Signed-off-by: 's avatarxichengliudui <1693291525@qq.com>
parent 8494d133
......@@ -16,16 +16,18 @@ limitations under the License.
package kube
// ResourcePolicyAnno is the annotation name for a resource policy
const ResourcePolicyAnno = "helm.sh/resource-policy"
const (
// ResourcePolicyAnno is the annotation name for a resource policy
ResourcePolicyAnno = "helm.sh/resource-policy"
// deletePolicy is the resource policy type for delete
//
// This resource policy type allows explicitly opting in to the default
// resource deletion behavior, for example when overriding a chart's
// default annotations. Any other value allows resources to skip being
// deleted during an uninstallRelease action.
const deletePolicy = "delete"
// deletePolicy is the resource policy type for delete
//
// This resource policy type allows explicitly opting in to the default
// resource deletion behavior, for example when overriding a chart's
// default annotations. Any other value allows resources to skip being
// deleted during an uninstallRelease action.
deletePolicy = "delete"
)
// ResourcePolicyIsKeep accepts a map of Kubernetes resource annotations and
// returns true if the resource should be kept, otherwise false if it is safe
......
......@@ -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)
......
......@@ -37,11 +37,13 @@ import (
"k8s.io/helm/pkg/storage/driver"
)
// DefaultTillerNamespace is the default namespace for Tiller.
const DefaultTillerNamespace = "kube-system"
const (
// DefaultTillerNamespace is the default namespace for Tiller.
DefaultTillerNamespace = "kube-system"
// GoTplEngine is the name of the Go template engine, as registered in the EngineYard.
const GoTplEngine = "gotpl"
// GoTplEngine is the name of the Go template engine, as registered in the EngineYard.
GoTplEngine = "gotpl"
)
// DefaultEngine points to the engine that the EngineYard should treat as the
// default. A chart that does not specify an engine may be run through the
......
......@@ -40,18 +40,20 @@ import (
"k8s.io/helm/pkg/version"
)
// releaseNameMaxLen is the maximum length of a release name.
//
// As of Kubernetes 1.4, the max limit on a name is 63 chars. We reserve 10 for
// charts to add data. Effectively, that gives us 53 chars.
// See https://github.com/kubernetes/helm/issues/1528
const releaseNameMaxLen = 53
// NOTESFILE_SUFFIX that we want to treat special. It goes through the templating engine
// but it's not a yaml file (resource) hence can't have hooks, etc. And the user actually
// wants to see this file after rendering in the status command. However, it must be a suffix
// since there can be filepath in front of it.
const notesFileSuffix = "NOTES.txt"
const (
// releaseNameMaxLen is the maximum length of a release name.
//
// As of Kubernetes 1.4, the max limit on a name is 63 chars. We reserve 10 for
// charts to add data. Effectively, that gives us 53 chars.
// See https://github.com/kubernetes/helm/issues/1528
releaseNameMaxLen = 53
// NOTESFILE_SUFFIX that we want to treat special. It goes through the templating engine
// but it's not a yaml file (resource) hence can't have hooks, etc. And the user actually
// wants to see this file after rendering in the status command. However, it must be a suffix
// since there can be filepath in front of it.
notesFileSuffix = "NOTES.txt"
)
var (
// errMissingChart indicates that a chart was not provided.
......
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