From 4d47052395b3ac946350e37cd8dd6bf2c47364f7 Mon Sep 17 00:00:00 2001 From: Martin Hickey Date: Tue, 30 Jul 2019 15:01:32 +0100 Subject: [PATCH 1/2] Update linting and checking for apiVersion v1/v2 Signed-off-by: Martin Hickey --- pkg/chart/loader/load.go | 4 ++++ pkg/chart/loader/load_test.go | 13 ++++++++++++ .../testdata/frobnitz.v2.reqs/.helmignore | 1 + .../testdata/frobnitz.v2.reqs/Chart.lock | 8 +++++++ .../testdata/frobnitz.v2.reqs/Chart.yaml | 20 ++++++++++++++++++ .../testdata/frobnitz.v2.reqs/INSTALL.txt | 1 + .../loader/testdata/frobnitz.v2.reqs/LICENSE | 1 + .../testdata/frobnitz.v2.reqs/README.md | 11 ++++++++++ .../frobnitz.v2.reqs/charts/_ignore_me | 1 + .../frobnitz.v2.reqs/charts/alpine/Chart.yaml | 5 +++++ .../frobnitz.v2.reqs/charts/alpine/README.md | 9 ++++++++ .../charts/alpine/charts/mast1/Chart.yaml | 5 +++++ .../charts/alpine/charts/mast1/values.yaml | 4 ++++ .../charts/alpine/charts/mast2-0.1.0.tgz | Bin 0 -> 252 bytes .../charts/alpine/templates/alpine-pod.yaml | 14 ++++++++++++ .../charts/alpine/values.yaml | 2 ++ .../frobnitz.v2.reqs/charts/mariner-4.3.2.tgz | Bin 0 -> 967 bytes .../testdata/frobnitz.v2.reqs/docs/README.md | 1 + .../loader/testdata/frobnitz.v2.reqs/icon.svg | 8 +++++++ .../testdata/frobnitz.v2.reqs/ignore/me.txt | 0 .../frobnitz.v2.reqs/requirements.yaml | 7 ++++++ .../frobnitz.v2.reqs/templates/template.tpl | 1 + .../testdata/frobnitz.v2.reqs/values.yaml | 6 ++++++ pkg/lint/lint_test.go | 14 +++++++++--- pkg/lint/rules/chartfile.go | 18 +++++++++++++++- pkg/lint/rules/chartfile_test.go | 16 ++++++++++---- .../rules/testdata/badchartfile/Chart.yaml | 8 +++++++ 27 files changed, 170 insertions(+), 8 deletions(-) create mode 100644 pkg/chart/loader/testdata/frobnitz.v2.reqs/.helmignore create mode 100644 pkg/chart/loader/testdata/frobnitz.v2.reqs/Chart.lock create mode 100644 pkg/chart/loader/testdata/frobnitz.v2.reqs/Chart.yaml create mode 100644 pkg/chart/loader/testdata/frobnitz.v2.reqs/INSTALL.txt create mode 100644 pkg/chart/loader/testdata/frobnitz.v2.reqs/LICENSE create mode 100644 pkg/chart/loader/testdata/frobnitz.v2.reqs/README.md create mode 100644 pkg/chart/loader/testdata/frobnitz.v2.reqs/charts/_ignore_me create mode 100644 pkg/chart/loader/testdata/frobnitz.v2.reqs/charts/alpine/Chart.yaml create mode 100644 pkg/chart/loader/testdata/frobnitz.v2.reqs/charts/alpine/README.md create mode 100644 pkg/chart/loader/testdata/frobnitz.v2.reqs/charts/alpine/charts/mast1/Chart.yaml create mode 100644 pkg/chart/loader/testdata/frobnitz.v2.reqs/charts/alpine/charts/mast1/values.yaml create mode 100644 pkg/chart/loader/testdata/frobnitz.v2.reqs/charts/alpine/charts/mast2-0.1.0.tgz create mode 100644 pkg/chart/loader/testdata/frobnitz.v2.reqs/charts/alpine/templates/alpine-pod.yaml create mode 100644 pkg/chart/loader/testdata/frobnitz.v2.reqs/charts/alpine/values.yaml create mode 100644 pkg/chart/loader/testdata/frobnitz.v2.reqs/charts/mariner-4.3.2.tgz create mode 100644 pkg/chart/loader/testdata/frobnitz.v2.reqs/docs/README.md create mode 100644 pkg/chart/loader/testdata/frobnitz.v2.reqs/icon.svg create mode 100644 pkg/chart/loader/testdata/frobnitz.v2.reqs/ignore/me.txt create mode 100644 pkg/chart/loader/testdata/frobnitz.v2.reqs/requirements.yaml create mode 100644 pkg/chart/loader/testdata/frobnitz.v2.reqs/templates/template.tpl create mode 100644 pkg/chart/loader/testdata/frobnitz.v2.reqs/values.yaml diff --git a/pkg/chart/loader/load.go b/pkg/chart/loader/load.go index 7308033c9..ca9eadb32 100644 --- a/pkg/chart/loader/load.go +++ b/pkg/chart/loader/load.go @@ -18,6 +18,7 @@ package loader import ( "bytes" + "log" "os" "path/filepath" "strings" @@ -103,6 +104,9 @@ func LoadFiles(files []*BufferedFile) (*chart.Chart, error) { // Deprecated: requirements.yaml is deprecated use Chart.yaml. // We will handle it for you because we are nice people case f.Name == "requirements.yaml": + if c.Metadata.APIVersion != chart.APIVersionV1 { + log.Printf("Warning: Dependencies are handled in Chart.yaml since apiVersion \"v2\". We recommend migrating dependencies to Chart.yaml.") + } if c.Metadata == nil { c.Metadata = new(chart.Metadata) } diff --git a/pkg/chart/loader/load_test.go b/pkg/chart/loader/load_test.go index 9e6697c40..0503d4edd 100644 --- a/pkg/chart/loader/load_test.go +++ b/pkg/chart/loader/load_test.go @@ -147,6 +147,19 @@ func TestLoadFileBackslash(t *testing.T) { verifyDependencies(t, c) } +func TestLoadV2WithReqs(t *testing.T) { + l, err := Loader("testdata/frobnitz.v2.reqs") + if err != nil { + t.Fatalf("Failed to load testdata: %s", err) + } + c, err := l.Load() + if err != nil { + t.Fatalf("Failed to load testdata: %s", err) + } + verifyDependencies(t, c) + verifyDependenciesLock(t, c) +} + func verifyChart(t *testing.T, c *chart.Chart) { t.Helper() if c.Name() == "" { diff --git a/pkg/chart/loader/testdata/frobnitz.v2.reqs/.helmignore b/pkg/chart/loader/testdata/frobnitz.v2.reqs/.helmignore new file mode 100644 index 000000000..9973a57b8 --- /dev/null +++ b/pkg/chart/loader/testdata/frobnitz.v2.reqs/.helmignore @@ -0,0 +1 @@ +ignore/ diff --git a/pkg/chart/loader/testdata/frobnitz.v2.reqs/Chart.lock b/pkg/chart/loader/testdata/frobnitz.v2.reqs/Chart.lock new file mode 100644 index 000000000..6fcc2ed9f --- /dev/null +++ b/pkg/chart/loader/testdata/frobnitz.v2.reqs/Chart.lock @@ -0,0 +1,8 @@ +dependencies: + - name: alpine + version: "0.1.0" + repository: https://example.com/charts + - name: mariner + version: "4.3.2" + repository: https://example.com/charts +digest: invalid diff --git a/pkg/chart/loader/testdata/frobnitz.v2.reqs/Chart.yaml b/pkg/chart/loader/testdata/frobnitz.v2.reqs/Chart.yaml new file mode 100644 index 000000000..f3ab30291 --- /dev/null +++ b/pkg/chart/loader/testdata/frobnitz.v2.reqs/Chart.yaml @@ -0,0 +1,20 @@ +apiVersion: v2 +name: frobnitz +description: This is a frobnitz. +version: "1.2.3" +keywords: + - frobnitz + - sprocket + - dodad +maintainers: + - name: The Helm Team + email: helm@example.com + - name: Someone Else + email: nobody@example.com +sources: + - https://example.com/foo/bar +home: http://example.com +icon: https://example.com/64x64.png +annotations: + extrakey: extravalue + anotherkey: anothervalue diff --git a/pkg/chart/loader/testdata/frobnitz.v2.reqs/INSTALL.txt b/pkg/chart/loader/testdata/frobnitz.v2.reqs/INSTALL.txt new file mode 100644 index 000000000..2010438c2 --- /dev/null +++ b/pkg/chart/loader/testdata/frobnitz.v2.reqs/INSTALL.txt @@ -0,0 +1 @@ +This is an install document. The client may display this. diff --git a/pkg/chart/loader/testdata/frobnitz.v2.reqs/LICENSE b/pkg/chart/loader/testdata/frobnitz.v2.reqs/LICENSE new file mode 100644 index 000000000..6121943b1 --- /dev/null +++ b/pkg/chart/loader/testdata/frobnitz.v2.reqs/LICENSE @@ -0,0 +1 @@ +LICENSE placeholder. diff --git a/pkg/chart/loader/testdata/frobnitz.v2.reqs/README.md b/pkg/chart/loader/testdata/frobnitz.v2.reqs/README.md new file mode 100644 index 000000000..8cf4cc3d7 --- /dev/null +++ b/pkg/chart/loader/testdata/frobnitz.v2.reqs/README.md @@ -0,0 +1,11 @@ +# Frobnitz + +This is an example chart. + +## Usage + +This is an example. It has no usage. + +## Development + +For developer info, see the top-level repository. diff --git a/pkg/chart/loader/testdata/frobnitz.v2.reqs/charts/_ignore_me b/pkg/chart/loader/testdata/frobnitz.v2.reqs/charts/_ignore_me new file mode 100644 index 000000000..2cecca682 --- /dev/null +++ b/pkg/chart/loader/testdata/frobnitz.v2.reqs/charts/_ignore_me @@ -0,0 +1 @@ +This should be ignored by the loader, but may be included in a chart. diff --git a/pkg/chart/loader/testdata/frobnitz.v2.reqs/charts/alpine/Chart.yaml b/pkg/chart/loader/testdata/frobnitz.v2.reqs/charts/alpine/Chart.yaml new file mode 100644 index 000000000..79e0d65db --- /dev/null +++ b/pkg/chart/loader/testdata/frobnitz.v2.reqs/charts/alpine/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v1 +name: alpine +description: Deploy a basic Alpine Linux pod +version: 0.1.0 +home: https://helm.sh/helm diff --git a/pkg/chart/loader/testdata/frobnitz.v2.reqs/charts/alpine/README.md b/pkg/chart/loader/testdata/frobnitz.v2.reqs/charts/alpine/README.md new file mode 100644 index 000000000..b30b949dd --- /dev/null +++ b/pkg/chart/loader/testdata/frobnitz.v2.reqs/charts/alpine/README.md @@ -0,0 +1,9 @@ +This example was generated using the command `helm create alpine`. + +The `templates/` directory contains a very simple pod resource with a +couple of parameters. + +The `values.toml` file contains the default values for the +`alpine-pod.yaml` template. + +You can install this example using `helm install ./alpine`. diff --git a/pkg/chart/loader/testdata/frobnitz.v2.reqs/charts/alpine/charts/mast1/Chart.yaml b/pkg/chart/loader/testdata/frobnitz.v2.reqs/charts/alpine/charts/mast1/Chart.yaml new file mode 100644 index 000000000..1c9dd5fa4 --- /dev/null +++ b/pkg/chart/loader/testdata/frobnitz.v2.reqs/charts/alpine/charts/mast1/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v1 +name: mast1 +description: A Helm chart for Kubernetes +version: 0.1.0 +home: "" diff --git a/pkg/chart/loader/testdata/frobnitz.v2.reqs/charts/alpine/charts/mast1/values.yaml b/pkg/chart/loader/testdata/frobnitz.v2.reqs/charts/alpine/charts/mast1/values.yaml new file mode 100644 index 000000000..42c39c262 --- /dev/null +++ b/pkg/chart/loader/testdata/frobnitz.v2.reqs/charts/alpine/charts/mast1/values.yaml @@ -0,0 +1,4 @@ +# Default values for mast1. +# This is a YAML-formatted file. +# Declare name/value pairs to be passed into your templates. +# name = "value" diff --git a/pkg/chart/loader/testdata/frobnitz.v2.reqs/charts/alpine/charts/mast2-0.1.0.tgz b/pkg/chart/loader/testdata/frobnitz.v2.reqs/charts/alpine/charts/mast2-0.1.0.tgz new file mode 100644 index 0000000000000000000000000000000000000000..61cb62051110b55f3d08213dc81dcf0b1c2d8e53 GIT binary patch literal 252 zcmVDc zVQyr3R8em|NM&qo0PNJUs=_c72H?(liabH@pWIst-7YSIyL+rhEHrIN(t?QZE=F{y zgNRfS&$pa5Ly`mMk2OB%pV`*9knW7FlL-Joo@KED7*{C$d;N~z z37$S{+}wvSU9}|VtF|fRpv9Ve>8dWo|9?5B+RE}Y9CFh-x#(Bq8Vck^V=NUiPLCKa z8z5CF#JgK!4>;$4Fm+FUst4d+{(+nP|0&J+e}(;l^U4@w-{=?s0RR8vgVbLD3;+OM Cs&R<` literal 0 HcmV?d00001 diff --git a/pkg/chart/loader/testdata/frobnitz.v2.reqs/charts/alpine/templates/alpine-pod.yaml b/pkg/chart/loader/testdata/frobnitz.v2.reqs/charts/alpine/templates/alpine-pod.yaml new file mode 100644 index 000000000..21ae20aad --- /dev/null +++ b/pkg/chart/loader/testdata/frobnitz.v2.reqs/charts/alpine/templates/alpine-pod.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Pod +metadata: + name: {{.Release.Name}}-{{.Chart.Name}} + labels: + app.kubernetes.io/managed-by: {{.Release.Service}} + app.kubernetes.io/name: {{.Chart.Name}} + helm.sh/chart: "{{.Chart.Name}}-{{.Chart.Version}}" +spec: + restartPolicy: {{default "Never" .restart_policy}} + containers: + - name: waiter + image: "alpine:3.9" + command: ["/bin/sleep","9000"] diff --git a/pkg/chart/loader/testdata/frobnitz.v2.reqs/charts/alpine/values.yaml b/pkg/chart/loader/testdata/frobnitz.v2.reqs/charts/alpine/values.yaml new file mode 100644 index 000000000..6c2aab7ba --- /dev/null +++ b/pkg/chart/loader/testdata/frobnitz.v2.reqs/charts/alpine/values.yaml @@ -0,0 +1,2 @@ +# The pod name +name: "my-alpine" diff --git a/pkg/chart/loader/testdata/frobnitz.v2.reqs/charts/mariner-4.3.2.tgz b/pkg/chart/loader/testdata/frobnitz.v2.reqs/charts/mariner-4.3.2.tgz new file mode 100644 index 0000000000000000000000000000000000000000..3190136b050e62c628b3c817fd963ac9dc4a9e25 GIT binary patch literal 967 zcmV;&133I2iwFR+9h6)E1MQb_y%a`Bd>#= zhbqf2w!b6}wZ9@rvIhtwzm?~C&+QLm+G2!l%`$_aUgS(@pdjdX3a%E}VXVc7`)dg( zL%IRN2}c1D3xoMi2w@WuWOMZ?5i&3FelBVyq_Ce_8fREdP%NDf<&d!wu3{&VUQNs{N%vK$Ha~k^gB2!0bO7r0ic0 zbqCp*X#j?=|H@GNONsuE)&Idbh>2MX(Z}|+=@*sLod*wS?A8Ugp#mMPuMO0NnZmos9_rr z3xpDL+otj~lRh?B4hHFTl+d5-8NBXmUXB~EyF^bx7m*+!*g>obczvGF|8xkWsHN8; z%#+wiWP{=2pC*98@$VNzzsll&G#D7&11-;D>HT0x|DV2?6}a~*p46@R|2l??e_8dX z@Bb>D3t~VC_*wjq2Dy!6J-_5ME%%J+xmsbK5a#qO>ZV?Wt`d|TDdrB^B&LqFr@lYdUA zs&4-JAg3&uc4dA0gv*bXU9QePa9^8wR{HovA)j@)JOAIkak0Jl)aKqA_3XLM#?H=V z-{tlG=xy^os=1Z><53;&+C4=zp|%rwv!)UyY=%k_t%Y|wNRQl`C6N_Z&S;S+~wb1=)2Uh_4I81`y>DO zoLPSt=btB&x{CUK`0DA&){efW_O36RxnsYZNT0r;JbTLR{H4M3C$8(Cee==aQ~Gbq p$`5v3?NB{4-j0XQHf literal 0 HcmV?d00001 diff --git a/pkg/chart/loader/testdata/frobnitz.v2.reqs/docs/README.md b/pkg/chart/loader/testdata/frobnitz.v2.reqs/docs/README.md new file mode 100644 index 000000000..d40747caf --- /dev/null +++ b/pkg/chart/loader/testdata/frobnitz.v2.reqs/docs/README.md @@ -0,0 +1 @@ +This is a placeholder for documentation. diff --git a/pkg/chart/loader/testdata/frobnitz.v2.reqs/icon.svg b/pkg/chart/loader/testdata/frobnitz.v2.reqs/icon.svg new file mode 100644 index 000000000..892130606 --- /dev/null +++ b/pkg/chart/loader/testdata/frobnitz.v2.reqs/icon.svg @@ -0,0 +1,8 @@ + + + Example icon + + + diff --git a/pkg/chart/loader/testdata/frobnitz.v2.reqs/ignore/me.txt b/pkg/chart/loader/testdata/frobnitz.v2.reqs/ignore/me.txt new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/chart/loader/testdata/frobnitz.v2.reqs/requirements.yaml b/pkg/chart/loader/testdata/frobnitz.v2.reqs/requirements.yaml new file mode 100644 index 000000000..5eb0bc98b --- /dev/null +++ b/pkg/chart/loader/testdata/frobnitz.v2.reqs/requirements.yaml @@ -0,0 +1,7 @@ +dependencies: + - name: alpine + version: "0.1.0" + repository: https://example.com/charts + - name: mariner + version: "4.3.2" + repository: https://example.com/charts diff --git a/pkg/chart/loader/testdata/frobnitz.v2.reqs/templates/template.tpl b/pkg/chart/loader/testdata/frobnitz.v2.reqs/templates/template.tpl new file mode 100644 index 000000000..c651ee6a0 --- /dev/null +++ b/pkg/chart/loader/testdata/frobnitz.v2.reqs/templates/template.tpl @@ -0,0 +1 @@ +Hello {{.Name | default "world"}} diff --git a/pkg/chart/loader/testdata/frobnitz.v2.reqs/values.yaml b/pkg/chart/loader/testdata/frobnitz.v2.reqs/values.yaml new file mode 100644 index 000000000..61f501258 --- /dev/null +++ b/pkg/chart/loader/testdata/frobnitz.v2.reqs/values.yaml @@ -0,0 +1,6 @@ +# A values file contains configuration. + +name: "Some Name" + +section: + name: "Name in a section" diff --git a/pkg/lint/lint_test.go b/pkg/lint/lint_test.go index 962a9ca41..0f2c7ca0d 100644 --- a/pkg/lint/lint_test.go +++ b/pkg/lint/lint_test.go @@ -35,12 +35,12 @@ const goodChartDir = "rules/testdata/goodone" func TestBadChart(t *testing.T) { m := All(badChartDir, values, namespace, strict).Messages - if len(m) != 6 { + if len(m) != 8 { t.Errorf("Number of errors %v", len(m)) t.Errorf("All didn't fail with expected errors, got %#v", m) } // There should be one INFO, 2 WARNINGs and one ERROR messages, check for them - var i, w, e, e2, e3, e4 bool + var i, w, e, e2, e3, e4, e5, e6 bool for _, msg := range m { if msg.Severity == support.InfoSev { if strings.Contains(msg.Err.Error(), "icon is recommended") { @@ -66,9 +66,17 @@ func TestBadChart(t *testing.T) { if strings.Contains(msg.Err.Error(), "apiVersion is required. The value must be either \"v1\" or \"v2\"") { e4 = true } + + if strings.Contains(msg.Err.Error(), "chart type is not valid in apiVersion") { + e5 = true + } + + if strings.Contains(msg.Err.Error(), "dependencies are not valid in the Chart file with apiVersion") { + e6 = true + } } } - if !e || !e2 || !e3 || !e4 || !w || !i { + if !e || !e2 || !e3 || !e4 || !e5 || !e6 || !w || !i { t.Errorf("Didn't find all the expected errors, got %#v", m) } } diff --git a/pkg/lint/rules/chartfile.go b/pkg/lint/rules/chartfile.go index da0675868..91ad7543f 100644 --- a/pkg/lint/rules/chartfile.go +++ b/pkg/lint/rules/chartfile.go @@ -55,6 +55,8 @@ func Chartfile(linter *support.Linter) { linter.RunLinterRule(support.ErrorSev, chartFileName, validateChartSources(chartFile)) linter.RunLinterRule(support.InfoSev, chartFileName, validateChartIconPresence(chartFile)) linter.RunLinterRule(support.ErrorSev, chartFileName, validateChartIconURL(chartFile)) + linter.RunLinterRule(support.ErrorSev, chartFileName, validateChartType(chartFile)) + linter.RunLinterRule(support.ErrorSev, chartFileName, validateChartDependencies(chartFile)) } func validateChartYamlNotDirectory(chartPath string) error { @@ -92,7 +94,7 @@ func validateChartAPIVersion(cf *chart.Metadata) error { return errors.New("apiVersion is required. The value must be either \"v1\" or \"v2\"") } - if cf.APIVersion != "v1" && cf.APIVersion != "v2" { + if cf.APIVersion != chart.APIVersionV1 && cf.APIVersion != chart.APIVersionV2 { return fmt.Errorf("apiVersion '%s' is not valid. The value must be either \"v1\" or \"v2\"", cf.APIVersion) } @@ -158,3 +160,17 @@ func validateChartIconURL(cf *chart.Metadata) error { } return nil } + +func validateChartDependencies(cf *chart.Metadata) error { + if len(cf.Dependencies) > 0 && cf.APIVersion != chart.APIVersionV2 { + return fmt.Errorf("dependencies are not valid in the Chart file with apiVersion '%s'. They are valid in apiVersion '%s'", cf.APIVersion, chart.APIVersionV2) + } + return nil +} + +func validateChartType(cf *chart.Metadata) error { + if len(cf.Type) > 0 && cf.APIVersion != chart.APIVersionV2 { + return fmt.Errorf("chart type is not valid in apiVersion '%s'. It is valid in apiVersion '%s'", cf.APIVersion, chart.APIVersionV2) + } + return nil +} diff --git a/pkg/lint/rules/chartfile_test.go b/pkg/lint/rules/chartfile_test.go index 4e71b860a..6bf33bde1 100644 --- a/pkg/lint/rules/chartfile_test.go +++ b/pkg/lint/rules/chartfile_test.go @@ -209,8 +209,8 @@ func TestChartfile(t *testing.T) { Chartfile(&linter) msgs := linter.Messages - if len(msgs) != 5 { - t.Errorf("Expected 4 errors, got %d", len(msgs)) + if len(msgs) != 7 { + t.Errorf("Expected 7 errors, got %d", len(msgs)) } if !strings.Contains(msgs[0].Err.Error(), "name is required") { @@ -226,11 +226,19 @@ func TestChartfile(t *testing.T) { } if !strings.Contains(msgs[3].Err.Error(), "version 0.0.0 is less than or equal to 0") { - t.Errorf("Unexpected message 3: %s", msgs[2].Err) + t.Errorf("Unexpected message 3: %s", msgs[3].Err) } if !strings.Contains(msgs[4].Err.Error(), "icon is recommended") { - t.Errorf("Unexpected message 4: %s", msgs[3].Err) + t.Errorf("Unexpected message 4: %s", msgs[4].Err) + } + + if !strings.Contains(msgs[5].Err.Error(), "chart type is not valid in apiVersion") { + t.Errorf("Unexpected message 5: %s", msgs[5].Err) + } + + if !strings.Contains(msgs[6].Err.Error(), "dependencies are not valid in the Chart file with apiVersion") { + t.Errorf("Unexpected message 6: %s", msgs[6].Err) } } diff --git a/pkg/lint/rules/testdata/badchartfile/Chart.yaml b/pkg/lint/rules/testdata/badchartfile/Chart.yaml index dbb4a1501..704b745ed 100644 --- a/pkg/lint/rules/testdata/badchartfile/Chart.yaml +++ b/pkg/lint/rules/testdata/badchartfile/Chart.yaml @@ -1,3 +1,11 @@ description: A Helm chart for Kubernetes version: 0.0.0 home: "" +type: application +dependencies: +- name: mariadb + version: 5.x.x + repository: https://kubernetes-charts.storage.googleapis.com/ + condition: mariadb.enabled + tags: + - database From 8f8b2c10e591f23ed30ff2f0cab7baad487e9c9f Mon Sep 17 00:00:00 2001 From: Martin Hickey Date: Fri, 2 Aug 2019 16:01:23 +0100 Subject: [PATCH 2/2] Remove the chart lock file as its v1 structure Signed-off-by: Martin Hickey --- pkg/chart/loader/testdata/frobnitz.v2.reqs/Chart.lock | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 pkg/chart/loader/testdata/frobnitz.v2.reqs/Chart.lock diff --git a/pkg/chart/loader/testdata/frobnitz.v2.reqs/Chart.lock b/pkg/chart/loader/testdata/frobnitz.v2.reqs/Chart.lock deleted file mode 100644 index 6fcc2ed9f..000000000 --- a/pkg/chart/loader/testdata/frobnitz.v2.reqs/Chart.lock +++ /dev/null @@ -1,8 +0,0 @@ -dependencies: - - name: alpine - version: "0.1.0" - repository: https://example.com/charts - - name: mariner - version: "4.3.2" - repository: https://example.com/charts -digest: invalid