diff --git a/cmd/helm/template.go b/cmd/helm/template.go index 8ccc60596..e774ea275 100644 --- a/cmd/helm/template.go +++ b/cmd/helm/template.go @@ -235,13 +235,13 @@ func matchFilePatterns(target string, sf []string) bool { func writeManifest(outputDir, path, manifest string, fileWritten map[string]bool, withHeader bool, outStream io.Writer) error { if outputDir == "" { return writeStream(path, manifest, withHeader, outStream) - } else { - err := writeToFile(outputDir, path, manifest, fileWritten[path], withHeader) - if err != nil { - return err - } - fileWritten[path] = true } + err := writeToFile(outputDir, path, manifest, fileWritten[path], withHeader) + if err != nil { + return err + } + fileWritten[path] = true + return nil } diff --git a/cmd/helm/template_test.go b/cmd/helm/template_test.go index 58a1cd7ec..5dd5888dc 100644 --- a/cmd/helm/template_test.go +++ b/cmd/helm/template_test.go @@ -18,10 +18,11 @@ package main import ( "fmt" - "github.com/stretchr/testify/assert" "os" "path/filepath" "testing" + + "github.com/stretchr/testify/assert" ) var chartPath = "testdata/testcharts/subchart" diff --git a/pkg/action/action_test.go b/pkg/action/action_test.go index c816c84af..23d07d1d3 100644 --- a/pkg/action/action_test.go +++ b/pkg/action/action_test.go @@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, @@ -76,32 +76,6 @@ var manifestWithTestHook = `kind: Pod cmd: fake-command ` -var rbacManifests = `apiVersion: rbac.authorization.k8s.io/v1 -kind: Role -metadata: - name: schedule-agents -rules: -- apiGroups: [""] - resources: ["pods", "pods/exec", "pods/log"] - verbs: ["*"] - ---- - -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - name: schedule-agents - namespace: {{ default .Release.Namespace}} -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: Role - name: schedule-agents -subjects: -- kind: ServiceAccount - name: schedule-agents - namespace: {{ .Release.Namespace }} -` - type chartOptions struct { *chart.Chart } @@ -209,15 +183,6 @@ func withSampleIncludingIncorrectTemplates() chartOption { } } -func withMultipleManifestTemplate() chartOption { - return func(opts *chartOptions) { - sampleTemplates := []*chart.File{ - {Name: "templates/rbac", Data: []byte(rbacManifests)}, - } - opts.Templates = append(opts.Templates, sampleTemplates...) - } -} - func withKube(version string) chartOption { return func(opts *chartOptions) { opts.Metadata.KubeVersion = version