From f7a7a157ce16dbfe29e42f61319934781c04373b Mon Sep 17 00:00:00 2001 From: Adam Reese Date: Wed, 29 Aug 2018 14:05:37 -0700 Subject: [PATCH] ref(*): merge requirement.yaml into Chart.yaml Signed-off-by: Adam Reese --- cmd/helm/dependency.go | 16 ++--- cmd/helm/dependency_update.go | 10 ++-- cmd/helm/dependency_update_test.go | 47 ++++++--------- cmd/helm/helm_test.go | 2 - cmd/helm/install.go | 6 +- cmd/helm/install_test.go | 4 +- cmd/helm/package.go | 4 +- cmd/helm/template.go | 2 +- .../output/dependency-list-archive.txt | 1 + .../output/upgrade-with-bad-dependencies.txt | 2 +- .../chart-bad-requirements/Chart.yaml | 4 ++ .../testcharts/chart-missing-deps/Chart.yaml | 7 +++ .../testdata/testcharts/reqtest-0.1.0.tgz | Bin 911 -> 786 bytes .../testdata/testcharts/reqtest/Chart.yaml | 10 ++++ cmd/helm/upgrade.go | 2 +- pkg/chart/chart.go | 2 - pkg/chart/loader/load.go | 5 -- pkg/chart/loader/load_test.go | 17 +++--- .../loader/testdata/albatross/Chart.yaml | 4 ++ .../loader/testdata/albatross/values.yaml | 4 ++ pkg/chart/loader/testdata/frobnitz-1.2.3.tgz | Bin 2070 -> 3559 bytes pkg/chart/loader/testdata/frobnitz/Chart.yaml | 7 +++ .../frobnitz/charts/mariner-4.3.2.tgz | Bin 1034 -> 935 bytes .../testdata/frobnitz/requirements.yaml | 7 --- .../testdata/frobnitz_backslash-1.2.3.tgz | Bin 2079 -> 3617 bytes .../testdata/frobnitz_backslash/Chart.yaml | 7 +++ .../frobnitz_backslash/requirements.yaml | 7 --- pkg/chart/loader/testdata/genfrob.sh | 12 ++++ pkg/chart/loader/testdata/mariner/Chart.yaml | 8 +++ .../mariner/charts/albatross-0.1.0.tgz | Bin 0 -> 292 bytes .../mariner/templates/placeholder.tpl | 1 + pkg/chart/loader/testdata/mariner/values.yaml | 7 +++ pkg/chart/metadata.go | 2 + pkg/chart/requirements.go | 8 --- pkg/chartutil/create.go | 2 +- pkg/chartutil/requirements.go | 32 +++++----- pkg/chartutil/requirements_test.go | 54 ++++++++--------- .../testdata/dependent-chart-alias/Chart.yaml | 12 ++++ .../Chart.yaml | 7 +++ .../Chart.yaml | 4 ++ pkg/chartutil/testdata/frobnitz-1.2.3.tgz | Bin 2070 -> 3559 bytes pkg/chartutil/testdata/frobnitz/Chart.yaml | 7 +++ .../frobnitz/charts/mariner-4.3.2.tgz | Bin 1034 -> 954 bytes .../testdata/frobnitz_backslash-1.2.3.tgz | Bin 2079 -> 3617 bytes .../testdata/frobnitz_backslash/Chart.yaml | 7 +++ pkg/chartutil/testdata/mariner/Chart.yaml | 4 ++ .../mariner/charts/albatross-0.1.0.tgz | Bin 347 -> 292 bytes pkg/chartutil/testdata/subpop/Chart.yaml | 31 ++++++++++ .../subpop/charts/subchart1/Chart.yaml | 32 ++++++++++ .../subpop/charts/subchart2/Chart.yaml | 15 +++++ pkg/chartutil/values.go | 24 ++------ pkg/downloader/manager.go | 16 ++--- pkg/resolver/resolver.go | 10 ++-- pkg/resolver/resolver_test.go | 56 +++++++----------- pkg/urlutil/urlutil_test.go | 5 +- 55 files changed, 328 insertions(+), 205 deletions(-) create mode 100644 pkg/chart/loader/testdata/albatross/Chart.yaml create mode 100644 pkg/chart/loader/testdata/albatross/values.yaml delete mode 100644 pkg/chart/loader/testdata/frobnitz/requirements.yaml delete mode 100755 pkg/chart/loader/testdata/frobnitz_backslash/requirements.yaml create mode 100755 pkg/chart/loader/testdata/genfrob.sh create mode 100644 pkg/chart/loader/testdata/mariner/Chart.yaml create mode 100644 pkg/chart/loader/testdata/mariner/charts/albatross-0.1.0.tgz create mode 100644 pkg/chart/loader/testdata/mariner/templates/placeholder.tpl create mode 100644 pkg/chart/loader/testdata/mariner/values.yaml diff --git a/cmd/helm/dependency.go b/cmd/helm/dependency.go index 542f13521..ff88150cd 100644 --- a/cmd/helm/dependency.go +++ b/cmd/helm/dependency.go @@ -136,14 +136,14 @@ func (o *dependencyLisOptions) run(out io.Writer) error { return err } - if c.Requirements == nil { + if c.Metadata.Requirements == nil { fmt.Fprintf(out, "WARNING: no requirements at %s/charts\n", o.chartpath) return nil } - o.printRequirements(out, c.Requirements) + o.printRequirements(out, c.Metadata.Requirements) fmt.Fprintln(out) - o.printMissing(out, c.Requirements) + o.printMissing(out, c.Metadata.Requirements) return nil } @@ -222,18 +222,18 @@ func (o *dependencyLisOptions) dependencyStatus(dep *chart.Dependency) string { } // printRequirements prints all of the requirements in the yaml file. -func (o *dependencyLisOptions) printRequirements(out io.Writer, reqs *chart.Requirements) { +func (o *dependencyLisOptions) printRequirements(out io.Writer, reqs []*chart.Dependency) { table := uitable.New() table.MaxColWidth = 80 table.AddRow("NAME", "VERSION", "REPOSITORY", "STATUS") - for _, row := range reqs.Dependencies { + for _, row := range reqs { table.AddRow(row.Name, row.Version, row.Repository, o.dependencyStatus(row)) } fmt.Fprintln(out, table) } // printMissing prints warnings about charts that are present on disk, but are not in the requirements. -func (o *dependencyLisOptions) printMissing(out io.Writer, reqs *chart.Requirements) { +func (o *dependencyLisOptions) printMissing(out io.Writer, reqs []*chart.Dependency) { folder := filepath.Join(o.chartpath, "charts/*") files, err := filepath.Glob(folder) if err != nil { @@ -256,14 +256,14 @@ func (o *dependencyLisOptions) printMissing(out io.Writer, reqs *chart.Requireme continue } found := false - for _, d := range reqs.Dependencies { + for _, d := range reqs { if d.Name == c.Name() { found = true break } } if !found { - fmt.Fprintf(out, "WARNING: %q is not in requirements.yaml.\n", f) + fmt.Fprintf(out, "WARNING: %q is not in Chart.yaml.\n", f) } } diff --git a/cmd/helm/dependency_update.go b/cmd/helm/dependency_update.go index b684c4560..586c2e09b 100644 --- a/cmd/helm/dependency_update.go +++ b/cmd/helm/dependency_update.go @@ -28,18 +28,18 @@ import ( ) const dependencyUpDesc = ` -Update the on-disk dependencies to mirror the requirements.yaml file. +Update the on-disk dependencies to mirror Chart.yaml. -This command verifies that the required charts, as expressed in 'requirements.yaml', +This command verifies that the required charts, as expressed in 'Chart.yaml', are present in 'charts/' and are at an acceptable version. It will pull down the latest charts that satisfy the dependencies, and clean up old dependencies. On successful update, this will generate a lock file that can be used to rebuild the requirements to an exact version. -Dependencies are not required to be represented in 'requirements.yaml'. For that +Dependencies are not required to be represented in 'Chart.yaml'. For that reason, an update command will not remove charts unless they are (a) present -in the requirements.yaml file, but (b) at the wrong version. +in the Chart.yaml file, but (b) at the wrong version. ` // dependencyUpdateOptions describes a 'helm dependency update' @@ -63,7 +63,7 @@ func newDependencyUpdateCmd(out io.Writer) *cobra.Command { cmd := &cobra.Command{ Use: "update CHART", Aliases: []string{"up"}, - Short: "update charts/ based on the contents of requirements.yaml", + Short: "update charts/ based on the contents of Chart.yaml", Long: dependencyUpDesc, Args: require.MaximumNArgs(1), RunE: func(cmd *cobra.Command, args []string) error { diff --git a/cmd/helm/dependency_update_test.go b/cmd/helm/dependency_update_test.go index 13bf2c822..f6a8b91cb 100644 --- a/cmd/helm/dependency_update_test.go +++ b/cmd/helm/dependency_update_test.go @@ -24,8 +24,6 @@ import ( "strings" "testing" - "github.com/ghodss/yaml" - "k8s.io/helm/pkg/chart" "k8s.io/helm/pkg/chartutil" "k8s.io/helm/pkg/provenance" @@ -49,7 +47,8 @@ func TestDependencyUpdateCmd(t *testing.T) { t.Logf("Listening on directory %s", srv.Root()) chartname := "depup" - if err := createTestingChart(hh.String(), chartname, srv.URL()); err != nil { + md := createTestingMetadata(chartname, srv.URL()) + if _, err := chartutil.Create(md, hh.String()); err != nil { t.Fatal(err) } @@ -87,14 +86,12 @@ func TestDependencyUpdateCmd(t *testing.T) { // Now change the dependencies and update. This verifies that on update, // old dependencies are cleansed and new dependencies are added. - reqfile := &chart.Requirements{ - Dependencies: []*chart.Dependency{ - {Name: "reqtest", Version: "0.1.0", Repository: srv.URL()}, - {Name: "compressedchart", Version: "0.3.0", Repository: srv.URL()}, - }, + md.Requirements = []*chart.Dependency{ + {Name: "reqtest", Version: "0.1.0", Repository: srv.URL()}, + {Name: "compressedchart", Version: "0.3.0", Repository: srv.URL()}, } - dir := hh.Path(chartname) - if err := writeRequirements(dir, reqfile); err != nil { + dir := hh.Path(chartname, "Chart.yaml") + if err := chartutil.SaveChartfile(dir, md); err != nil { t.Fatal(err) } @@ -209,33 +206,25 @@ func TestDependencyUpdateCmd_DontDeleteOldChartsOnError(t *testing.T) { } } -// createTestingChart creates a basic chart that depends on reqtest-0.1.0 +// createTestingMetadata creates a basic chart that depends on reqtest-0.1.0 // // The baseURL can be used to point to a particular repository server. -func createTestingChart(dest, name, baseURL string) error { - cfile := &chart.Metadata{ +func createTestingMetadata(name, baseURL string) *chart.Metadata { + return &chart.Metadata{ Name: name, Version: "1.2.3", - } - dir := filepath.Join(dest, name) - _, err := chartutil.Create(cfile, dest) - if err != nil { - return err - } - req := &chart.Requirements{ - Dependencies: []*chart.Dependency{ + Requirements: []*chart.Dependency{ {Name: "reqtest", Version: "0.1.0", Repository: baseURL}, {Name: "compressedchart", Version: "0.1.0", Repository: baseURL}, }, } - return writeRequirements(dir, req) } -func writeRequirements(dir string, req *chart.Requirements) error { - data, err := yaml.Marshal(req) - if err != nil { - return err - } - - return ioutil.WriteFile(filepath.Join(dir, "requirements.yaml"), data, 0655) +// createTestingChart creates a basic chart that depends on reqtest-0.1.0 +// +// The baseURL can be used to point to a particular repository server. +func createTestingChart(dest, name, baseURL string) error { + cfile := createTestingMetadata(name, baseURL) + _, err := chartutil.Create(cfile, dest) + return err } diff --git a/cmd/helm/helm_test.go b/cmd/helm/helm_test.go index c32abd877..9bc68a8be 100644 --- a/cmd/helm/helm_test.go +++ b/cmd/helm/helm_test.go @@ -141,12 +141,10 @@ func ensureTestHome(t *testing.T, home helmpath.Home) { } } if r, err := repo.LoadRepositoriesFile(repoFile); err == repo.ErrRepoOutOfDate { - t.Log("Updating repository file format...") if err := r.WriteFile(repoFile, 0644); err != nil { t.Fatal(err) } } - t.Logf("$HELM_HOME has been configured at %s.\n", home) } // testHelmHome sets up a Helm Home in a temp dir. diff --git a/cmd/helm/install.go b/cmd/helm/install.go index 24ed14e33..8178f023c 100644 --- a/cmd/helm/install.go +++ b/cmd/helm/install.go @@ -181,7 +181,7 @@ func (o *installOptions) run(out io.Writer) error { return err } - if req := chartRequested.Requirements; req != nil { + if req := chartRequested.Metadata.Requirements; req != nil { // If checkDependencies returns an error, we have unfulfilled dependencies. // As of Helm 2.4.0, this is treated as a stopping condition: // https://github.com/kubernetes/helm/issues/2209 @@ -286,11 +286,11 @@ func generateName(nameTemplate string) (string, error) { return b.String(), err } -func checkDependencies(ch *chart.Chart, reqs *chart.Requirements) error { +func checkDependencies(ch *chart.Chart, reqs []*chart.Dependency) error { var missing []string OUTER: - for _, r := range reqs.Dependencies { + for _, r := range reqs { for _, d := range ch.Dependencies() { if d.Name() == r.Name { continue OUTER diff --git a/cmd/helm/install_test.go b/cmd/helm/install_test.go index cd0fc9b3f..0a0d0d351 100644 --- a/cmd/helm/install_test.go +++ b/cmd/helm/install_test.go @@ -112,9 +112,9 @@ func TestInstall(t *testing.T) { cmd: "install testdata/testcharts/chart-missing-deps", wantError: true, }, - // Install, chart with bad requirements.yaml in /charts + // Install, chart with bad dependencies in Chart.yaml in /charts { - name: "install chart with bad requirements.yaml", + name: "install chart with bad dependencies in Chart.yaml", cmd: "install testdata/testcharts/chart-bad-requirements", wantError: true, }, diff --git a/cmd/helm/package.go b/cmd/helm/package.go index a95146693..ac8b57c8c 100644 --- a/cmd/helm/package.go +++ b/cmd/helm/package.go @@ -102,7 +102,7 @@ func newPackageCmd(out io.Writer) *cobra.Command { f.StringVar(&o.version, "version", "", "set the version on the chart to this semver version") f.StringVar(&o.appVersion, "app-version", "", "set the appVersion on the chart to this version") f.StringVarP(&o.destination, "destination", "d", ".", "location to write the chart.") - f.BoolVarP(&o.dependencyUpdate, "dependency-update", "u", false, `update dependencies from "requirements.yaml" to dir "charts/" before packaging`) + f.BoolVarP(&o.dependencyUpdate, "dependency-update", "u", false, `update dependencies from "Chart.yaml" to dir "charts/" before packaging`) o.valuesOptions.addFlags(f) return cmd @@ -161,7 +161,7 @@ func (o *packageOptions) run(out io.Writer) error { return errors.Errorf("directory name (%s) and Chart.yaml name (%s) must match", filepath.Base(path), ch.Name()) } - if reqs := ch.Requirements; reqs != nil { + if reqs := ch.Metadata.Requirements; reqs != nil { if err := checkDependencies(ch, reqs); err != nil { return err } diff --git a/cmd/helm/template.go b/cmd/helm/template.go index 5584db87c..e94eecd21 100644 --- a/cmd/helm/template.go +++ b/cmd/helm/template.go @@ -158,7 +158,7 @@ func (o *templateOptions) run(out io.Writer) error { return err } - if req := c.Requirements; req != nil { + if req := c.Metadata.Requirements; req != nil { if err := checkDependencies(c, req); err != nil { return err } diff --git a/cmd/helm/testdata/output/dependency-list-archive.txt b/cmd/helm/testdata/output/dependency-list-archive.txt index 098bc0635..a0fc13cd0 100644 --- a/cmd/helm/testdata/output/dependency-list-archive.txt +++ b/cmd/helm/testdata/output/dependency-list-archive.txt @@ -1,4 +1,5 @@ NAME VERSION REPOSITORY STATUS reqsubchart 0.1.0 https://example.com/charts missing reqsubchart2 0.2.0 https://example.com/charts missing +reqsubchart3 >=0.1.0 https://example.com/charts missing diff --git a/cmd/helm/testdata/output/upgrade-with-bad-dependencies.txt b/cmd/helm/testdata/output/upgrade-with-bad-dependencies.txt index a50915b9b..5652097a6 100644 --- a/cmd/helm/testdata/output/upgrade-with-bad-dependencies.txt +++ b/cmd/helm/testdata/output/upgrade-with-bad-dependencies.txt @@ -1 +1 @@ -Error: cannot load requirements.yaml: error converting YAML to JSON: yaml: line 2: did not find expected '-' indicator +Error: cannot load Chart.yaml: error converting YAML to JSON: yaml: line 5: did not find expected '-' indicator diff --git a/cmd/helm/testdata/testcharts/chart-bad-requirements/Chart.yaml b/cmd/helm/testdata/testcharts/chart-bad-requirements/Chart.yaml index 02be4c013..ba72c77bf 100644 --- a/cmd/helm/testdata/testcharts/chart-bad-requirements/Chart.yaml +++ b/cmd/helm/testdata/testcharts/chart-bad-requirements/Chart.yaml @@ -1,3 +1,7 @@ description: A Helm chart for Kubernetes name: chart-missing-deps version: 0.1.0 +dependencies: + - name: reqsubchart + version: 0.1.0 + repository: "https://example.com/charts" diff --git a/cmd/helm/testdata/testcharts/chart-missing-deps/Chart.yaml b/cmd/helm/testdata/testcharts/chart-missing-deps/Chart.yaml index 02be4c013..8cd47d20c 100644 --- a/cmd/helm/testdata/testcharts/chart-missing-deps/Chart.yaml +++ b/cmd/helm/testdata/testcharts/chart-missing-deps/Chart.yaml @@ -1,3 +1,10 @@ description: A Helm chart for Kubernetes name: chart-missing-deps version: 0.1.0 +dependencies: + - name: reqsubchart + version: 0.1.0 + repository: "https://example.com/charts" + - name: reqsubchart2 + version: 0.2.0 + repository: "https://example.com/charts" diff --git a/cmd/helm/testdata/testcharts/reqtest-0.1.0.tgz b/cmd/helm/testdata/testcharts/reqtest-0.1.0.tgz index 356bc93030395fa1c045c8aaefb60c9d80a079a5..8618e91d73eb13803aefe7365459c8828163200d 100644 GIT binary patch delta 749 zcmVcI&t6!DQ&(|q#8D-r=IQBa4^OH^3`0?kueH6xFbONmXp**Fsj++zq;(IkG_ew~yM3tg{N(9;& z`2!R$a0Ui%Z8cAp&jbN5SZXVrHV-q%oh$7u2=Ja4r9_(OBB-yk1Ym*23aw_q=!mjy zy@dyM7jEw^I;gwTzy7QTcuG>Vi4mo%oBxJ?Q5H~N4_Dg2|J59gLWh<--gzktY0R_l z|KUqm`@i6_Li=MDfPMatLe}tqKVlQ_ef^d0&w}M){i|K5;A=;7p4?O=TnUMm45_^<$&k+Z4H;5blw|ms4B(O*p(_jj zo&RGAEseg$#1Se|&y f{rkU8@cI9^^S{UAIbOa500960H(VY805kvqK23*E delta 875 zcmV-x1C;!d29E~_ABzYS010l0kq9$?S>JD@HW0pN{)*}4rLDUB+5kD;PD!O!{VC;i zQdL!zfeE+)Lv52>`q00<1Kj3LWV7hD9IIsgDKe~M5BBbSpJxV%e`{3QIWL&h_8qIr z7qi19L_yGB3FE8lx#9hN-|zXssrLfrU&$7(IL}*cTiA->|Yp^?3wfivPan zkNF=(f#LrWIDreiVr{8m@PMB7@14T7PT)bxzjb9 zkLpG^9}Fe5zqaWGO<7;t>b9XaVb|2^ithiVp>LVwb*td}i*MUxS2w&6crTQ0Fep_N^K*6H<(&zOw=*Y1e_r#__wFyj&)$C2|t!v;l$BIT%J`27zn z<3x2G!_Tz_PDgd`5|~*z3Y2tiXEFG$7p~k_D{uYAi()^By~qw;t)sKE=qy^fVeFcW z;Hh9M|7XquCgcBT{eb@@2{7Xl9*5!o2mV_CE4WYeRh#sc0O|#Q7$y8&m&B%4oDSu? z7+w}yH!5}P-^L3}4e)tm2mfa)2~P3< zVf`-*Li7G_5t#Z~pQ-FjW9B007x> B&%OWv diff --git a/cmd/helm/testdata/testcharts/reqtest/Chart.yaml b/cmd/helm/testdata/testcharts/reqtest/Chart.yaml index e2fbe4b01..e38826af3 100644 --- a/cmd/helm/testdata/testcharts/reqtest/Chart.yaml +++ b/cmd/helm/testdata/testcharts/reqtest/Chart.yaml @@ -1,3 +1,13 @@ description: A Helm chart for Kubernetes name: reqtest version: 0.1.0 +dependencies: + - name: reqsubchart + version: 0.1.0 + repository: "https://example.com/charts" + - name: reqsubchart2 + version: 0.2.0 + repository: "https://example.com/charts" + - name: reqsubchart3 + version: ">=0.1.0" + repository: "https://example.com/charts" diff --git a/cmd/helm/upgrade.go b/cmd/helm/upgrade.go index afe993f43..841e871c7 100644 --- a/cmd/helm/upgrade.go +++ b/cmd/helm/upgrade.go @@ -154,7 +154,7 @@ func (o *upgradeOptions) run(out io.Writer) error { if err != nil { return err } - if req := ch.Requirements; req != nil { + if req := ch.Metadata.Requirements; req != nil { if err := checkDependencies(ch, req); err != nil { return err } diff --git a/pkg/chart/chart.go b/pkg/chart/chart.go index c8918df18..c78ad60fb 100644 --- a/pkg/chart/chart.go +++ b/pkg/chart/chart.go @@ -20,8 +20,6 @@ package chart type Chart struct { // Metadata is the contents of the Chartfile. Metadata *Metadata - // Requirements is the contents of requirements.yaml. - Requirements *Requirements // RequirementsLock is the contents of requirements.lock. RequirementsLock *RequirementsLock // Templates for this chart. diff --git a/pkg/chart/loader/load.go b/pkg/chart/loader/load.go index 66297afdd..4075ed6fa 100644 --- a/pkg/chart/loader/load.go +++ b/pkg/chart/loader/load.go @@ -77,11 +77,6 @@ func LoadFiles(files []*BufferedFile) (*chart.Chart, error) { if err := yaml.Unmarshal(f.Data, c.Metadata); err != nil { return c, errors.Wrap(err, "cannot load Chart.yaml") } - case f.Name == "requirements.yaml": - c.Requirements = new(chart.Requirements) - if err := yaml.Unmarshal(f.Data, c.Requirements); err != nil { - return c, errors.Wrap(err, "cannot load requirements.yaml") - } case f.Name == "requirements.lock": c.RequirementsLock = new(chart.RequirementsLock) if err := yaml.Unmarshal(f.Data, &c.RequirementsLock); err != nil { diff --git a/pkg/chart/loader/load_test.go b/pkg/chart/loader/load_test.go index 2efea1a35..630da5cd4 100644 --- a/pkg/chart/loader/load_test.go +++ b/pkg/chart/loader/load_test.go @@ -176,15 +176,15 @@ func verifyChart(t *testing.T, c *chart.Chart) { } func verifyRequirements(t *testing.T, c *chart.Chart) { - if len(c.Requirements.Dependencies) != 2 { - t.Errorf("Expected 2 requirements, got %d", len(c.Requirements.Dependencies)) + if len(c.Metadata.Requirements) != 2 { + t.Errorf("Expected 2 requirements, got %d", len(c.Metadata.Requirements)) } tests := []*chart.Dependency{ {Name: "alpine", Version: "0.1.0", Repository: "https://example.com/charts"}, {Name: "mariner", Version: "4.3.2", Repository: "https://example.com/charts"}, } for i, tt := range tests { - d := c.Requirements.Dependencies[i] + d := c.Metadata.Requirements[i] if d.Name != tt.Name { t.Errorf("Expected dependency named %q, got %q", tt.Name, d.Name) } @@ -198,15 +198,15 @@ func verifyRequirements(t *testing.T, c *chart.Chart) { } func verifyRequirementsLock(t *testing.T, c *chart.Chart) { - if len(c.Requirements.Dependencies) != 2 { - t.Errorf("Expected 2 requirements, got %d", len(c.Requirements.Dependencies)) + if len(c.Metadata.Requirements) != 2 { + t.Errorf("Expected 2 requirements, got %d", len(c.Metadata.Requirements)) } tests := []*chart.Dependency{ {Name: "alpine", Version: "0.1.0", Repository: "https://example.com/charts"}, {Name: "mariner", Version: "4.3.2", Repository: "https://example.com/charts"}, } for i, tt := range tests { - d := c.Requirements.Dependencies[i] + d := c.Metadata.Requirements[i] if d.Name != tt.Name { t.Errorf("Expected dependency named %q, got %q", tt.Name, d.Name) } @@ -224,7 +224,6 @@ func verifyFrobnitz(t *testing.T, c *chart.Chart) { } func verifyChartFileAndTemplate(t *testing.T, c *chart.Chart, name string) { - if c.Metadata == nil { t.Fatal("Metadata is nil") } @@ -246,8 +245,8 @@ func verifyChartFileAndTemplate(t *testing.T, c *chart.Chart, name string) { if len(c.Dependencies()) != 2 { t.Fatalf("Expected 2 Dependency, got %d", len(c.Dependencies())) } - if len(c.Requirements.Dependencies) != 2 { - t.Fatalf("Expected 2 Requirements.Dependency, got %d", len(c.Requirements.Dependencies)) + if len(c.Metadata.Requirements) != 2 { + t.Fatalf("Expected 2 Requirements.Dependency, got %d", len(c.Metadata.Requirements)) } if len(c.RequirementsLock.Dependencies) != 2 { t.Fatalf("Expected 2 RequirementsLock.Dependency, got %d", len(c.RequirementsLock.Dependencies)) diff --git a/pkg/chart/loader/testdata/albatross/Chart.yaml b/pkg/chart/loader/testdata/albatross/Chart.yaml new file mode 100644 index 000000000..eeef737ff --- /dev/null +++ b/pkg/chart/loader/testdata/albatross/Chart.yaml @@ -0,0 +1,4 @@ +name: albatross +description: A Helm chart for Kubernetes +version: 0.1.0 +home: "" diff --git a/pkg/chart/loader/testdata/albatross/values.yaml b/pkg/chart/loader/testdata/albatross/values.yaml new file mode 100644 index 000000000..3121cd7ce --- /dev/null +++ b/pkg/chart/loader/testdata/albatross/values.yaml @@ -0,0 +1,4 @@ +albatross: "true" + +global: + author: Coleridge diff --git a/pkg/chart/loader/testdata/frobnitz-1.2.3.tgz b/pkg/chart/loader/testdata/frobnitz-1.2.3.tgz index fb21cd08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hk9CHYutz z@CW=p7rIPb+s6dp8^0tl%~>MRnEGSzcb?;t=H_7%!Bcg2=X|v`@&EeW z3FTeI5DWi1|7944{{PzOdmH&b!a`sZ|APnff1@yT{(md7>woLj{v}Z`Lypn_19L_B z%&yQ^%@nQ-Q&0j`Ir~?E=NS*;YHKI1Af*x$Gm_tKCn9FhzXC;VLB`*ZSZ>Y z)>gTt=wI^*N{$+px1PmQI&uU2=cB{;|Fp?~CjR57SNH#8xBtH#oxt0N#?w}I;GOJj z;s5pQr}v$ykU7!DH!wEXBzTJnBNDC0Tec1;2$c%7fQdO)3R9q53s{M{+!$bGZZY~M|IbH<@&9@3f7q+@AIEP0e>?i9{g0pg(AMd1 z=;QoX0UJjM0BE-V_4wb>u1mO(4kLVKkB%`%Fm_V}pH0pDZx?oU_lO_zi(t+E ze^mGXN0FQVYel<+yWar#_SDS(2($kiz+7iSj^T}9C}}!Fhq;rJlhbq2p8)^>|Nlfr J;bQ=3007~8JqQ2* diff --git a/pkg/chart/loader/testdata/frobnitz_backslash/Chart.yaml b/pkg/chart/loader/testdata/frobnitz_backslash/Chart.yaml index 49df2a046..b1dd40a5d 100755 --- a/pkg/chart/loader/testdata/frobnitz_backslash/Chart.yaml +++ b/pkg/chart/loader/testdata/frobnitz_backslash/Chart.yaml @@ -18,3 +18,10 @@ icon: https://example.com/64x64.png annotations: extrakey: extravalue anotherkey: anothervalue +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_backslash/requirements.yaml b/pkg/chart/loader/testdata/frobnitz_backslash/requirements.yaml deleted file mode 100755 index 5eb0bc98b..000000000 --- a/pkg/chart/loader/testdata/frobnitz_backslash/requirements.yaml +++ /dev/null @@ -1,7 +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 diff --git a/pkg/chart/loader/testdata/genfrob.sh b/pkg/chart/loader/testdata/genfrob.sh new file mode 100755 index 000000000..8f2cddec1 --- /dev/null +++ b/pkg/chart/loader/testdata/genfrob.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +# Pack the albatross chart into the mariner chart. +echo "Packing albatross into mariner" +tar -zcvf mariner/charts/albatross-0.1.0.tgz albatross + +echo "Packing mariner into frobnitz" +tar -zcvf frobnitz/charts/mariner-4.3.2.tgz mariner + +# Pack the frobnitz chart. +echo "Packing frobnitz" +tar --exclude=ignore/* -zcvf frobnitz-1.2.3.tgz frobnitz diff --git a/pkg/chart/loader/testdata/mariner/Chart.yaml b/pkg/chart/loader/testdata/mariner/Chart.yaml new file mode 100644 index 000000000..e2efb7f99 --- /dev/null +++ b/pkg/chart/loader/testdata/mariner/Chart.yaml @@ -0,0 +1,8 @@ +name: mariner +description: A Helm chart for Kubernetes +version: 4.3.2 +home: "" +dependencies: + - name: albatross + repository: https://example.com/mariner/charts + version: "0.1.0" diff --git a/pkg/chart/loader/testdata/mariner/charts/albatross-0.1.0.tgz b/pkg/chart/loader/testdata/mariner/charts/albatross-0.1.0.tgz new file mode 100644 index 0000000000000000000000000000000000000000..f34758e120e49702c5029755b49eaa181d593574 GIT binary patch literal 292 zcmV+<0o(o`iwFSX$c0+~1MSq`YJ)Ho25_(Q6bB!mi<&5SH+nPJQ^fXIg|sP2EbQ%P zyJDfN8-uz(?EBpuFAg#B*j`^L7m{a~H*Ii~tYm}&mY&iJ@^F5-n;ZfSMA8PqyY&qKq0$B~0Lun(su zxyTk$bnduLnu?!35PZoc{|93S4s-kfKFhz<)ph<$og@F>VVeIK-slHTh1giv7+VV> qGsMpMnwHM8@7Ehfx&Z(H000000000000000exp}+u4EDbC;$LV29I_C literal 0 HcmV?d00001 diff --git a/pkg/chart/loader/testdata/mariner/templates/placeholder.tpl b/pkg/chart/loader/testdata/mariner/templates/placeholder.tpl new file mode 100644 index 000000000..29c11843a --- /dev/null +++ b/pkg/chart/loader/testdata/mariner/templates/placeholder.tpl @@ -0,0 +1 @@ +# This is a placeholder. diff --git a/pkg/chart/loader/testdata/mariner/values.yaml b/pkg/chart/loader/testdata/mariner/values.yaml new file mode 100644 index 000000000..b0ccb0086 --- /dev/null +++ b/pkg/chart/loader/testdata/mariner/values.yaml @@ -0,0 +1,7 @@ +# Default values for . +# This is a YAML-formatted file. https://github.com/toml-lang/toml +# Declare name/value pairs to be passed into your templates. +# name: "value" + +: + test: true diff --git a/pkg/chart/metadata.go b/pkg/chart/metadata.go index 850a0b26a..239bdd2eb 100644 --- a/pkg/chart/metadata.go +++ b/pkg/chart/metadata.go @@ -65,4 +65,6 @@ type Metadata struct { Annotations map[string]string `json:"annotations,omitempty"` // KubeVersion is a SemVer constraint specifying the version of Kubernetes required. KubeVersion string `json:"kubeVersion,omitempty"` + // Requirements are a list of requirements for a chart. + Requirements []*Dependency `json:"dependencies,omitempty"` } diff --git a/pkg/chart/requirements.go b/pkg/chart/requirements.go index b6e2dba30..bb2d1d11c 100644 --- a/pkg/chart/requirements.go +++ b/pkg/chart/requirements.go @@ -49,14 +49,6 @@ type Dependency struct { Alias string `json:"alias,omitempty"` } -// Requirements is a list of requirements for a chart. -// -// Requirements are charts upon which this chart depends. This expresses -// developer intent. -type Requirements struct { - Dependencies []*Dependency `json:"dependencies"` -} - // RequirementsLock is a lock file for requirements. // // It represents the state that the dependencies should be in. diff --git a/pkg/chartutil/create.go b/pkg/chartutil/create.go index 9d68c7c57..b5bed235f 100644 --- a/pkg/chartutil/create.go +++ b/pkg/chartutil/create.go @@ -318,7 +318,7 @@ func CreateFrom(chartfile *chart.Metadata, dest, src string) error { } var m map[string]interface{} - if err := yaml.Unmarshal([]byte(transform(string(b), schart.Name())), &m); err != nil { + if err := yaml.Unmarshal(transform(string(b), schart.Name()), &m); err != nil { return err } schart.Values = m diff --git a/pkg/chartutil/requirements.go b/pkg/chartutil/requirements.go index d58187e6d..2325176ed 100644 --- a/pkg/chartutil/requirements.go +++ b/pkg/chartutil/requirements.go @@ -26,11 +26,11 @@ import ( ) // ProcessRequirementsConditions disables charts based on condition path value in values -func ProcessRequirementsConditions(reqs *chart.Requirements, cvals Values) { +func ProcessRequirementsConditions(reqs []*chart.Dependency, cvals Values) { if reqs == nil { return } - for _, r := range reqs.Dependencies { + for _, r := range reqs { var hasTrue, hasFalse bool for _, c := range strings.Split(strings.TrimSpace(r.Condition), ",") { if len(c) > 0 { @@ -67,7 +67,7 @@ func ProcessRequirementsConditions(reqs *chart.Requirements, cvals Values) { } // ProcessRequirementsTags disables charts based on tags in values -func ProcessRequirementsTags(reqs *chart.Requirements, cvals Values) { +func ProcessRequirementsTags(reqs []*chart.Dependency, cvals Values) { if reqs == nil { return } @@ -75,7 +75,7 @@ func ProcessRequirementsTags(reqs *chart.Requirements, cvals Values) { if err != nil { return } - for _, r := range reqs.Dependencies { + for _, r := range reqs { var hasTrue, hasFalse bool for _, k := range r.Tags { if b, ok := vt[k]; ok { @@ -127,19 +127,19 @@ func getAliasDependency(charts []*chart.Chart, aliasChart *chart.Dependency) *ch // ProcessRequirementsEnabled removes disabled charts from dependencies func ProcessRequirementsEnabled(c *chart.Chart, v map[string]interface{}) error { - if c.Requirements == nil { + if c.Metadata.Requirements == nil { return nil } var chartDependencies []*chart.Chart - // If any dependency is not a part of requirements.yaml + // If any dependency is not a part of Chart.yaml // then this should be added to chartDependencies. - // However, if the dependency is already specified in requirements.yaml - // we should not add it, as it would be anyways processed from requirements.yaml + // However, if the dependency is already specified in Chart.yaml + // we should not add it, as it would be anyways processed from Chart.yaml for _, existingDependency := range c.Dependencies() { var dependencyFound bool - for _, req := range c.Requirements.Dependencies { + for _, req := range c.Metadata.Requirements { if existingDependency.Metadata.Name == req.Name && version.IsCompatibleRange(req.Version, existingDependency.Metadata.Version) { dependencyFound = true break @@ -150,7 +150,7 @@ func ProcessRequirementsEnabled(c *chart.Chart, v map[string]interface{}) error } } - for _, req := range c.Requirements.Dependencies { + for _, req := range c.Metadata.Requirements { if chartDependency := getAliasDependency(c.Dependencies(), req); chartDependency != nil { chartDependencies = append(chartDependencies, chartDependency) } @@ -161,7 +161,7 @@ func ProcessRequirementsEnabled(c *chart.Chart, v map[string]interface{}) error c.SetDependencies(chartDependencies...) // set all to true - for _, lr := range c.Requirements.Dependencies { + for _, lr := range c.Metadata.Requirements { lr.Enabled = true } b, _ := yaml.Marshal(v) @@ -170,11 +170,11 @@ func ProcessRequirementsEnabled(c *chart.Chart, v map[string]interface{}) error return err } // flag dependencies as enabled/disabled - ProcessRequirementsTags(c.Requirements, cvals) - ProcessRequirementsConditions(c.Requirements, cvals) + ProcessRequirementsTags(c.Metadata.Requirements, cvals) + ProcessRequirementsConditions(c.Metadata.Requirements, cvals) // make a map of charts to remove rm := map[string]struct{}{} - for _, r := range c.Requirements.Dependencies { + for _, r := range c.Metadata.Requirements { if !r.Enabled { // remove disabled chart rm[r.Name] = struct{}{} @@ -232,7 +232,7 @@ func pathToMap(path string, data map[string]interface{}) map[string]interface{} // processImportValues merges values from child to parent based on the chart's dependencies' ImportValues field. func processImportValues(c *chart.Chart) error { - if c.Requirements == nil { + if c.Metadata.Requirements == nil { return nil } // combine chart values and empty config to get Values @@ -242,7 +242,7 @@ func processImportValues(c *chart.Chart) error { } b := make(map[string]interface{}) // import values from each dependency if specified in import-values - for _, r := range c.Requirements.Dependencies { + for _, r := range c.Metadata.Requirements { var outiv []interface{} for _, riv := range r.ImportValues { switch iv := riv.(type) { diff --git a/pkg/chartutil/requirements_test.go b/pkg/chartutil/requirements_test.go index 120275cc4..4d35c07cf 100644 --- a/pkg/chartutil/requirements_test.go +++ b/pkg/chartutil/requirements_test.go @@ -256,39 +256,39 @@ func TestGetAliasDependency(t *testing.T) { t.Fatalf("Failed to load testdata: %s", err) } - req := c.Requirements + req := c.Metadata.Requirements - if len(req.Dependencies) == 0 { + if len(req) == 0 { t.Fatalf("There are no requirements to test") } // Success case - aliasChart := getAliasDependency(c.Dependencies(), req.Dependencies[0]) + aliasChart := getAliasDependency(c.Dependencies(), req[0]) if aliasChart == nil { - t.Fatalf("Failed to get dependency chart for alias %s", req.Dependencies[0].Name) + t.Fatalf("Failed to get dependency chart for alias %s", req[0].Name) } - if req.Dependencies[0].Alias != "" { - if aliasChart.Name() != req.Dependencies[0].Alias { - t.Fatalf("Dependency chart name should be %s but got %s", req.Dependencies[0].Alias, aliasChart.Name()) + if req[0].Alias != "" { + if aliasChart.Name() != req[0].Alias { + t.Fatalf("Dependency chart name should be %s but got %s", req[0].Alias, aliasChart.Name()) } - } else if aliasChart.Name() != req.Dependencies[0].Name { - t.Fatalf("Dependency chart name should be %s but got %s", req.Dependencies[0].Name, aliasChart.Name()) + } else if aliasChart.Name() != req[0].Name { + t.Fatalf("Dependency chart name should be %s but got %s", req[0].Name, aliasChart.Name()) } - if req.Dependencies[0].Version != "" { - if !version.IsCompatibleRange(req.Dependencies[0].Version, aliasChart.Metadata.Version) { + if req[0].Version != "" { + if !version.IsCompatibleRange(req[0].Version, aliasChart.Metadata.Version) { t.Fatalf("Dependency chart version is not in the compatible range") } } // Failure case - req.Dependencies[0].Name = "something-else" - if aliasChart := getAliasDependency(c.Dependencies(), req.Dependencies[0]); aliasChart != nil { + req[0].Name = "something-else" + if aliasChart := getAliasDependency(c.Dependencies(), req[0]); aliasChart != nil { t.Fatalf("expected no chart but got %s", aliasChart.Name()) } - req.Dependencies[0].Version = "something else which is not in the compatible range" - if version.IsCompatibleRange(req.Dependencies[0].Version, aliasChart.Metadata.Version) { + req[0].Version = "something else which is not in the compatible range" + if version.IsCompatibleRange(req[0].Version, aliasChart.Metadata.Version) { t.Fatalf("Dependency chart version which is not in the compatible range should cause a failure other than a success ") } } @@ -312,8 +312,8 @@ func TestDependentChartAliases(t *testing.T) { t.Fatal("Expected alias dependencies to be added, but did not got that") } - if len(c.Dependencies()) != len(c.Requirements.Dependencies) { - t.Fatalf("Expected number of chart dependencies %d, but got %d", len(c.Requirements.Dependencies), len(c.Dependencies())) + if len(c.Dependencies()) != len(c.Metadata.Requirements) { + t.Fatalf("Expected number of chart dependencies %d, but got %d", len(c.Metadata.Requirements), len(c.Dependencies())) } } @@ -375,8 +375,8 @@ func TestDependentChartsWithSubchartsAllSpecifiedInRequirements(t *testing.T) { t.Fatal("Expected no changes in dependencies to be, but did something got changed") } - if len(c.Dependencies()) != len(c.Requirements.Dependencies) { - t.Fatalf("Expected number of chart dependencies %d, but got %d", len(c.Requirements.Dependencies), len(c.Dependencies())) + if len(c.Dependencies()) != len(c.Metadata.Requirements) { + t.Fatalf("Expected number of chart dependencies %d, but got %d", len(c.Metadata.Requirements), len(c.Dependencies())) } } @@ -399,21 +399,21 @@ func TestDependentChartsWithSomeSubchartsSpecifiedInRequirements(t *testing.T) { t.Fatal("Expected no changes in dependencies to be, but did something got changed") } - if len(c.Dependencies()) <= len(c.Requirements.Dependencies) { - t.Fatalf("Expected more dependencies than specified in requirements.yaml(%d), but got %d", len(c.Requirements.Dependencies), len(c.Dependencies())) + if len(c.Dependencies()) <= len(c.Metadata.Requirements) { + t.Fatalf("Expected more dependencies than specified in requirements.yaml(%d), but got %d", len(c.Metadata.Requirements), len(c.Dependencies())) } } func verifyRequirements(t *testing.T, c *chart.Chart) { - if len(c.Requirements.Dependencies) != 2 { - t.Errorf("Expected 2 requirements, got %d", len(c.Requirements.Dependencies)) + if len(c.Metadata.Requirements) != 2 { + t.Errorf("Expected 2 requirements, got %d", len(c.Metadata.Requirements)) } tests := []*chart.Dependency{ {Name: "alpine", Version: "0.1.0", Repository: "https://example.com/charts"}, {Name: "mariner", Version: "4.3.2", Repository: "https://example.com/charts"}, } for i, tt := range tests { - d := c.Requirements.Dependencies[i] + d := c.Metadata.Requirements[i] if d.Name != tt.Name { t.Errorf("Expected dependency named %q, got %q", tt.Name, d.Name) } @@ -427,15 +427,15 @@ func verifyRequirements(t *testing.T, c *chart.Chart) { } func verifyRequirementsLock(t *testing.T, c *chart.Chart) { - if len(c.Requirements.Dependencies) != 2 { - t.Errorf("Expected 2 requirements, got %d", len(c.Requirements.Dependencies)) + if len(c.Metadata.Requirements) != 2 { + t.Errorf("Expected 2 requirements, got %d", len(c.Metadata.Requirements)) } tests := []*chart.Dependency{ {Name: "alpine", Version: "0.1.0", Repository: "https://example.com/charts"}, {Name: "mariner", Version: "4.3.2", Repository: "https://example.com/charts"}, } for i, tt := range tests { - d := c.Requirements.Dependencies[i] + d := c.Metadata.Requirements[i] if d.Name != tt.Name { t.Errorf("Expected dependency named %q, got %q", tt.Name, d.Name) } diff --git a/pkg/chartutil/testdata/dependent-chart-alias/Chart.yaml b/pkg/chartutil/testdata/dependent-chart-alias/Chart.yaml index 7c071c27b..751a3aa67 100644 --- a/pkg/chartutil/testdata/dependent-chart-alias/Chart.yaml +++ b/pkg/chartutil/testdata/dependent-chart-alias/Chart.yaml @@ -15,3 +15,15 @@ sources: - https://example.com/foo/bar home: http://example.com icon: https://example.com/64x64.png +dependencies: + - name: alpine + version: "0.1.0" + repository: https://example.com/charts + - name: mariner + version: "4.3.2" + repository: https://example.com/charts + alias: mariners2 + - name: mariner + version: "4.3.2" + repository: https://example.com/charts + alias: mariners1 diff --git a/pkg/chartutil/testdata/dependent-chart-with-all-in-requirements-yaml/Chart.yaml b/pkg/chartutil/testdata/dependent-chart-with-all-in-requirements-yaml/Chart.yaml index 7c071c27b..fe7a99681 100644 --- a/pkg/chartutil/testdata/dependent-chart-with-all-in-requirements-yaml/Chart.yaml +++ b/pkg/chartutil/testdata/dependent-chart-with-all-in-requirements-yaml/Chart.yaml @@ -15,3 +15,10 @@ sources: - https://example.com/foo/bar home: http://example.com icon: https://example.com/64x64.png +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/chartutil/testdata/dependent-chart-with-mixed-requirements-yaml/Chart.yaml b/pkg/chartutil/testdata/dependent-chart-with-mixed-requirements-yaml/Chart.yaml index 7c071c27b..7fc39e28d 100644 --- a/pkg/chartutil/testdata/dependent-chart-with-mixed-requirements-yaml/Chart.yaml +++ b/pkg/chartutil/testdata/dependent-chart-with-mixed-requirements-yaml/Chart.yaml @@ -15,3 +15,7 @@ sources: - https://example.com/foo/bar home: http://example.com icon: https://example.com/64x64.png +dependencies: + - name: alpine + version: "0.1.0" + repository: https://example.com/charts diff --git a/pkg/chartutil/testdata/frobnitz-1.2.3.tgz b/pkg/chartutil/testdata/frobnitz-1.2.3.tgz index fb21cd08fb08fd2f4e45e940634ce1cdb0421457..a8ba8ec6f4838980e28e67d8f619cc097ccd03f5 100644 GIT binary patch literal 3559 zcmVibJL}9Wu%e=t|2#?xG|SXH($xNW5aumrTAnFsh8LLjPyZfZY6zz6|IO?nZ0dR} zYu0=};>^zby<_Ih@ArP!n?#mLFjD+zxlheOp-=>AG(bFRwc=4hsBK3(fKsJWD^+TR zme2wP`ax)XfTjk=o#_x+V&YxevEPUD_?RHkG5>buN8p+WOcXw`&Pqd|lUr5e2nK0r|ugK@<_eE#jz4oozugUJl7hb%68)Ps`X zH8}adYck35xP>&(9`C~q|0|VBqKf=iA^z78YC__FZ-6vW10c&$j4=eHDrH8}07HP| zrI6_%r(-D-FBZopQyf75NM|`NOLf%6lsJK_Fj)$;q%o|X3y}d3c&j1d2WMg#T?*vI zA9_Yl>SYF!GVpwObf*z1IfLKTx&~*SHqNGDWGP>9qrjrH}4RIY~s8T0} zF+j!$K{(C9s#T0k0;9K7tHd#8RtN1pCiA?B3z5sK5Xci5MxH>jvSdbRS)iy+Aft4` zJ>RaXR-LX@<0fO0j5Hb+5ZhTQNt=anl87i7vSNY#+*YKACTP?{ zqmF{ro()Nx(DM@S@Ycgu;7VM9i5FRDVmOLtSj+7Ps1x{{tJ0u>WQ7TEX;F=V%9wIHVr6h}uv{#~s;)$~5rH&H&nJgsNIGCh2cVLYdHWAaABypi z^caV#hgfbTDc#%AjVi7$^M=fB$BK~i0Uah#*x)z-$QZyZk z8Oc-&Ca>NG2T|jCu@R+4Y(?#+6&C7+Mmh)&q~l*`t#tB#WOPhySkIm~pU!)_54Z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lPj?8rD_6uE|+tRSVTU}Ob4 zqbhJc#flL&}lkmJBgoLy_ff6X6itj)ng3b`MC_2ns1Br!DR13LseNaoT!sA*Xg;*;&-39 z8u{Nw1D7W{g-8$V4Vw5L_G;_@aois`{##LP1J5<(=@@<%sh6WBDbZvb-G6%<{DKUL zLK`f6ch|YS4NCX0{OkcRGC^hs5&#)Ws>$sBogYvxXi_GIa(VG$oqH{>>hk9CHYutz z@CW=p7rIPb+s6dp8^0tl%~>MRnEGSzcb?;t=H_7%!Bcg2=X|v`@&EeW z3FTeI5DWi1|7944{{PzOdmH&b!a`sZ|APnff1@yT{(md7>woLj{v}Z`Lypn_19L_B z%&yQ^%@nQ-Q&0j`Ir~?E=NS*;YHKI1Af*x$Gm_tKCn9FhzXC;VLB`*ZSZ>Y z)>gTt=wI^*N{$+px1PmQI&uU2=cB{;|Fp?~CjR57SNH#8xBtH#oxt0N#?w}I;GOJj z;s5pQr}v$ykU7!DH!wEXBzTJnBNDC0Tec1;2$c%7fQdO)3R9q53s{M{+!$bGZZY~M|IbH<@&9@3f7q+@AIEP0e>?i9{g0pg(AMd1 z=;QoX0UJjM0BE-V_4wb>u1mO(4kLVKkB%`%Fm_V}pH0pDZx?oU_lO_zi(t+E ze^mGXN0FQVYel<+yWar#_SDS(2($kiz+7iSj^T}9C}}!Fhq;rJlhbq2p8)^>|Nlfr J;bQ=3007~8JqQ2* diff --git a/pkg/chartutil/testdata/frobnitz_backslash/Chart.yaml b/pkg/chartutil/testdata/frobnitz_backslash/Chart.yaml index 49df2a046..b1dd40a5d 100755 --- a/pkg/chartutil/testdata/frobnitz_backslash/Chart.yaml +++ b/pkg/chartutil/testdata/frobnitz_backslash/Chart.yaml @@ -18,3 +18,10 @@ icon: https://example.com/64x64.png annotations: extrakey: extravalue anotherkey: anothervalue +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/chartutil/testdata/mariner/Chart.yaml b/pkg/chartutil/testdata/mariner/Chart.yaml index 4d52794c6..e2efb7f99 100644 --- a/pkg/chartutil/testdata/mariner/Chart.yaml +++ b/pkg/chartutil/testdata/mariner/Chart.yaml @@ -2,3 +2,7 @@ name: mariner description: A Helm chart for Kubernetes version: 4.3.2 home: "" +dependencies: + - name: albatross + repository: https://example.com/mariner/charts + version: "0.1.0" diff --git a/pkg/chartutil/testdata/mariner/charts/albatross-0.1.0.tgz b/pkg/chartutil/testdata/mariner/charts/albatross-0.1.0.tgz index 0b66d27fe1bb83cde374420591ce39b5ee58543f..72bb6b36f07c6377977fa59c19f5159fdc3c6d0d 100644 GIT binary patch literal 292 zcmV+<0o(o`iwFP^#)Vq|1MSpHYQr!P24JssiXjI`C0kO!yOK?zr;wA$17s^ma-g@b zlLiMu(^5$Kp#Qg-jgUtg{dT@_Ifj%Tio20g&WxdBwf0zLso&}esj9TPw8m&nQdN3Z z6=d$$(pjIfi$g0eGAF*iZdkTjeX!5z9Ao_>+&KUF#>G5+ajn1gH-`JLT3?^PD%HjO zjaFqr^45*K=bz8Nb1m02z5=o2w20eX-iEHGM|xu4(&F$kXcZzo_YKF6Gbgd~{uR`@o*M z%7&edw#^PUw8u^~=X1(x-;Xn!Wk0%GbA5)&B41Dtb&pGEL74_#ol>prTw=m`( zZL@bK9qp@cfp6q5bA|kGVa)$vTxZ)U9snQJf0Fvu`%medQ2%dX$UhbD7&<%4vW@eV tab?Ds>0<3e$rj$(uw88|syhGx0000000000006*m_5v>lSt 0 { - return nil, errors.Errorf("can't get a valid version for repositories %s. Try changing the version constraint in requirements.yaml", strings.Join(missing, ", ")) + return nil, errors.Errorf("can't get a valid version for repositories %s. Try changing the version constraint in Chart.yaml", strings.Join(missing, ", ")) } return &chart.RequirementsLock{ Generated: time.Now(), @@ -118,7 +118,7 @@ func (r *Resolver) Resolve(reqs *chart.Requirements, repoNames map[string]string // // This should be used only to compare against another hash generated by this // function. -func HashReq(req *chart.Requirements) (string, error) { +func HashReq(req []*chart.Dependency) (string, error) { data, err := json.Marshal(req) if err != nil { return "", err diff --git a/pkg/resolver/resolver_test.go b/pkg/resolver/resolver_test.go index 205cce69f..84cf54ccf 100644 --- a/pkg/resolver/resolver_test.go +++ b/pkg/resolver/resolver_test.go @@ -24,52 +24,42 @@ import ( func TestResolve(t *testing.T) { tests := []struct { name string - req *chart.Requirements + req []*chart.Dependency expect *chart.RequirementsLock err bool }{ { name: "version failure", - req: &chart.Requirements{ - Dependencies: []*chart.Dependency{ - {Name: "oedipus-rex", Repository: "http://example.com", Version: ">a1"}, - }, + req: []*chart.Dependency{ + {Name: "oedipus-rex", Repository: "http://example.com", Version: ">a1"}, }, err: true, }, { name: "cache index failure", - req: &chart.Requirements{ - Dependencies: []*chart.Dependency{ - {Name: "oedipus-rex", Repository: "http://example.com", Version: "1.0.0"}, - }, + req: []*chart.Dependency{ + {Name: "oedipus-rex", Repository: "http://example.com", Version: "1.0.0"}, }, err: true, }, { name: "chart not found failure", - req: &chart.Requirements{ - Dependencies: []*chart.Dependency{ - {Name: "redis", Repository: "http://example.com", Version: "1.0.0"}, - }, + req: []*chart.Dependency{ + {Name: "redis", Repository: "http://example.com", Version: "1.0.0"}, }, err: true, }, { name: "constraint not satisfied failure", - req: &chart.Requirements{ - Dependencies: []*chart.Dependency{ - {Name: "alpine", Repository: "http://example.com", Version: ">=1.0.0"}, - }, + req: []*chart.Dependency{ + {Name: "alpine", Repository: "http://example.com", Version: ">=1.0.0"}, }, err: true, }, { name: "valid lock", - req: &chart.Requirements{ - Dependencies: []*chart.Dependency{ - {Name: "alpine", Repository: "http://example.com", Version: ">=0.1.0"}, - }, + req: []*chart.Dependency{ + {Name: "alpine", Repository: "http://example.com", Version: ">=0.1.0"}, }, expect: &chart.RequirementsLock{ Dependencies: []*chart.Dependency{ @@ -79,10 +69,8 @@ func TestResolve(t *testing.T) { }, { name: "repo from valid local path", - req: &chart.Requirements{ - Dependencies: []*chart.Dependency{ - {Name: "signtest", Repository: "file://../../../../cmd/helm/testdata/testcharts/signtest", Version: "0.1.0"}, - }, + req: []*chart.Dependency{ + {Name: "signtest", Repository: "file://../../../../cmd/helm/testdata/testcharts/signtest", Version: "0.1.0"}, }, expect: &chart.RequirementsLock{ Dependencies: []*chart.Dependency{ @@ -92,10 +80,8 @@ func TestResolve(t *testing.T) { }, { name: "repo from invalid local path", - req: &chart.Requirements{ - Dependencies: []*chart.Dependency{ - {Name: "notexist", Repository: "file://../testdata/notexist", Version: "0.1.0"}, - }, + req: []*chart.Dependency{ + {Name: "notexist", Repository: "file://../testdata/notexist", Version: "0.1.0"}, }, err: true, }, @@ -128,7 +114,7 @@ func TestResolve(t *testing.T) { } // Check fields. - if len(l.Dependencies) != len(tt.req.Dependencies) { + if len(l.Dependencies) != len(tt.req) { t.Errorf("%s: wrong number of dependencies in lock", tt.name) } d0 := l.Dependencies[0] @@ -146,11 +132,9 @@ func TestResolve(t *testing.T) { } func TestHashReq(t *testing.T) { - expect := "sha256:e70e41f8922e19558a8bf62f591a8b70c8e4622e3c03e5415f09aba881f13885" - req := &chart.Requirements{ - Dependencies: []*chart.Dependency{ - {Name: "alpine", Version: "0.1.0", Repository: "http://localhost:8879/charts"}, - }, + expect := "sha256:d661820b01ed7bcf26eed8f01cf16380e0a76326ba33058d3150f919d9b15bc0" + req := []*chart.Dependency{ + {Name: "alpine", Version: "0.1.0", Repository: "http://localhost:8879/charts"}, } h, err := HashReq(req) if err != nil { @@ -160,7 +144,7 @@ func TestHashReq(t *testing.T) { t.Errorf("Expected %q, got %q", expect, h) } - req = &chart.Requirements{Dependencies: []*chart.Dependency{}} + req = []*chart.Dependency{} h, err = HashReq(req) if err != nil { t.Fatal(err) diff --git a/pkg/urlutil/urlutil_test.go b/pkg/urlutil/urlutil_test.go index 9db7b9a7b..8e99c1bfb 100644 --- a/pkg/urlutil/urlutil_test.go +++ b/pkg/urlutil/urlutil_test.go @@ -65,8 +65,9 @@ func TestEqual(t *testing.T) { func TestExtractHostname(t *testing.T) { tests := map[string]string{ - "http://example.com": "example.com", - "https://example.com/foo": "example.com", + "http://example.com": "example.com", + "https://example.com/foo": "example.com", + "https://example.com:31337/not/with/a/bang/but/a/whimper": "example.com", } for start, expect := range tests {