Repository: redhat-certification/chart-verifier
Pull request #77 (2021-04-19 13:23:38)

Include Helm like values options in verify command
This PR implements Helm like values options in the verify command, using the same 
semantics as Helm.

mmulholla: LGTM

Patch:
diff --git a/cmd/verify.go b/cmd/verify.go
index 9590cb0..da90dba 100644
--- a/cmd/verify.go
+++ b/cmd/verify.go
@@ -18,6 +18,9 @@ package cmd
 
 import (
 	"encoding/json"
+	"helm.sh/helm/v3/pkg/cli"
+	"helm.sh/helm/v3/pkg/cli/values"
+	"helm.sh/helm/v3/pkg/getter"
 
 	"github.com/pkg/errors"
 
@@ -81,8 +84,15 @@ func buildChecks(all, enabled, disabled []string) ([]string, error) {
 	}
 }
 
+// settings comes from Helm, to extract the same configuration values Helm uses.
+var settings = cli.New()
+
 // NewVerifyCmd creates ...
 func NewVerifyCmd(config *viper.Viper) *cobra.Command {
+
+	// opts contains command line options extracted from the environment.
+	opts := &values.Options{}
+
 	cmd := &cobra.Command{
 		Use:   "verify <chart-uri>",
 		Args:  cobra.ExactArgs(1),
@@ -93,8 +103,15 @@ func NewVerifyCmd(config *viper.Viper) *cobra.Command {
 				return err
 			}
 
+			// vals is a resulting map considering all the options the user has given.
+			vals, err := opts.MergeValues(getter.All(settings))
+			if err != nil {
+				return err
+			}
+
 			certifier, err := chartverifier.
 				NewCertifierBuilder().
+				SetValues(vals).
 				SetChecks(checks).
 				SetConfig(config).
 				SetOverrides(setOverridesFlag).
@@ -144,6 +161,14 @@ func NewVerifyCmd(config *viper.Viper) *cobra.Command {
 		},
 	}
 
+	cmd.Flags().StringSliceVarP(&opts.ValueFiles, "chart-values", "f", nil, "specify values in a YAML file or a URL (can specify multiple)")
+
+	cmd.Flags().StringSliceVarP(&opts.Values, "chart-set", "S", nil, "set values for the chart (can specify multiple or separate values with commas: key1=val1,key2=val2)")
+
+	cmd.Flags().StringSliceVarP(&opts.StringValues, "chart-set-string", "X", nil, "set STRING values for the chart (can specify multiple or separate values with commas: key1=val1,key2=val2)")
+
+	cmd.Flags().StringSliceVarP(&opts.FileValues, "chart-set-file", "F", nil, "set values from respective files specified via the command line (can specify multiple or separate values with commas: key1=path1,key2=path2)")
+
 	cmd.Flags().StringSliceVarP(&enabledChecksFlag, "enable", "e", nil, "only the informed checks will be enabled")
 
 	cmd.Flags().StringSliceVarP(&disabledChecksFlag, "disable", "x", nil, "all checks will be enabled except the informed ones")
diff --git a/pkg/chartverifier/certifier.go b/pkg/chartverifier/certifier.go
index 2af3009..60362d1 100644
--- a/pkg/chartverifier/certifier.go
+++ b/pkg/chartverifier/certifier.go
@@ -42,6 +42,7 @@ type certifier struct {
 	registry       checks.Registry
 	requiredChecks []string
 	toolVersion    string
+	values         map[string]interface{}
 }
 
 func (c *certifier) subConfig(name string) *viper.Viper {
@@ -71,7 +72,11 @@ func (c *certifier) Certify(uri string) (Certificate, error) {
 			return nil, CheckNotFoundErr(name)
 		}
 
-		r, err := checkFunc(uri, c.subConfig(name))
+		r, err := checkFunc(&checks.CheckOptions{
+			URI:    uri,
+			Config: c.subConfig(name),
+			Values: c.values,
+		})
 		if err != nil {
 			return nil, NewCheckErr(err)
 		}
diff --git a/pkg/chartverifier/certifierbuilder.go b/pkg/chartverifier/certifierbuilder.go
index df5adc3..0831a65 100644
--- a/pkg/chartverifier/certifierbuilder.go
+++ b/pkg/chartverifier/certifierbuilder.go
@@ -51,6 +51,12 @@ type certifierBuilder struct {
 	overrides   []string
 	registry    checks.Registry
 	toolVersion string
+	values      map[string]interface{}
+}
+
+func (b *certifierBuilder) SetValues(vals map[string]interface{}) CertifierBuilder {
+	b.values = vals
+	return b
 }
 
 func (b *certifierBuilder) SetRegistry(registry checks.Registry) CertifierBuilder {
@@ -102,6 +108,7 @@ func (b *certifierBuilder) Build() (Certifier, error) {
 		requiredChecks: b.checks,
 		config:         b.config,
 		toolVersion:    b.toolVersion,
+		values:         b.values,
 	}, nil
 }
 
diff --git a/pkg/chartverifier/checks/checks.go b/pkg/chartverifier/checks/checks.go
index 63be3a9..90ffac7 100644
--- a/pkg/chartverifier/checks/checks.go
+++ b/pkg/chartverifier/checks/checks.go
@@ -22,7 +22,6 @@ import (
 	"strings"
 
 	"github.com/pkg/errors"
-	"github.com/spf13/viper"
 	"helm.sh/helm/v3/pkg/lint"
 	"helm.sh/helm/v3/pkg/lint/support"
 
@@ -60,8 +59,8 @@ func notImplemented() (Result, error) {
 	return Result{Ok: false}, errors.New("not implemented")
 }
 
-func IsHelmV3(uri string, _ *viper.Viper) (Result, error) {
-	c, _, err := LoadChartFromURI(uri)
+func IsHelmV3(opts *CheckOptions) (Result, error) {
+	c, _, err := LoadChartFromURI(opts.URI)
 	if err != nil {
 		return Result{}, err
 	}
@@ -74,8 +73,8 @@ func IsHelmV3(uri string, _ *viper.Viper) (Result, error) {
 	return NewResult(isHelmV3, reason), nil
 }
 
-func HasReadme(uri string, _ *viper.Viper) (Result, error) {
-	c, _, err := LoadChartFromURI(uri)
+func HasReadme(opts *CheckOptions) (Result, error) {
+	c, _, err := LoadChartFromURI(opts.URI)
 	if err != nil {
 		return Result{}, err
 	}
@@ -90,8 +89,8 @@ func HasReadme(uri string, _ *viper.Viper) (Result, error) {
 	return r, nil
 }
 
-func ContainsTest(uri string, _ *viper.Viper) (Result, error) {
-	c, _, err := LoadChartFromURI(uri)
+func ContainsTest(opts *CheckOptions) (Result, error) {
+	c, _, err := LoadChartFromURI(opts.URI)
 	if err != nil {
 		return Result{}, err
 	}
@@ -109,8 +108,8 @@ func ContainsTest(uri string, _ *viper.Viper) (Result, error) {
 
 }
 
-func ContainsValues(uri string, _ *viper.Viper) (Result, error) {
-	c, _, err := LoadChartFromURI(uri)
+func ContainsValues(opts *CheckOptions) (Result, error) {
+	c, _, err := LoadChartFromURI(opts.URI)
 	if err != nil {
 		return Result{}, err
 	}
@@ -124,8 +123,8 @@ func ContainsValues(uri string, _ *viper.Viper) (Result, error) {
 	return r, nil
 }
 
-func ContainsValuesSchema(uri string, _ *viper.Viper) (Result, error) {
-	c, _, err := LoadChartFromURI(uri)
+func ContainsValuesSchema(opts *CheckOptions) (Result, error) {
+	c, _, err := LoadChartFromURI(opts.URI)
 	if err != nil {
 		return Result{}, err
 	}
@@ -139,20 +138,20 @@ func ContainsValuesSchema(uri string, _ *viper.Viper) (Result, error) {
 	return r, nil
 }
 
-func KeywordsAreOpenshiftCategories(uri string, _ *viper.Viper) (Result, error) {
+func KeywordsAreOpenshiftCategories(opts *CheckOptions) (Result, error) {
 	return notImplemented()
 }
 
-func IsCommercialChart(uri string, _ *viper.Viper) (Result, error) {
+func IsCommercialChart(opts *CheckOptions) (Result, error) {
 	return notImplemented()
 }
 
-func IsCommunityChart(uri string, _ *viper.Viper) (Result, error) {
+func IsCommunityChart(opts *CheckOptions) (Result, error) {
 	return notImplemented()
 }
 
-func HasMinKubeVersion(uri string, _ *viper.Viper) (Result, error) {
-	c, _, err := LoadChartFromURI(uri)
+func HasMinKubeVersion(opts *CheckOptions) (Result, error) {
+	c, _, err := LoadChartFromURI(opts.URI)
 	if err != nil {
 		return NewResult(false, err.Error()), err
 	}
@@ -166,8 +165,8 @@ func HasMinKubeVersion(uri string, _ *viper.Viper) (Result, error) {
 	return r, nil
 }
 
-func NotContainCRDs(uri string, _ *viper.Viper) (Result, error) {
-	c, _, err := LoadChartFromURI(uri)
+func NotContainCRDs(opts *CheckOptions) (Result, error) {
+	c, _, err := LoadChartFromURI(opts.URI)
 	if err != nil {
 		return NewResult(false, err.Error()), err
 	}
@@ -182,14 +181,14 @@ func NotContainCRDs(uri string, _ *viper.Viper) (Result, error) {
 	return r, nil
 }
 
-func HelmLint(uri string, _ *viper.Viper) (Result, error) {
-	c, p, err := LoadChartFromURI(uri)
+func HelmLint(opts *CheckOptions) (Result, error) {
+	c, p, err := LoadChartFromURI(opts.URI)
 	if err != nil {
 		return NewResult(false, err.Error()), err
 	}
 	r := NewResult(true, HelmLintSuccessful)
 	p = path.Join(p, c.Name())
-	linter := lint.All(p, map[string]interface{}{}, "default", false)
+	linter := lint.All(p, opts.Values, "default", false)
 	if linter.HighestSeverity > support.WarningSev {
 		reason := ""
 		for _, m := range linter.Messages {
@@ -200,12 +199,12 @@ func HelmLint(uri string, _ *viper.Viper) (Result, error) {
 	return r, nil
 }
 
-func NotContainsInfraPluginsAndDrivers(uri string, _ *viper.Viper) (Result, error) {
+func NotContainsInfraPluginsAndDrivers(opts *CheckOptions) (Result, error) {
 	return notImplemented()
 }
 
-func NotContainCSIObjects(uri string, _ *viper.Viper) (Result, error) {
-	c, _, err := LoadChartFromURI(uri)
+func NotContainCSIObjects(opts *CheckOptions) (Result, error) {
+	c, _, err := LoadChartFromURI(opts.URI)
 	if err != nil {
 		return Result{}, err
 	}
@@ -226,19 +225,19 @@ func NotContainCSIObjects(uri string, _ *viper.Viper) (Result, error) {
 	return r, nil
 }
 
-func CanBeInstalledWithoutManualPreRequisites(uri string, _ *viper.Viper) (Result, error) {
+func CanBeInstalledWithoutManualPreRequisites(opts *CheckOptions) (Result, error) {
 	return notImplemented()
 }
 
-func CanBeInstalledWithoutClusterAdminPrivileges(uri string, _ *viper.Viper) (Result, error) {
+func CanBeInstalledWithoutClusterAdminPrivileges(opts *CheckOptions) (Result, error) {
 	return notImplemented()
 }
 
-func ImagesAreCertified(uri string, _ *viper.Viper) (Result, error) {
+func ImagesAreCertified(opts *CheckOptions) (Result, error) {
 
 	r := NewResult(false, "")
 
-	images, err := getImageReferences(uri)
+	images, err := getImageReferences(opts.URI, opts.Values)
 
 	if err != nil {
 		r.SetResult(false, fmt.Sprintf("%s : Failed to get images : %v", ImageCertifyFailed, err))
diff --git a/pkg/chartverifier/checks/helm.go b/pkg/chartverifier/checks/helm.go
index fc72573..61725cc 100644
--- a/pkg/chartverifier/checks/helm.go
+++ b/pkg/chartverifier/checks/helm.go
@@ -187,7 +187,7 @@ func IsChartNotFound(err error) bool {
 	return ok
 }
 
-func getImageReferences(chartUri string) ([]string, error) {
+func getImageReferences(chartUri string, vals map[string]interface{}) ([]string, error) {
 
 	actionConfig := &action.Configuration{
 		Releases:     nil,
@@ -199,10 +199,9 @@ func getImageReferences(chartUri string) ([]string, error) {
 	mem.SetNamespace("TestNamespace")
 	actionConfig.Releases = storage.Init(mem)
 
-	var m map[string]interface{}
 	imagesMap := make(map[string]bool)
 
-	txt, err := actions.RenderManifests("testRelease", chartUri, m, actionConfig)
+	txt, err := actions.RenderManifests("testRelease", chartUri, vals, actionConfig)
 	if err != nil {
 		fmt.Printf("RenderManifests error : %v\n", err)
 	} else {
diff --git a/pkg/chartverifier/checks/registry.go b/pkg/chartverifier/checks/registry.go
index 2b6a58b..d03e344 100644
--- a/pkg/chartverifier/checks/registry.go
+++ b/pkg/chartverifier/checks/registry.go
@@ -48,7 +48,18 @@ func (r *Result) AddResult(outcome bool, reason string) Result {
 	return *r
 }
 
-type CheckFunc func(uri string, config *viper.Viper) (Result, error)
+// CheckOptions contains options collected from the environment a check can
+// consult to modify its behavior.
+type CheckOptions struct {
+	// URI is the location of the chart to be checked.
+	URI string
+	// Config is the configuration collected by Viper.
+	Config *viper.Viper
+	// Values contains the values informed by the user through command line options.
+	Values map[string]interface{}
+}
+
+type CheckFunc func(options *CheckOptions) (Result, error)
 
 type Registry interface {
 	Get(name string) (CheckFunc, bool)
diff --git a/pkg/chartverifier/helmcertifier.go b/pkg/chartverifier/helmcertifier.go
index cfdc24a..a0e448f 100644
--- a/pkg/chartverifier/helmcertifier.go
+++ b/pkg/chartverifier/helmcertifier.go
@@ -23,6 +23,7 @@ import (
 
 type CertifierBuilder interface {
 	SetRegistry(registry checks.Registry) CertifierBuilder
+	SetValues(vals map[string]interface{}) CertifierBuilder
 	SetChecks(checks []string) CertifierBuilder
 	SetConfig(config *viper.Viper) CertifierBuilder
 	SetOverrides([]string) CertifierBuilder


Test patch:
diff --git a/pkg/chartverifier/certifier_test.go b/pkg/chartverifier/certifier_test.go
index 5b5e857..6a94375 100644
--- a/pkg/chartverifier/certifier_test.go
+++ b/pkg/chartverifier/certifier_test.go
@@ -37,15 +37,15 @@ func TestCertifier_Certify(t *testing.T) {
 
 	dummyCheckName := "dummy-check"
 
-	erroredCheck := func(uri string, _ *viper.Viper) (checks.Result, error) {
+	erroredCheck := func(_ *checks.CheckOptions) (checks.Result, error) {
 		return checks.Result{}, errors.New("artificial error")
 	}
 
-	negativeCheck := func(uri string, _ *viper.Viper) (checks.Result, error) {
+	negativeCheck := func(_ *checks.CheckOptions) (checks.Result, error) {
 		return checks.Result{Ok: false}, nil
 	}
 
-	positiveCheck := func(uri string, _ *viper.Viper) (checks.Result, error) {
+	positiveCheck := func(_ *checks.CheckOptions) (checks.Result, error) {
 		return checks.Result{Ok: true}, nil
 	}
 
diff --git a/pkg/chartverifier/checks/checks_test.go b/pkg/chartverifier/checks/checks_test.go
index e963afc..8eb59bf 100644
--- a/pkg/chartverifier/checks/checks_test.go
+++ b/pkg/chartverifier/checks/checks_test.go
@@ -37,7 +37,7 @@ func TestIsHelmV3(t *testing.T) {
 	for _, tc := range positiveTestCases {
 		config := viper.New()
 		t.Run(tc.description, func(t *testing.T) {
-			r, err := IsHelmV3(tc.uri, config)
+			r, err := IsHelmV3(&CheckOptions{URI: tc.uri, Config: config})
 			require.NoError(t, err)
 			require.NotNil(t, r)
 			require.True(t, r.Ok)
@@ -52,7 +52,7 @@ func TestIsHelmV3(t *testing.T) {
 	for _, tc := range negativeTestCases {
 		config := viper.New()
 		t.Run(tc.description, func(t *testing.T) {
-			r, err := IsHelmV3(tc.uri, config)
+			r, err := IsHelmV3(&CheckOptions{URI: tc.uri, Config: config})
 			require.NoError(t, err)
 			require.NotNil(t, r)
 			require.False(t, r.Ok)
@@ -74,7 +74,7 @@ func TestHasReadme(t *testing.T) {
 	for _, tc := range positiveTestCases {
 		t.Run(tc.description, func(t *testing.T) {
 			config := viper.New()
-			r, err := HasReadme(tc.uri, config)
+			r, err := HasReadme(&CheckOptions{URI: tc.uri, Config: config})
 			require.NoError(t, err)
 			require.NotNil(t, r)
 			require.True(t, r.Ok)
@@ -89,7 +89,7 @@ func TestHasReadme(t *testing.T) {
 	for _, tc := range negativeTestCases {
 		t.Run(tc.description, func(t *testing.T) {
 			config := viper.New()
-			r, err := HasReadme(tc.uri, config)
+			r, err := HasReadme(&CheckOptions{URI: tc.uri, Config: config})
 			require.NoError(t, err)
 			require.NotNil(t, r)
 			require.False(t, r.Ok)
@@ -111,7 +111,7 @@ func TestContainsTest(t *testing.T) {
 	for _, tc := range positiveTestCases {
 		t.Run(tc.description, func(t *testing.T) {
 			config := viper.New()
-			r, err := ContainsTest(tc.uri, config)
+			r, err := ContainsTest(&CheckOptions{URI: tc.uri, Config: config})
 			require.NoError(t, err)
 			require.NotNil(t, r)
 			require.True(t, r.Ok)
@@ -126,7 +126,7 @@ func TestContainsTest(t *testing.T) {
 	for _, tc := range negativeTestCases {
 		t.Run(tc.description, func(t *testing.T) {
 			config := viper.New()
-			r, err := ContainsTest(tc.uri, config)
+			r, err := ContainsTest(&CheckOptions{URI: tc.uri, Config: config})
 			require.NoError(t, err)
 			require.NotNil(t, r)
 			require.False(t, r.Ok)
@@ -148,7 +148,7 @@ func TestHasValuesSchema(t *testing.T) {
 	for _, tc := range positiveTestCases {
 		t.Run(tc.description, func(t *testing.T) {
 			config := viper.New()
-			r, err := ContainsValuesSchema(tc.uri, config)
+			r, err := ContainsValuesSchema(&CheckOptions{URI: tc.uri, Config: config})
 			require.NoError(t, err)
 			require.NotNil(t, r)
 			require.True(t, r.Ok)
@@ -163,7 +163,7 @@ func TestHasValuesSchema(t *testing.T) {
 	for _, tc := range negativeTestCases {
 		t.Run(tc.description, func(t *testing.T) {
 			config := viper.New()
-			r, err := ContainsValuesSchema(tc.uri, config)
+			r, err := ContainsValuesSchema(&CheckOptions{URI: tc.uri, Config: config})
 			require.NoError(t, err)
 			require.NotNil(t, r)
 			require.False(t, r.Ok)
@@ -185,7 +185,7 @@ func TestHasValues(t *testing.T) {
 	for _, tc := range positiveTestCases {
 		t.Run(tc.description, func(t *testing.T) {
 			config := viper.New()
-			r, err := ContainsValues(tc.uri, config)
+			r, err := ContainsValues(&CheckOptions{URI: tc.uri, Config: config})
 			require.NoError(t, err)
 			require.NotNil(t, r)
 			require.True(t, r.Ok)
@@ -200,7 +200,7 @@ func TestHasValues(t *testing.T) {
 	for _, tc := range negativeTestCases {
 		t.Run(tc.description, func(t *testing.T) {
 			config := viper.New()
-			r, err := ContainsValues(tc.uri, config)
+			r, err := ContainsValues(&CheckOptions{URI: tc.uri, Config: config})
 			require.NoError(t, err)
 			require.NotNil(t, r)
 			require.False(t, r.Ok)
@@ -222,7 +222,7 @@ func TestHasMinKubeVersion(t *testing.T) {
 	for _, tc := range positiveTestCases {
 		t.Run(tc.description, func(t *testing.T) {
 			config := viper.New()
-			r, err := HasMinKubeVersion(tc.uri, config)
+			r, err := HasMinKubeVersion(&CheckOptions{URI: tc.uri, Config: config})
 			require.NoError(t, err)
 			require.NotNil(t, r)
 			require.True(t, r.Ok)
@@ -237,7 +237,7 @@ func TestHasMinKubeVersion(t *testing.T) {
 	for _, tc := range negativeTestCases {
 		t.Run(tc.description, func(t *testing.T) {
 			config := viper.New()
-			r, err := HasMinKubeVersion(tc.uri, config)
+			r, err := HasMinKubeVersion(&CheckOptions{URI: tc.uri, Config: config})
 			require.NoError(t, err)
 			require.NotNil(t, r)
 			require.False(t, r.Ok)
@@ -260,7 +260,7 @@ func TestNotContainCRDs(t *testing.T) {
 	for _, tc := range positiveTestCases {
 		t.Run(tc.description, func(t *testing.T) {
 			config := viper.New()
-			r, err := NotContainCRDs(tc.uri, config)
+			r, err := NotContainCRDs(&CheckOptions{URI: tc.uri, Config: config})
 			require.NoError(t, err)
 			require.NotNil(t, r)
 			require.True(t, r.Ok)
@@ -275,7 +275,7 @@ func TestNotContainCRDs(t *testing.T) {
 	for _, tc := range negativeTestCases {
 		t.Run(tc.description, func(t *testing.T) {
 			config := viper.New()
-			r, err := NotContainCRDs(tc.uri, config)
+			r, err := NotContainCRDs(&CheckOptions{URI: tc.uri, Config: config})
 			require.NoError(t, err)
 			require.NotNil(t, r)
 			require.False(t, r.Ok)
@@ -297,7 +297,7 @@ func TestNotContainCSIObjects(t *testing.T) {
 	for _, tc := range positiveTestCases {
 		t.Run(tc.description, func(t *testing.T) {
 			config := viper.New()
-			r, err := NotContainCSIObjects(tc.uri, config)
+			r, err := NotContainCSIObjects(&CheckOptions{URI: tc.uri, Config: config})
 			require.NoError(t, err)
 			require.NotNil(t, r)
 			require.True(t, r.Ok)
@@ -312,7 +312,7 @@ func TestNotContainCSIObjects(t *testing.T) {
 	for _, tc := range negativeTestCases {
 		t.Run(tc.description, func(t *testing.T) {
 			config := viper.New()
-			r, err := NotContainCSIObjects(tc.uri, config)
+			r, err := NotContainCSIObjects(&CheckOptions{URI: tc.uri, Config: config})
 			require.NoError(t, err)
 			require.NotNil(t, r)
 			require.False(t, r.Ok)
@@ -336,7 +336,7 @@ func TestHelmLint(t *testing.T) {
 	for _, tc := range positiveTestCases {
 		t.Run(tc.description, func(t *testing.T) {
 			config := viper.New()
-			r, err := HelmLint(tc.uri, config)
+			r, err := HelmLint(&CheckOptions{URI: tc.uri, Config: config})
 			require.NoError(t, err)
 			require.NotNil(t, r)
 			require.True(t, r.Ok)
@@ -351,7 +351,7 @@ func TestHelmLint(t *testing.T) {
 	for _, tc := range negativeTestCases {
 		t.Run(tc.description, func(t *testing.T) {
 			config := viper.New()
-			r, err := HelmLint(tc.uri, config)
+			r, err := HelmLint(&CheckOptions{URI: tc.uri, Config: config})
 			require.NoError(t, err)
 			require.NotNil(t, r)
 			require.False(t, r.Ok)
@@ -378,7 +378,7 @@ func TestImageCertify(t *testing.T) {
 	for _, tc := range negativeTestCases {
 		t.Run(tc.description, func(t *testing.T) {
 			config := viper.New()
-			r, err := ImagesAreCertified(tc.uri, config)
+			r, err := ImagesAreCertified(&CheckOptions{URI: tc.uri, Config: config})
 			require.NoError(t, err)
 			require.NotNil(t, r)
 			require.False(t, r.Ok)
diff --git a/pkg/chartverifier/checks/helm_test.go b/pkg/chartverifier/checks/helm_test.go
index a5d238a..50acf86 100644
--- a/pkg/chartverifier/checks/helm_test.go
+++ b/pkg/chartverifier/checks/helm_test.go
@@ -95,7 +95,7 @@ func TestTemplate(t *testing.T) {
 
 	for _, tc := range TestCases {
 		t.Run(tc.description, func(t *testing.T) {
-			images, err := getImageReferences(tc.uri)
+			images, err := getImageReferences(tc.uri, map[string]interface{}{})
 			require.NoError(t, err)
 			require.Equal(t, len(images), len(tc.images))
 			for i := 0; i < len(tc.images); i++ {