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 fae67e011..41f3197a5 100644 Binary files a/pkg/chart/testdata/frobnitz-0.0.1.tgz and b/pkg/chart/testdata/frobnitz-0.0.1.tgz differ 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 198cd2e87..000000000 Binary files a/pkg/chart/testdata/ill-1.2.3.tgz and /dev/null differ diff --git a/pkg/chart/testdata/ill/Chart.yaml b/pkg/chart/testdata/ill/Chart.yaml deleted file mode 100644 index 1256cea32..000000000 --- a/pkg/chart/testdata/ill/Chart.yaml +++ /dev/null @@ -1,28 +0,0 @@ -#helm:generate foo -name: ill -description: This is a frobniz. -version: "1.2.3-alpha.1+12345" -keywords: - - ill - - sprocket - - dodad -maintainers: - - name: The Helm Team - email: helm@example.com - - name: Someone Else - email: nobody@example.com -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 diff --git a/pkg/chart/testdata/ill/LICENSE b/pkg/chart/testdata/ill/LICENSE deleted file mode 100644 index 6121943b1..000000000 --- a/pkg/chart/testdata/ill/LICENSE +++ /dev/null @@ -1 +0,0 @@ -LICENSE placeholder. diff --git a/pkg/chart/testdata/ill/README.md b/pkg/chart/testdata/ill/README.md deleted file mode 100644 index 8cf4cc3d7..000000000 --- a/pkg/chart/testdata/ill/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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/testdata/ill/docs/README.md b/pkg/chart/testdata/ill/docs/README.md deleted file mode 100644 index d40747caf..000000000 --- a/pkg/chart/testdata/ill/docs/README.md +++ /dev/null @@ -1 +0,0 @@ -This is a placeholder for documentation. diff --git a/pkg/chart/testdata/ill/hooks/pre-install.py b/pkg/chart/testdata/ill/hooks/pre-install.py deleted file mode 100644 index c9b0d0a92..000000000 --- a/pkg/chart/testdata/ill/hooks/pre-install.py +++ /dev/null @@ -1 +0,0 @@ -# Placeholder. diff --git a/pkg/chart/testdata/ill/templates/wordpress-resources.yaml b/pkg/chart/testdata/ill/templates/wordpress-resources.yaml deleted file mode 100644 index 00f709de0..000000000 --- a/pkg/chart/testdata/ill/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/ill/templates/wordpress.jinja b/pkg/chart/testdata/ill/templates/wordpress.jinja deleted file mode 100644 index f34e4fec9..000000000 --- a/pkg/chart/testdata/ill/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/ill/templates/wordpress.jinja.schema b/pkg/chart/testdata/ill/templates/wordpress.jinja.schema deleted file mode 100644 index 215b47e1e..000000000 --- a/pkg/chart/testdata/ill/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/ill/templates/wordpress.yaml b/pkg/chart/testdata/ill/templates/wordpress.yaml deleted file mode 100644 index b401897ab..000000000 --- a/pkg/chart/testdata/ill/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/nochart.tgz b/pkg/chart/testdata/nochart.tgz deleted file mode 100644 index f5a235537..000000000 Binary files a/pkg/chart/testdata/nochart.tgz and /dev/null differ diff --git a/pkg/chart/testdata/sprocket/Chart.yaml b/pkg/chart/testdata/sprocket/Chart.yaml index 771ea87cb..1a0b759b5 100644 --- a/pkg/chart/testdata/sprocket/Chart.yaml +++ b/pkg/chart/testdata/sprocket/Chart.yaml @@ -1,4 +1,15 @@ name: sprocket -description: This is a sprocket. +description: This is a sprocket" version: 1.2.3-alpha.1+12345 -home: "" +keywords: +- frobnitz +- sprocket +- dodad +maintainers: +- name: The Helm Team + email: helm@example.com +- name: Someone Else + email: nobody@example.com +source: +- https://example.com/foo/bar +home: http://example.com diff --git a/pkg/chart/testdata/sprocket/LICENSE b/pkg/chart/testdata/sprocket/LICENSE deleted file mode 100644 index 6121943b1..000000000 --- a/pkg/chart/testdata/sprocket/LICENSE +++ /dev/null @@ -1 +0,0 @@ -LICENSE placeholder. diff --git a/pkg/chart/testdata/sprocket/README.md b/pkg/chart/testdata/sprocket/README.md deleted file mode 100644 index d1daac8da..000000000 --- a/pkg/chart/testdata/sprocket/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Sprocket - -This is an example chart. diff --git a/pkg/chart/testdata/sprocket/docs/README.md b/pkg/chart/testdata/sprocket/docs/README.md deleted file mode 100644 index d40747caf..000000000 --- a/pkg/chart/testdata/sprocket/docs/README.md +++ /dev/null @@ -1 +0,0 @@ -This is a placeholder for documentation. diff --git a/pkg/chart/testdata/sprocket/hooks/pre-install.py b/pkg/chart/testdata/sprocket/hooks/pre-install.py deleted file mode 100644 index c9b0d0a92..000000000 --- a/pkg/chart/testdata/sprocket/hooks/pre-install.py +++ /dev/null @@ -1 +0,0 @@ -# Placeholder. diff --git a/pkg/chart/testdata/sprocket/icon.svg b/pkg/chart/testdata/sprocket/icon.svg deleted file mode 100644 index 892130606..000000000 --- a/pkg/chart/testdata/sprocket/icon.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - 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"