-
Notifications
You must be signed in to change notification settings - Fork 43
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
Refactor/ordering #123
Refactor/ordering #123
Conversation
b5c19d9
to
148e0ce
Compare
@cyril-corbon @AdheipSingh ping 😄 |
@itamar-marom ill check this week. Thanks |
ill take this in the next release. Will test is locally once. |
func getNodeSpecsByOrder(m *v1alpha1.Druid) []*ServiceGroup { | ||
|
||
scaledServiceSpecsByNodeType := map[string][]*ServiceGroup{} | ||
for _, t := range druidServicesOrder { | ||
scaledServiceSpecsByNodeType[t] = []*ServiceGroup{} | ||
} | ||
|
||
for key, nodeSpec := range m.Spec.Nodes { | ||
scaledServiceSpec := scaledServiceSpecsByNodeType[nodeSpec.NodeType] | ||
scaledServiceSpecsByNodeType[nodeSpec.NodeType] = append(scaledServiceSpec, &ServiceGroup{key: key, spec: nodeSpec}) | ||
} | ||
|
||
allScaledServiceSpecs := make([]*ServiceGroup, 0, len(m.Spec.Nodes)) | ||
|
||
for _, t := range druidServicesOrder { | ||
allScaledServiceSpecs = append(allScaledServiceSpecs, scaledServiceSpecsByNodeType[t]...) | ||
} | ||
|
||
return allScaledServiceSpecs | ||
} |
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 is a very good refactor. We can now abstract the order in the CR but it will not be not backward compatible.
@itamar-marom if you can resolve this, we can merge it. |
I'll resolve this today/tomorrow and ping you |
ace20be
to
4d6fa37
Compare
4d6fa37
to
36614f2
Compare
@AdheipSingh ready |
* (ordering): refactor code * (ordering): refactor code * (ordering): testing * chore(branch): rebase branch with master * fix(tests): validate nodes order by regex
* Ingestion Controller (#53) * ingestion spec acc to v3 * task creation * supprt native batch * fix router url * revert license change * revert go mod change * fix main * fix: made some changes as per review comments * fix: removed unused package from ingestion reconciler * rebase 1 * add example * add review * update dockerfile --------- Co-authored-by: avtarOPS <[email protected]> * Update Docs and Tutorials (#138) * docs and tutorials * Refactor/ordering (#123) * (ordering): refactor code * (ordering): refactor code * (ordering): testing * chore(branch): rebase branch with master * fix(tests): validate nodes order by regex * Bump controller-tools version (#140) * Utilize the DruidIngestion controller in e2e tests (#146) * adds needed volumes to eks deployment spec and improves getting started documentation by noting minio dependency (#149) * Add support for annotations on Deployment/StatefulSet resources in DruidNodeSpec (#145) * Add support for annotations on Deployment/StatefulSet resources * Support setting ReplicationControllerAnnotations at the cluster-level * rename replicationControllerAnnotations to workloadAnnotations * suggestions from code review * Add support for multi tier nodes with different PVC sizes (#106) (#152) Co-authored-by: Farhad Farahi <[email protected]> * fix: put Druid crds in the appropriate folder specified by Helm (#162) Signed-off-by: ahmed.g <[email protected]> Signed-off-by: TessaIO <[email protected]> * Adds service account name to each druid node optionally (#164) * Adds service account to each druid node optionally * Use controller-gen v0.11.2 --------- Signed-off-by: ahmed.g <[email protected]> Signed-off-by: TessaIO <[email protected]> Co-authored-by: AdheipSingh <[email protected]> Co-authored-by: avtarOPS <[email protected]> Co-authored-by: Itamar Marom <[email protected]> Co-authored-by: Jesper Larsson <[email protected]> Co-authored-by: Sam Wheating <[email protected]> Co-authored-by: Evan Jones <[email protected]> Co-authored-by: Farhad Farahi <[email protected]> Co-authored-by: Farhad Farahi <[email protected]> Co-authored-by: Sadananda Aithal <[email protected]>
Description
Code refactoring to the ordering logic. Added also tests.
This PR has:
Key changed/added files in this PR
controllers/druid/handler.go
controllers/druid/ordering.go
controllers/druid/ordering_test.go