Skip to content

Commit

Permalink
update helm default chart name and namespace values (#589)
Browse files Browse the repository at this point in the history
- this changes the helm chart default name/namespace values to match a default deployment of a given helm chart
  • Loading branch information
Willie authored Mar 31, 2021
1 parent a30788a commit 538b9ed
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 4 additions & 2 deletions pkg/iac-providers/helm/v3/load-dir.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ func (h *HelmV3) createHelmChartResource(chartPath string, chartData map[string]
// renderChart renders a helm chart with the given template files and values
// returns and IaC document for each rendered file
func (h *HelmV3) renderChart(chartPath string, chartMap helmChartData, templateDir string, templateFiles []*string, valueMap map[string]interface{}) ([]*utils.IacDocument, error) {
const defaultNamespaceName = "default"

iacDocuments := make([]*utils.IacDocument, 0)
logger := zap.S().With("helm chart path", chartPath)

Expand Down Expand Up @@ -195,8 +197,8 @@ func (h *HelmV3) renderChart(chartPath string, chartMap helmChartData, templateD

// create rendered values
options := chartutil.ReleaseOptions{
Name: defaultChartName,
Namespace: chartName + "-namespace",
Name: chartName,
Namespace: defaultNamespaceName,
}

v, err := chartutil.ToRenderValues(c, valueMap, options, nil)
Expand Down
1 change: 0 additions & 1 deletion pkg/iac-providers/helm/v3/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ type HelmV3 struct{}
type helmChartData map[string]interface{}

const (
defaultChartName = "terrascan"
helmValuesFilename = "values.yaml"
helmTemplateDir = "templates"
helmTestDir = "tests"
Expand Down

0 comments on commit 538b9ed

Please sign in to comment.