-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Support to override helm release name #1682
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, great unit tests.
I'd like to understand what happens when you change the name of the release. I think that @jessesuen mentions this in the original issue.
Can I ask for an e2e test (test/e2e/helm_test.go
)?
Alex
@@ -113,6 +113,8 @@ type ApplicationSourceHelm struct { | |||
ValueFiles []string `json:"valueFiles,omitempty" protobuf:"bytes,1,opt,name=valueFiles"` | |||
// Parameters are parameters to the helm template | |||
Parameters []HelmParameter `json:"parameters,omitempty" protobuf:"bytes,2,opt,name=parameters"` | |||
// The Helm release name. If omitted it will use the application name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
@@ -124,7 +126,7 @@ type HelmParameter struct { | |||
} | |||
|
|||
func (h *ApplicationSourceHelm) IsZero() bool { | |||
return len(h.ValueFiles) == 0 && len(h.Parameters) == 0 | |||
return (h.ReleaseName == "") && len(h.ValueFiles) == 0 && len(h.Parameters) == 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good work - easy to overlook
@alexec Regarding the change of the release name, because argo-cd now injects the label: An example would be the sealed-secret chart from helm/stable. Their deployment uses the A possible fix would be to use a different label for argo-cd, like it was used before the PR 857. So I can add the e2e test, but I guess we need to decide for the additional fix first. |
I've approved, but you need to resolve the merge conflict. I think users would appreciate a paragraph or tow |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs git merge master
. Also docs.
Please read my comments about the error detection here: Basically, I think we either need to have chart dependent erroring, or we don't error at all. |
Field releaseName added to the application crd On the cli the flag is release-name Unit tests to check release name is overriden
@alexec |
Is the fact that codegen is failing a problem? I did add the releaseName under helm, so there are changes to the crds and protobuf. But I also saw some additional changes after I ran I checked the contributing guide, but that didn't mention if we should run the |
``` | ||
|
||
```diff | ||
- Important notice on overriding the release name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor - you can use a !!! warning
admonition block here, see https://squidfunk.github.io/mkdocs-material/extensions/admonition/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure admonition extension works on Github, I just tried on a separate repo to display an warning and it didn't work. Maybe I am missing something?
```diff | ||
- Important notice on overriding the release name | ||
``` | ||
Please not that overriding the Helm release name might cause problems when the chart you are deploying is using the `app.kubernetes.io/instance` label. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great stuff
@@ -123,3 +123,39 @@ func TestHelmDependencyBuild(t *testing.T) { | |||
_, err = h.Template("wordpress", "", nil) | |||
assert.NoError(t, err) | |||
} | |||
|
|||
func TestHelmTemplateReleaseNameOverwrite(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
excellent
I should update the PR template. You should run This has been a pain for other people, so let me know that' the, and I'll take 15m to sort it out for you. |
Yes, it could be the versions of those tools. On the other hand I was looking at that codegen step that fails and it is somehow normal because I did add the releaseName parameter that went into What is not normal and I don't understand yet is why both yaml crd have so many changes and this might be because of tool versions. Here I am still checking the versions in the CI and compare with what I have. On the |
I've merged and I'll fix quickly locally. |
Description of the change
Field releaseName added to the application crd under helm
On the cli the flag is release-name
Unit tests to check release name is overriden
Benefits
When working with a centralised ArgoCD, the application names will have names based on cluster names and this will make the resources deployed not to be identical in different clusters. For example a redis service will have different names on different clusters because of different release names which will make it hard to be identified. This feature allows the release name to be overridden, so it will not be connected to the application name.
Closes #1066