Skip to content

feat: common labels for all releases in a helmfile - #1415

Merged
mumoshu merged 2 commits into
roboll:masterfrom
mlushpenko:common-release-labels
Aug 29, 2020
Merged

mumoshu merged 2 commits into
roboll:masterfrom
mlushpenko:common-release-labels

Conversation

@mlushpenko

Copy link
Copy Markdown
Contributor

This adds comonLabels option to helmfile by:

  • Adding CommonLabels to HelmState
  • Changing markExcludedReleases and ListReleases functions to merge common labels into release labels

Resolves #1266

This adds `comonLabels` option to helmfile by:

- Adding `CommonLabels` to HelmState
- Changing `markExcludedReleases` and `ListReleases` functions to merge common labels into release labels

Resolves roboll#1266
@mlushpenko

Copy link
Copy Markdown
Contributor Author

That's not enough, I've just noticed this error:

"../values/{{ .Release.Labels.customer }}/{{ .Release.Name }}.yaml": template: stringTemplate:1:21: executing "stringTemplate" at <.Release.Labels.customer>: map has no entry for key "customer"

@mlushpenko

Copy link
Copy Markdown
Contributor Author

I think it's good now, @mumoshu please let me know if I need to do anything else

@mlushpenko

Copy link
Copy Markdown
Contributor Author

Hi, @mumoshu, welcome back (I guess you were on vacation). Any chance this can be merged soon? We have quite a few customer files to refactor :)

@mumoshu mumoshu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@mlushpenko LGTM. Sorry for the silence and thanks for the pull request 👍

Also, I very much appreciate the great addition to the doc. Interesting use-case!

@mumoshu
mumoshu merged commit 5ca7ce1 into roboll:master Aug 29, 2020
@mlushpenko

Copy link
Copy Markdown
Contributor Author

Refactoring is done, thanks for merging!
image

@mumoshu

mumoshu commented Sep 1, 2020

Copy link
Copy Markdown
Collaborator

FYI the test sometimes fail like this:

=== RUN   TestList
testfs: recognized dir: /path/to/helmfile.d
testfs: recognized dir: /path/to
testfs: recognized dir: /path
testfs: recognized dir: /
    TestList: app_test.go:4110: assertion failed: 
        --- expected
        +++ out
        @@ -1,4 +1,4 @@
         NAME      	NAMESPACE	ENABLED	LABELS                    
        -myrelease1	         	false  	common:label,id:myrelease1
        +myrelease1	         	false  	id:myrelease1,common:label
         myrelease2	         	true   	common:label              
         myrelease3	         	true   	                          
        
--- FAIL: TestList (0.07s)

This should be due to that ranging over go map keys don't preserve ordering. I'll submit a follow-up asap.

mumoshu added a commit that referenced this pull request Sep 1, 2020
@mumoshu

mumoshu commented Sep 1, 2020

Copy link
Copy Markdown
Collaborator

See #1449

mumoshu added a commit that referenced this pull request Sep 1, 2020
@mlushpenko

Copy link
Copy Markdown
Contributor Author

Nice, thanks! I did see it but thought it was some error with spacing.

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.

[Feature] common labels for releases

2 participants