Skip to content
This repository has been archived by the owner on Mar 24, 2023. It is now read-only.

Fix empty value for env in helm values #790

Merged
merged 7 commits into from
Jan 9, 2019

Conversation

Rob0h
Copy link
Contributor

@Rob0h Rob0h commented Jan 8, 2019

What I Did

Fix #777

How I Did it

  • Change env value to be replaced with an empty slice
  • Remove SaveToState from asset in default init lifecycle

How to verify it

  • Test changes, Integration
  • kubectl apply -f rendered.yaml

Description for the Changelog

Fix empty value for env in helm values

Picture of a Boat (not required but encouraged)

🛶

@@ -106,8 +106,7 @@ func (r *Resolver) DefaultHelmRelease(chartPath string, upstream string) api.Spe
ChartRoot: chartPath,
},
ValuesFrom: &api.ValuesFrom{
Path: constants.ShipPathInternalTmp,
SaveToState: true,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removing this is as helm values are saved during the helm values step

@Rob0h Rob0h requested a review from laverya January 8, 2019 23:24
@laverya
Copy link
Member

laverya commented Jan 9, 2019

Could you verify that this doesn't cause a regression on the helm-stable charts?

You'll need to run this:

for chart in `ls $GOPATH/src/github.com/helm/charts/stable`; do rm -rf .ship installer base; $GOPATH/src/github.com/replicatedhq/ship/bin/ship init --headless github.com/helm/charts/stable/$chart --prefer-git; echo stable/$chart "," $? >> /tmp/env-slice-check-chart-results.txt; done

from an empty directory, with the helm/charts repo in your gopath, with both upstream ship and with your change

It's not part of the automated test suite yet, I'm afraid

Copy link
Member

@laverya laverya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One simplification comment, but lgtm given that the set of failing charts is the same

@@ -539,7 +539,7 @@ func fixLines(lines []string) []string {
// line has `env:` and nothing else but whitespace
if !checkIsChild(line, nextLine(idx, lines)) {
// next line is not a child, so env has no contents, add an empty object
lines[idx] = line + " {}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer for you to delete this block entirely and modify arrayLineRegex (line 63) to include env

@laverya
Copy link
Member

laverya commented Jan 9, 2019

One final thing - should we add an integration test for the current kibana helm chart? Since that's what led to #777 being opened

@Rob0h Rob0h merged commit 9f9fe11 into replicatedhq:master Jan 9, 2019
@Rob0h Rob0h deleted the fix/empty-values branch January 9, 2019 18:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants