Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add --values flag to local install command #39

Merged
merged 2 commits into from
Jun 18, 2024

Conversation

colesnodgrass
Copy link
Member

Adds the ability to specify an (optional) values file to be used when running the helm install command.

abctl local install --values=path/to/values.yml

Verified that the underlying helm client we're using will merge the values.yml contents and the value's options values together:

// GetValuesMap returns the merged mapped out values of a chart,
// using both ValuesYaml and ValuesOptions
func (spec *ChartSpec) GetValuesMap(p getter.Providers) (map[string]interface{}, error) {
	valuesYaml := map[string]interface{}{}

	err := yaml.Unmarshal([]byte(spec.ValuesYaml), &valuesYaml)
	if err != nil {
		return nil, errors.Wrap(err, "Failed to Parse ValuesYaml")
	}

	valuesOptions, err := spec.ValuesOptions.MergeValues(p)
	if err != nil {
		return nil, errors.Wrap(err, "Failed to Parse ValuesOptions")
	}

	return values.MergeMaps(valuesYaml, valuesOptions), nil
}

@colesnodgrass colesnodgrass requested a review from a team June 17, 2024 23:58
@colesnodgrass colesnodgrass merged commit 60582fc into main Jun 18, 2024
2 checks passed
@colesnodgrass colesnodgrass deleted the cole/add-values-flag branch June 18, 2024 00:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants