Skip to content

Commit

Permalink
Using helm release options and default capabilities
Browse files Browse the repository at this point in the history
  • Loading branch information
bdun1013 committed Mar 4, 2020
1 parent 903b80e commit ade74d2
Showing 1 changed file with 7 additions and 20 deletions.
27 changes: 7 additions & 20 deletions unittest/test_job.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,12 @@ func (s *orderedSnapshotComparer) CompareToSnapshot(content interface{}) *snapsh

// TestJob definition of a test, including values and assertions
type TestJob struct {
Name string `yaml:"it"`
Values []string
Set map[string]interface{}
Assertions []*Assertion `yaml:"asserts"`
Release struct {
Name string
Namespace string
Revision int
IsUpgrade bool
}
Capabilities struct {
APIVersions []string
}
Name string `yaml:"it"`
Values []string
Set map[string]interface{}
Assertions []*Assertion `yaml:"asserts"`
Release chartutil.ReleaseOptions
Capabilities chartutil.Capabilities
// route indicate which chart in the dependency hierarchy
// like "parant-chart", "parent-charts/charts/child-chart"
chartRoute string
Expand Down Expand Up @@ -164,13 +157,7 @@ func (t *TestJob) releaseOption() *chartutil.ReleaseOptions {
// get chartutil.CapabilityOptions ready for render
// Only supports APIVersions for now
func (t *TestJob) capabilityOption() *chartutil.Capabilities {
options := chartutil.Capabilities{APIVersions: chartutil.DefaultVersionSet}
if len(t.Capabilities.APIVersions) > 0 {
var arr []string
arr = append(t.Capabilities.APIVersions, "v1")
options.APIVersions = chartutil.VersionSet(arr)
}
return &options
return chartutil.DefaultCapabilities
}

// parse rendered manifest if it's yaml
Expand Down

0 comments on commit ade74d2

Please sign in to comment.