-
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 1 commit
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 |
|---|---|---|
|
|
@@ -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.
Probably instead of allow only any service we might want to migrate any kustomize scaffolds, but I think it is the case already. So, could we please check because as it is now I think we are already creating the Helm Chart with all that is in the kustomize install.yaml if not then I think we need a more generic solution. WDYT?
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.
Thanks for the clarification — I agree.
After rechecking, we’re not currently porting all resources from install.yaml into the Helm chart; only explicitly handled kinds are included, while others are silently ignored.
I agree that adding support only for generic Services creates inconsistent behavior if other resource kinds are still dropped. A generic mechanism to port any non-scaffolded resource would be cleaner than special-casing Services.
I’m happy to refactor this toward a generic solution if that aligns with the project direction. Please let me know how you’d like to proceed.
Uh oh!
There was an error while loading. Please reload this page.
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 idea gave for the folk that report this one to add all others one in a generic dir like others might be fit.
I think we may can:
Something like might be a good approach
open to ideas and suggestions as well