-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Include generic Services in Helm v2-alpha chart generation #5256
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,34 @@ | ||||||
| package kustomize_test | ||||||
|
||||||
| package kustomize_test | |
| package kustomize |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -83,6 +83,12 @@ func (o *ResourceOrganizer) OrganizeByFunction() map[string][]*unstructured.Unst | |
| groups["other"] = o.resources.Other | ||
| } | ||
|
|
||
| // Generic Services - Services that are neither webhook nor metrics | ||
| genericServices := o.collectGenericServices() | ||
| if len(genericServices) > 0 { | ||
| groups["services"] = genericServices | ||
| } | ||
|
|
||
| return groups | ||
| } | ||
|
|
||
|
|
@@ -150,6 +156,18 @@ func (o *ResourceOrganizer) collectMetricsResources() []*unstructured.Unstructur | |
| return metricsResources | ||
| } | ||
|
|
||
| // collectGenericServices gathers all other service resources | ||
| func (o *ResourceOrganizer) collectGenericServices() []*unstructured.Unstructured { | ||
| var generic []*unstructured.Unstructured | ||
|
|
||
| for _, service := range o.resources.Services { | ||
| if o.isGenericService(service) { | ||
| generic = append(generic, service) | ||
| } | ||
| } | ||
| return generic | ||
| } | ||
|
Comment on lines
+159
to
+169
|
||
|
|
||
| // collectPrometheusResources gathers prometheus related resources | ||
| func (o *ResourceOrganizer) collectPrometheusResources() []*unstructured.Unstructured { | ||
| var prometheusResources []*unstructured.Unstructured | ||
|
|
@@ -171,3 +189,9 @@ func (o *ResourceOrganizer) isMetricsService(service *unstructured.Unstructured) | |
| serviceName := service.GetName() | ||
| return strings.Contains(serviceName, "metrics") | ||
| } | ||
|
|
||
| // isGenericService determines if a service is a generic service to | ||
| // include all remaining Services that are not webhook or metrics | ||
| func (o *ResourceOrganizer) isGenericService(service *unstructured.Unstructured) bool { | ||
| return !o.isWebhookService(service) && !o.isMetricsService(service) | ||
| } | ||
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.
The test file is missing the Apache 2.0 copyright header that is present in all other test files in this directory. All test files in this package (suite_test.go, parser_test.go, chart_converter_test.go, helm_templater_test.go) include the standard copyright notice.