From 47991c9c7c71bf7aa24db7a71a4bcdc832268ce1 Mon Sep 17 00:00:00 2001 From: Matt Butcher Date: Thu, 14 Apr 2016 13:55:57 -0600 Subject: [PATCH] fix(chart): update chart testdata for newer format --- pkg/chart/chart_test.go | 48 +----------- pkg/chart/chartfile.go | 59 ++------------ pkg/chart/chartfile_test.go | 50 ------------ pkg/chart/save_test.go | 13 ++-- pkg/chart/testdata/README.md | 10 +-- pkg/chart/testdata/frobnitz-0.0.1.tgz | Bin 2363 -> 1152 bytes pkg/chart/testdata/frobnitz/Chart.toml | 15 ++++ pkg/chart/testdata/frobnitz/Chart.yaml | 18 ----- pkg/chart/testdata/frobnitz/INSTALL.txt | 1 + .../testdata/frobnitz/hooks/pre-install.py | 1 - .../testdata/frobnitz/templates/template.tpl | 1 + .../templates/wordpress-resources.yaml | 12 --- .../frobnitz/templates/wordpress.jinja | 72 ------------------ .../frobnitz/templates/wordpress.jinja.schema | 69 ----------------- .../frobnitz/templates/wordpress.yaml | 6 -- pkg/chart/testdata/frobnitz/values.toml | 6 ++ pkg/chart/testdata/ill-1.2.3.tgz | Bin 2305 -> 0 bytes pkg/chart/testdata/ill/Chart.yaml | 28 ------- pkg/chart/testdata/ill/LICENSE | 1 - pkg/chart/testdata/ill/README.md | 11 --- pkg/chart/testdata/ill/docs/README.md | 1 - pkg/chart/testdata/ill/hooks/pre-install.py | 1 - .../ill/templates/wordpress-resources.yaml | 12 --- .../testdata/ill/templates/wordpress.jinja | 72 ------------------ .../ill/templates/wordpress.jinja.schema | 69 ----------------- .../testdata/ill/templates/wordpress.yaml | 6 -- pkg/chart/testdata/nochart.tgz | Bin 325 -> 0 bytes pkg/chart/testdata/sprocket/Chart.yaml | 15 +++- pkg/chart/testdata/sprocket/LICENSE | 1 - pkg/chart/testdata/sprocket/README.md | 3 - pkg/chart/testdata/sprocket/docs/README.md | 1 - .../testdata/sprocket/hooks/pre-install.py | 1 - pkg/chart/testdata/sprocket/icon.svg | 8 -- .../sprocket/templates/placeholder.txt | 1 - .../testdata/sprocket/templates/template.tpl | 1 + pkg/chart/testdata/sprocket/values.toml | 6 ++ 36 files changed, 57 insertions(+), 562 deletions(-) create mode 100644 pkg/chart/testdata/frobnitz/Chart.toml create mode 100644 pkg/chart/testdata/frobnitz/INSTALL.txt delete mode 100644 pkg/chart/testdata/frobnitz/hooks/pre-install.py create mode 100644 pkg/chart/testdata/frobnitz/templates/template.tpl delete mode 100644 pkg/chart/testdata/frobnitz/templates/wordpress-resources.yaml delete mode 100644 pkg/chart/testdata/frobnitz/templates/wordpress.jinja delete mode 100644 pkg/chart/testdata/frobnitz/templates/wordpress.jinja.schema delete mode 100644 pkg/chart/testdata/frobnitz/templates/wordpress.yaml create mode 100644 pkg/chart/testdata/frobnitz/values.toml delete mode 100644 pkg/chart/testdata/ill-1.2.3.tgz delete mode 100644 pkg/chart/testdata/ill/Chart.yaml delete mode 100644 pkg/chart/testdata/ill/LICENSE delete mode 100644 pkg/chart/testdata/ill/README.md delete mode 100644 pkg/chart/testdata/ill/docs/README.md delete mode 100644 pkg/chart/testdata/ill/hooks/pre-install.py delete mode 100644 pkg/chart/testdata/ill/templates/wordpress-resources.yaml delete mode 100644 pkg/chart/testdata/ill/templates/wordpress.jinja delete mode 100644 pkg/chart/testdata/ill/templates/wordpress.jinja.schema delete mode 100644 pkg/chart/testdata/ill/templates/wordpress.yaml delete mode 100644 pkg/chart/testdata/nochart.tgz delete mode 100644 pkg/chart/testdata/sprocket/LICENSE delete mode 100644 pkg/chart/testdata/sprocket/README.md delete mode 100644 pkg/chart/testdata/sprocket/docs/README.md delete mode 100644 pkg/chart/testdata/sprocket/hooks/pre-install.py delete mode 100644 pkg/chart/testdata/sprocket/icon.svg delete mode 100644 pkg/chart/testdata/sprocket/templates/placeholder.txt create mode 100644 pkg/chart/testdata/sprocket/templates/template.tpl create mode 100644 pkg/chart/testdata/sprocket/values.toml diff --git a/pkg/chart/chart_test.go b/pkg/chart/chart_test.go index a6f0870a1..dd114fe67 100644 --- a/pkg/chart/chart_test.go +++ b/pkg/chart/chart_test.go @@ -28,9 +28,7 @@ const ( testfile = "testdata/frobnitz/Chart.yaml" testdir = "testdata/frobnitz/" testarchive = "testdata/frobnitz-0.0.1.tgz" - testill = "testdata/ill-1.2.3.tgz" - testnochart = "testdata/nochart.tgz" - testmember = "templates/wordpress.jinja" + testmember = "templates/template.tpl" ) // Type canaries. If these fail, they will fail at compile time. @@ -47,11 +45,6 @@ func TestLoadDir(t *testing.T) { if c.Chartfile().Name != "frobnitz" { t.Errorf("Expected chart name to be 'frobnitz'. Got '%s'.", c.Chartfile().Name) } - - if c.Chartfile().Dependencies[0].Version != "^3" { - d := c.Chartfile().Dependencies[0].Version - t.Errorf("Expected dependency 0 to have version '^3'. Got '%s'.", d) - } } func TestLoad(t *testing.T) { @@ -93,32 +86,6 @@ func TestLoadData(t *testing.T) { } } -func TestLoadIll(t *testing.T) { - c, err := Load(testill) - if err != nil { - t.Errorf("Failed to load chart: %s", err) - return - } - defer c.Close() - - if c.Chartfile() == nil { - t.Error("No chartfile was loaded.") - return - } - - // Ill does not have an icon. - if i, err := c.Icon(); err == nil { - t.Errorf("Expected icon to be missing. Got %s", i) - } -} - -func TestLoadNochart(t *testing.T) { - _, err := Load(testnochart) - if err == nil { - t.Error("Nochart should not have loaded at all.") - } -} - func TestChart(t *testing.T) { c, err := LoadDir(testdir) if err != nil { @@ -144,19 +111,6 @@ func TestChart(t *testing.T) { if d != filepath.Join(dir, preTemplates) { t.Errorf("Unexpectedly, templates are in %s", d) } - - d = c.HooksDir() - if d != filepath.Join(dir, preHooks) { - t.Errorf("Unexpectedly, hooks are in %s", d) - } - - i, err := c.Icon() - if err != nil { - t.Errorf("No icon found in test chart: %s", err) - } - if i != filepath.Join(dir, preIcon) { - t.Errorf("Unexpectedly, icon is in %s", i) - } } func TestLoadTemplates(t *testing.T) { diff --git a/pkg/chart/chartfile.go b/pkg/chart/chartfile.go index 1332ef805..23d74c035 100644 --- a/pkg/chart/chartfile.go +++ b/pkg/chart/chartfile.go @@ -19,23 +19,18 @@ package chart import ( "io/ioutil" - "github.com/Masterminds/semver" "gopkg.in/yaml.v2" ) // Chartfile describes a Helm Chart (e.g. Chart.yaml) type Chartfile struct { - Name string `yaml:"name"` - Description string `yaml:"description"` - Version string `yaml:"version"` - Keywords []string `yaml:"keywords,omitempty"` - Maintainers []*Maintainer `yaml:"maintainers,omitempty"` - Source []string `yaml:"source,omitempty"` - Home string `yaml:"home"` - Dependencies []*Dependency `yaml:"dependencies,omitempty"` - Environment []*EnvConstraint `yaml:"environment,omitempty"` - Expander *Expander `yaml:"expander,omitempty"` - Schema string `yaml:"schema,omitempty"` + Name string `yaml:"name"` + Description string `yaml:"description"` + Version string `yaml:"version"` + Keywords []string `yaml:"keywords,omitempty"` + Maintainers []*Maintainer `yaml:"maintainers,omitempty"` + Source []string `yaml:"source,omitempty"` + Home string `yaml:"home"` } // Maintainer describes a chart maintainer. @@ -44,29 +39,6 @@ type Maintainer struct { Email string `yaml:"email,omitempty"` } -// Dependency describes a specific dependency. -type Dependency struct { - Name string `yaml:"name,omitempty"` - Version string `yaml:"version"` - Location string `yaml:"location"` -} - -// EnvConstraint specifies environmental constraints. -type EnvConstraint struct { - Name string `yaml:"name"` - Version string `yaml:"version"` - Extensions []string `yaml:"extensions,omitempty"` - APIGroups []string `yaml:"apiGroups,omitempty"` -} - -// Expander controls how template/ is evaluated. -type Expander struct { - // Currently just Expandybird or GoTemplate - Name string `json:"name"` - // During evaluation, which file to start from. - Entrypoint string `json:"entrypoint"` -} - // LoadChartfile loads a Chart.yaml file into a *Chart. func LoadChartfile(filename string) (*Chartfile, error) { b, err := ioutil.ReadFile(filename) @@ -91,20 +63,3 @@ func (c *Chartfile) Save(filename string) error { func (c *Chartfile) Marshal() ([]byte, error) { return yaml.Marshal(c) } - -// VersionOK returns true if the given version meets the constraints. -// -// It returns false if the version string or constraint is unparsable or if the -// version does not meet the constraint. -func (d *Dependency) VersionOK(version string) bool { - c, err := semver.NewConstraint(d.Version) - if err != nil { - return false - } - v, err := semver.NewVersion(version) - if err != nil { - return false - } - - return c.Check(v) -} diff --git a/pkg/chart/chartfile_test.go b/pkg/chart/chartfile_test.go index 3c4042db7..975871d03 100644 --- a/pkg/chart/chartfile_test.go +++ b/pkg/chart/chartfile_test.go @@ -27,10 +27,6 @@ func TestLoadChartfile(t *testing.T) { return } - if len(f.Environment[0].Extensions) != 2 { - t.Errorf("Expected two extensions, got %d", len(f.Environment[0].Extensions)) - } - if f.Name != "frobnitz" { t.Errorf("Expected frobnitz, got %s", f.Name) } @@ -39,53 +35,7 @@ func TestLoadChartfile(t *testing.T) { t.Errorf("Expected 2 maintainers, got %d", len(f.Maintainers)) } - if len(f.Dependencies) != 1 { - t.Errorf("Expected 2 dependencies, got %d", len(f.Dependencies)) - } - - if f.Dependencies[0].Name != "thingerbob" { - t.Errorf("Expected second dependency to be thingerbob: %q", f.Dependencies[0].Name) - } - if f.Source[0] != "https://example.com/foo/bar" { t.Errorf("Expected https://example.com/foo/bar, got %s", f.Source) } - - expander := f.Expander - if expander == nil { - t.Errorf("No expander found in %s", testfile) - } else { - if expander.Name != "Expandybird" { - t.Errorf("Expected expander name Expandybird, got %s", expander.Name) - } - - if expander.Entrypoint != "templates/wordpress.jinja" { - t.Errorf("Expected expander entrypoint templates/wordpress.jinja, got %s", expander.Entrypoint) - } - } - - if f.Schema != "wordpress.jinja.schema" { - t.Errorf("Expected schema wordpress.jinja.schema, got %s", f.Schema) - } -} - -func TestVersionOK(t *testing.T) { - f, err := LoadChartfile(testfile) - if err != nil { - t.Errorf("Error loading %s: %s", testfile, err) - } - - // These are canaries. The SemVer package exhuastively tests the - // various permutations. This will alert us if we wired it up - // incorrectly. - - d := f.Dependencies[0] - if d.VersionOK("1.0.0") { - t.Errorf("1.0.0 should have been marked out of range") - } - - if !d.VersionOK("3.2.3") { - t.Errorf("Version 3.2.3 should have been marked in-range") - } - } diff --git a/pkg/chart/save_test.go b/pkg/chart/save_test.go index 56979c6a1..5722e987f 100644 --- a/pkg/chart/save_test.go +++ b/pkg/chart/save_test.go @@ -23,6 +23,7 @@ import ( "io/ioutil" "os" "path/filepath" + "sort" "testing" ) @@ -66,20 +67,16 @@ func TestSave(t *testing.T) { expect := []string{ "sprocket", "sprocket/Chart.yaml", - "sprocket/LICENSE", - "sprocket/README.md", - "sprocket/docs", - "sprocket/docs/README.md", - "sprocket/hooks", - "sprocket/hooks/pre-install.py", - "sprocket/icon.svg", + "sprocket/values.toml", "sprocket/templates", - "sprocket/templates/placeholder.txt", + "sprocket/templates/template.tpl", } if len(expect) != len(files) { t.Errorf("Expected %d files, found %d", len(expect), len(files)) return } + sort.Strings(files) + sort.Strings(expect) for i := 0; i < len(expect); i++ { if expect[i] != files[i] { t.Errorf("Expected file %q, got %q", expect[i], files[i]) diff --git a/pkg/chart/testdata/README.md b/pkg/chart/testdata/README.md index 6ddc704f5..a3aa71f14 100644 --- a/pkg/chart/testdata/README.md +++ b/pkg/chart/testdata/README.md @@ -1,9 +1 @@ -The testdata directory here holds charts that match the specification. - -The `fromnitz/` directory contains a chart that matches the chart -specification. - -The `frobnitz-0.0.1.tgz` file is an archive of the `frobnitz` directory. - -The `ill` chart and directory is a chart that is not 100% compatible, -but which should still be parseable. +This directory houses charts used in testing. diff --git a/pkg/chart/testdata/frobnitz-0.0.1.tgz b/pkg/chart/testdata/frobnitz-0.0.1.tgz index fae67e01141c91d380b367764a5b634ea7731792..41f3197a591e8fda92ca561bda445a18a0286fe1 100644 GIT binary patch literal 1152 zcmV-`1b_PFeh@%)4C|xq z`t`8^9JgBjlDmL0Fvm|-NPxBn@@jpVc z=>Lx?5z>-8XFIP${T`w3|G58yzT5V{9lEOjL(dNnz}|UFHt>u0e?f8zLogTPz%*i7 zMk1TYj2F7#Ce2Dve*|iiua;>%Qc*U=j^$e3F=3OGSk7;b>-m9cJka@!i?~zlUO^P6oXmeIogUQ7huPX_R~_B3*iGKy6X3oAeUSd-p_` zN2>+}`FSE2R2Rad)Tg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IXg@IsV1%ze5n-TcWcUe1!_!Pvq@|=`DWzY^hVM2nF7Ok6l^ko&h_~3 zpS}P#@Og7OJ*)DFw}xa2cID4covb$S;IRGtm)x}a0vTJ*e_ioVuK#HL=KbGpK$PNz z$8(SSBJQNNho;iS&p%{TIL32`qT>2zhKMfljCpW$oUMTZy5V4l=8$fpJj|z|8bYcS zip(x;_(43&%%sp#4)sM;2Rh%bMKYf>DlMs&xE@;KB5}pLh2QE}p&8*WS~4tE;RG?) zqFB7B#|$`@_o3tf8%M=>*JGT*Amelu&#k2oJ4*RvoAedtZydA9u7C=$KCxmg z%+p0)iQNh5C%Ad(g}|m&vBlBL)A0nZUZ=p5rPg=me-HF+pl$E}bYoDh{~O&V|Jw<8 zfrt~bFc_Z{tKYw;001X`puzwE diff --git a/pkg/chart/testdata/frobnitz/Chart.toml b/pkg/chart/testdata/frobnitz/Chart.toml new file mode 100644 index 000000000..0f4c51d57 --- /dev/null +++ b/pkg/chart/testdata/frobnitz/Chart.toml @@ -0,0 +1,15 @@ +name = "frobnitz" +description = "This is a frobniz." +version = "1.2.3-alpha.1+12345" +keywords = ["frobnitz", "sprocket", "dodad"] +home = "http://example.com" +source = [ + "https://example.com/foo/bar", + "https://github.com/example/foo" +] +[[maintainer]] + name = "The Helm Team" + email = "helm@example.com" +[[maintainer]] + name = "Someone Else" + email = "nobody@example.com" diff --git a/pkg/chart/testdata/frobnitz/Chart.yaml b/pkg/chart/testdata/frobnitz/Chart.yaml index b1e67a038..2fa9ac025 100644 --- a/pkg/chart/testdata/frobnitz/Chart.yaml +++ b/pkg/chart/testdata/frobnitz/Chart.yaml @@ -1,4 +1,3 @@ -#helm:generate foo name: frobnitz description: This is a frobniz. version: "1.2.3-alpha.1+12345" @@ -14,20 +13,3 @@ maintainers: source: - https://example.com/foo/bar home: http://example.com -dependencies: - - name: thingerbob - location: https://example.com/charts/thingerbob-3.2.1.tgz - version: ^3 -environment: - - name: Kubernetes - version: ~1.1 - extensions: - - extensions/v1beta1 - - extensions/v1beta1/daemonset - apiGroups: - - 3rdParty -expander: - name: Expandybird - entrypoint: templates/wordpress.jinja -schema: wordpress.jinja.schema - \ No newline at end of file diff --git a/pkg/chart/testdata/frobnitz/INSTALL.txt b/pkg/chart/testdata/frobnitz/INSTALL.txt new file mode 100644 index 000000000..2010438c2 --- /dev/null +++ b/pkg/chart/testdata/frobnitz/INSTALL.txt @@ -0,0 +1 @@ +This is an install document. The client may display this. diff --git a/pkg/chart/testdata/frobnitz/hooks/pre-install.py b/pkg/chart/testdata/frobnitz/hooks/pre-install.py deleted file mode 100644 index c9b0d0a92..000000000 --- a/pkg/chart/testdata/frobnitz/hooks/pre-install.py +++ /dev/null @@ -1 +0,0 @@ -# Placeholder. diff --git a/pkg/chart/testdata/frobnitz/templates/template.tpl b/pkg/chart/testdata/frobnitz/templates/template.tpl new file mode 100644 index 000000000..c651ee6a0 --- /dev/null +++ b/pkg/chart/testdata/frobnitz/templates/template.tpl @@ -0,0 +1 @@ +Hello {{.Name | default "world"}} diff --git a/pkg/chart/testdata/frobnitz/templates/wordpress-resources.yaml b/pkg/chart/testdata/frobnitz/templates/wordpress-resources.yaml deleted file mode 100644 index 00f709de0..000000000 --- a/pkg/chart/testdata/frobnitz/templates/wordpress-resources.yaml +++ /dev/null @@ -1,12 +0,0 @@ -# Google Cloud Deployment Manager template -resources: -- name: nfs-disk - type: compute.v1.disk - properties: - zone: us-central1-b - sizeGb: 200 -- name: mysql-disk - type: compute.v1.disk - properties: - zone: us-central1-b - sizeGb: 200 diff --git a/pkg/chart/testdata/frobnitz/templates/wordpress.jinja b/pkg/chart/testdata/frobnitz/templates/wordpress.jinja deleted file mode 100644 index f34e4fec9..000000000 --- a/pkg/chart/testdata/frobnitz/templates/wordpress.jinja +++ /dev/null @@ -1,72 +0,0 @@ -#helm:generate dm_template -{% set PROPERTIES = properties or {} %} -{% set PROJECT = PROPERTIES['project'] or 'dm-k8s-testing' %} -{% set NFS_SERVER = PROPERTIES['nfs-server'] or {} %} -{% set NFS_SERVER_IP = NFS_SERVER['ip'] or '10.0.253.247' %} -{% set NFS_SERVER_PORT = NFS_SERVER['port'] or 2049 %} -{% set NFS_SERVER_DISK = NFS_SERVER['disk'] or 'nfs-disk' %} -{% set NFS_SERVER_DISK_FSTYPE = NFS_SERVER['fstype'] or 'ext4' %} -{% set NGINX = PROPERTIES['nginx'] or {} %} -{% set NGINX_PORT = 80 %} -{% set NGINX_REPLICAS = NGINX['replicas'] or 2 %} -{% set WORDPRESS_PHP = PROPERTIES['wordpress-php'] or {} %} -{% set WORDPRESS_PHP_REPLICAS = WORDPRESS_PHP['replicas'] or 2 %} -{% set WORDPRESS_PHP_PORT = WORDPRESS_PHP['port'] or 9000 %} -{% set MYSQL = PROPERTIES['mysql'] or {} %} -{% set MYSQL_PORT = MYSQL['port'] or 3306 %} -{% set MYSQL_PASSWORD = MYSQL['password'] or 'mysql-password' %} -{% set MYSQL_DISK = MYSQL['disk'] or 'mysql-disk' %} -{% set MYSQL_DISK_FSTYPE = MYSQL['fstype'] or 'ext4' %} - -resources: -- name: nfs - type: github.com/kubernetes/application-dm-templates/storage/nfs:v1 - properties: - ip: {{ NFS_SERVER_IP }} - port: {{ NFS_SERVER_PORT }} - disk: {{ NFS_SERVER_DISK }} - fstype: {{NFS_SERVER_DISK_FSTYPE }} -- name: nginx - type: github.com/kubernetes/application-dm-templates/common/replicatedservice:v2 - properties: - service_port: {{ NGINX_PORT }} - container_port: {{ NGINX_PORT }} - replicas: {{ NGINX_REPLICAS }} - external_service: true - image: gcr.io/{{ PROJECT }}/nginx:latest - volumes: - - mount_path: /var/www/html - persistentVolumeClaim: - claimName: nfs -- name: mysql - type: github.com/kubernetes/application-dm-templates/common/replicatedservice:v2 - properties: - service_port: {{ MYSQL_PORT }} - container_port: {{ MYSQL_PORT }} - replicas: 1 - image: mysql:5.6 - env: - - name: MYSQL_ROOT_PASSWORD - value: {{ MYSQL_PASSWORD }} - volumes: - - mount_path: /var/lib/mysql - gcePersistentDisk: - pdName: {{ MYSQL_DISK }} - fsType: {{ MYSQL_DISK_FSTYPE }} -- name: wordpress-php - type: github.com/kubernetes/application-dm-templates/common/replicatedservice:v2 - properties: - service_name: wordpress-php - service_port: {{ WORDPRESS_PHP_PORT }} - container_port: {{ WORDPRESS_PHP_PORT }} - replicas: 2 - image: wordpress:fpm - env: - - name: WORDPRESS_DB_PASSWORD - value: {{ MYSQL_PASSWORD }} - - name: WORDPRESS_DB_HOST - value: mysql-service - volumes: - - mount_path: /var/www/html - persistentVolumeClaim: - claimName: nfs diff --git a/pkg/chart/testdata/frobnitz/templates/wordpress.jinja.schema b/pkg/chart/testdata/frobnitz/templates/wordpress.jinja.schema deleted file mode 100644 index 215b47e1e..000000000 --- a/pkg/chart/testdata/frobnitz/templates/wordpress.jinja.schema +++ /dev/null @@ -1,69 +0,0 @@ -info: - title: Wordpress - description: | - Defines a Wordpress website by defining four replicated services: an NFS service, an nginx service, a wordpress-php service, and a MySQL service. - - The nginx service and the Wordpress-php service both use NFS to share files. - -properties: - project: - type: string - default: dm-k8s-testing - description: Project location to load the images from. - nfs-service: - type: object - properties: - ip: - type: string - default: 10.0.253.247 - description: The IP of the NFS service. - port: - type: int - default: 2049 - description: The port of the NFS service. - disk: - type: string - default: nfs-disk - description: The name of the persistent disk the NFS service uses. - fstype: - type: string - default: ext4 - description: The filesystem the disk of the NFS service uses. - nginx: - type: object - properties: - replicas: - type: int - default: 2 - description: The number of replicas for the nginx service. - wordpress-php: - type: object - properties: - replicas: - type: int - default: 2 - description: The number of replicas for the wordpress-php service. - port: - type: int - default: 9000 - description: The port the wordpress-php service runs on. - mysql: - type: object - properties: - port: - type: int - default: 3306 - description: The port the MySQL service runs on. - password: - type: string - default: mysql-password - description: The root password of the MySQL service. - disk: - type: string - default: mysql-disk - description: The name of the persistent disk the MySQL service uses. - fstype: - type: string - default: ext4 - description: The filesystem the disk of the MySQL service uses. - diff --git a/pkg/chart/testdata/frobnitz/templates/wordpress.yaml b/pkg/chart/testdata/frobnitz/templates/wordpress.yaml deleted file mode 100644 index b401897ab..000000000 --- a/pkg/chart/testdata/frobnitz/templates/wordpress.yaml +++ /dev/null @@ -1,6 +0,0 @@ -imports: -- path: wordpress.jinja - -resources: -- name: wordpress - type: wordpress.jinja diff --git a/pkg/chart/testdata/frobnitz/values.toml b/pkg/chart/testdata/frobnitz/values.toml new file mode 100644 index 000000000..6fc24051f --- /dev/null +++ b/pkg/chart/testdata/frobnitz/values.toml @@ -0,0 +1,6 @@ +# A values file contains configuration. + +name = "Some Name" + +[section] +name = "Name in a section" diff --git a/pkg/chart/testdata/ill-1.2.3.tgz b/pkg/chart/testdata/ill-1.2.3.tgz deleted file mode 100644 index 198cd2e877f732eaf3068390d3022319df2819ec..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2305 zcmV+c3I6sUiwFSO*Rxgt1MM4YbK5pDpZO~=^<@0vB8m@DZZ&f=m$Q|`Z4>JxU3;C( zodc1OiI^mK04PUJ-QRuy_@*h#&RKFZ;eLoiU|+yu7rOv79ltzzJJv(*+3vtFjNxDa z4WA?J&PyFQ|=cmi#? zyn|0V6j1#AN?`6Iz!BpfHk;=c&67`b?f zUC1$sbWM|dJ}fB-Bh0V+A1bU|5^;zl24Kpn!U-|OOEqhoI4&f|o}nAMsq>5L4`7J{ z1hC*20Z3gRuMi+h#i&59$j>?9Ao!3e03)xWA8u$Sz9YhcX&BFi?qMwSSp?{XCKd;{ z^062{^GOnTfN{YSED(qxWe5r+U3+SCJ{ZIh`n#4P{oZjl`@i&;y8qj@ee?`CyH-rX zH}3z^{>O6h>uVSWyOFUa{+p&{Htg?M&QTZt_W=h!3c}F^iV%eyfh8eY1Vc0eVqs_= zVlKt849Fue_eEq>!7`1q*SfYsl&QY&Ox@D$9t>h1>gHce%N{u2X_shyMX1L{8UQ`T zQ2u2xCGI8S>cb-*^t4dy4|0zX>{8rR1sS*B2=%}m!BDgVfCOeR0#fI{p-(W3Ma&g3 zxDj|FJa`tuQ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8QhcD;8KSk9#6RR2+JXjM*M zI@FZY^z3Y2#D!vhRxn6VRbC!AGMU>g65vHYpUf04Tr?@Haw46lVvg8LZBa<9dQu8Y zHqZR2C9YI_sTSh*Ysz*7T1?%tNo+RxX5`ZJR@L-{0;6RdZZdz#_2lmlUjQ5Uyg8fA zn>^C3A)A7I`SVjJs~tQ#+*$wWOq4_6|6K-dssHSu**O2R%whNbcRwJH;-$xP%mW#B z@&zE8YOlY3S5e^vEkzWSZ@>yfaD^5Oi_&qi78Ige6n0=K(oIl?`8-sMkP0K2+2su{ zlAYEnWOIiUua?c+J*dh-gDiovBi?=3`RBny3DmG;Iwb4_?0V9AV4y z-6#yuBw|4Rk^y8@!+odc-s;KIh$mm z?&aq<48`w1cK8T%tN%N6f72n01Vqt@wm$;)B;}4*eVw*s_wBI!D z*V{2&h*58gF}}~Glze%43p{K$clX=u_Jgs4|5IWZ+0_BvX1x%A`w8ai^8-t&(iL%d_m5)AYfQ&hp{5nMEn@SXviJo}y++ zI!;;B?d-e6_Lz7ha*-D~KOGwC?V!n~JV!DpW1ltoehNB|&z}F0WQU=7FCbkv>t{bT zOMB;;3L&mi_i>l{w1d9R($7IJ#-{T} - - Example icon - - - diff --git a/pkg/chart/testdata/sprocket/templates/placeholder.txt b/pkg/chart/testdata/sprocket/templates/placeholder.txt deleted file mode 100644 index ef9fb20a7..000000000 --- a/pkg/chart/testdata/sprocket/templates/placeholder.txt +++ /dev/null @@ -1 +0,0 @@ -This is a placeholder. diff --git a/pkg/chart/testdata/sprocket/templates/template.tpl b/pkg/chart/testdata/sprocket/templates/template.tpl new file mode 100644 index 000000000..c651ee6a0 --- /dev/null +++ b/pkg/chart/testdata/sprocket/templates/template.tpl @@ -0,0 +1 @@ +Hello {{.Name | default "world"}} diff --git a/pkg/chart/testdata/sprocket/values.toml b/pkg/chart/testdata/sprocket/values.toml new file mode 100644 index 000000000..6fc24051f --- /dev/null +++ b/pkg/chart/testdata/sprocket/values.toml @@ -0,0 +1,6 @@ +# A values file contains configuration. + +name = "Some Name" + +[section] +name = "Name in a section"