From e5cfb07d28add5b832e6326ba79682a1416735b7 Mon Sep 17 00:00:00 2001 From: Dong Gang Date: Tue, 7 Apr 2020 09:45:24 +0800 Subject: [PATCH] remove the unused function and variable Signed-off-by: Dong Gang --- cmd/helm/template_test.go | 9 +++------ pkg/action/action_test.go | 34 ---------------------------------- 2 files changed, 3 insertions(+), 40 deletions(-) diff --git a/cmd/helm/template_test.go b/cmd/helm/template_test.go index 8a708fe54..b54b6f844 100644 --- a/cmd/helm/template_test.go +++ b/cmd/helm/template_test.go @@ -130,7 +130,6 @@ func TestTemplateCmd(t *testing.T) { runTestCmd(t, tests) } - func TestTemplateOutputDir(t *testing.T) { is := assert.New(t) @@ -140,7 +139,7 @@ func TestTemplateOutputDir(t *testing.T) { } defer os.RemoveAll(dir) - _, _, err = executeActionCommand(fmt.Sprintf("template --output-dir %s testdata/testcharts/chart-for-template-output",dir)) + _, _, err = executeActionCommand(fmt.Sprintf("template --output-dir %s testdata/testcharts/chart-for-template-output", dir)) if err != nil { t.Fatalf("Failed install: %s", err) } @@ -158,7 +157,6 @@ func TestTemplateOutputDir(t *testing.T) { } - func TestInstallOutputDirWithReleaseName(t *testing.T) { is := assert.New(t) dir, err := ioutil.TempDir("", "output-dir") @@ -168,8 +166,8 @@ func TestInstallOutputDirWithReleaseName(t *testing.T) { defer os.RemoveAll(dir) var releaseName = "release" - newDir := filepath.Join(dir,releaseName) - _, _, err = executeActionCommand(fmt.Sprintf("template --output-dir %s %s testdata/testcharts/chart-for-template-output",newDir,releaseName)) + newDir := filepath.Join(dir, releaseName) + _, _, err = executeActionCommand(fmt.Sprintf("template --output-dir %s %s testdata/testcharts/chart-for-template-output", newDir, releaseName)) if err != nil { t.Fatalf("Failed install: %s", err) @@ -185,4 +183,3 @@ func TestInstallOutputDirWithReleaseName(t *testing.T) { _, err = os.Stat(filepath.Join(newDir, "chart-for-template-output/templates/tests/test-connection.yaml")) is.NoError(err) } - diff --git a/pkg/action/action_test.go b/pkg/action/action_test.go index 36ef261a3..227a87b64 100644 --- a/pkg/action/action_test.go +++ b/pkg/action/action_test.go @@ -111,31 +111,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 @@ -244,15 +219,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