Merge pull request #6106 from hickeyma/upd-scaffold-api-ver

Feat(*): Update scaffold chart to v2 apiVersion
pull/6118/head
Martin Hickey 5 years ago committed by GitHub
commit 8e7905c7a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -81,7 +81,7 @@ func (o *createOptions) run(out io.Writer) error {
Type: "application", Type: "application",
Version: "0.1.0", Version: "0.1.0",
AppVersion: "0.1.0", AppVersion: "0.1.0",
APIVersion: chart.APIVersionV1, APIVersion: chart.APIVersionV2,
} }
if o.starter != "" { if o.starter != "" {

@ -55,7 +55,7 @@ func TestCreateCmd(t *testing.T) {
if c.Name() != cname { if c.Name() != cname {
t.Errorf("Expected %q name, got %q", cname, c.Name()) t.Errorf("Expected %q name, got %q", cname, c.Name())
} }
if c.Metadata.APIVersion != chart.APIVersionV1 { if c.Metadata.APIVersion != chart.APIVersionV2 {
t.Errorf("Wrong API version: %q", c.Metadata.APIVersion) t.Errorf("Wrong API version: %q", c.Metadata.APIVersion)
} }
} }
@ -106,7 +106,7 @@ func TestCreateStarterCmd(t *testing.T) {
if c.Name() != cname { if c.Name() != cname {
t.Errorf("Expected %q name, got %q", cname, c.Name()) t.Errorf("Expected %q name, got %q", cname, c.Name())
} }
if c.Metadata.APIVersion != chart.APIVersionV1 { if c.Metadata.APIVersion != chart.APIVersionV2 {
t.Errorf("Wrong API version: %q", c.Metadata.APIVersion) t.Errorf("Wrong API version: %q", c.Metadata.APIVersion)
} }
@ -177,7 +177,7 @@ func TestCreateStarterAbsoluteCmd(t *testing.T) {
if c.Name() != cname { if c.Name() != cname {
t.Errorf("Expected %q name, got %q", cname, c.Name()) t.Errorf("Expected %q name, got %q", cname, c.Name())
} }
if c.Metadata.APIVersion != chart.APIVersionV1 { if c.Metadata.APIVersion != chart.APIVersionV2 {
t.Errorf("Wrong API version: %q", c.Metadata.APIVersion) t.Errorf("Wrong API version: %q", c.Metadata.APIVersion)
} }

@ -18,6 +18,9 @@ package chart
// APIVersionV1 is the API version number for version 1. // APIVersionV1 is the API version number for version 1.
const APIVersionV1 = "v1" const APIVersionV1 = "v1"
// APIVersionV1 is the API version number for version 2.
const APIVersionV2 = "v2"
// Chart is a helm package that contains metadata, a default config, zero or more // Chart is a helm package that contains metadata, a default config, zero or more
// optionally parameterizable templates, and zero or more charts (dependencies). // optionally parameterizable templates, and zero or more charts (dependencies).
type Chart struct { type Chart struct {

@ -53,7 +53,7 @@ const (
HelpersName = "_helpers.tpl" HelpersName = "_helpers.tpl"
) )
const defaultChartfile = `apiVersion: v1 const defaultChartfile = `apiVersion: v2
name: %s name: %s
description: A Helm chart for Kubernetes description: A Helm chart for Kubernetes

Loading…
Cancel
Save