-
Notifications
You must be signed in to change notification settings - Fork 5
Add basic committed resource functionality with reservations #566
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
Changes from all commits
561bab9
41e7382
577f17f
fb484c3
add0241
bf34c77
3bacb45
a5df4d2
c6edc6c
a5db69c
11bcaa8
c977d64
cee972a
0d3705b
79ae87a
d6c7ad4
4eb3261
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 |
|---|---|---|
| @@ -1 +1 @@ | ||
| * arno.uhlig@sap.com julius.clausnitzer@sap.com malte.viering@sap.com marcel.bloecher@sap.com markus.wieland@sap.com p.matthes@sap.com | ||
| * arno.uhlig@sap.com julius.clausnitzer@sap.com malte.viering@sap.com marcel.gute@sap.com markus.wieland@sap.com p.matthes@sap.com |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,7 +8,7 @@ owner-info: | |
| - "arno.uhlig@sap.com" | ||
| - "julius.clausnitzer@sap.com" | ||
| - "malte.viering@sap.com" | ||
| - "marcel.bloecher@sap.com" | ||
| - "marcel.gute@sap.com" | ||
| - "markus.wieland@sap.com" | ||
| - "p.matthes@sap.com" | ||
| support-group: "workload-management" | ||
|
|
@@ -114,8 +114,12 @@ cortex-scheduling-controllers: | |
| - nova-pipeline-controllers | ||
| - nova-deschedulings-executor | ||
| - explanation-controller | ||
| - reservations-controller | ||
| enabledTasks: | ||
| - nova-decisions-cleanup-task | ||
| # Endpoints configuration for reservations controller | ||
| endpoints: | ||
| novaExternalScheduler: "http://localhost:8080/scheduler/nova/external" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This would call localhost, as in the container itself, right? This works as long as the scheduling controllers are initialized within the same pod. Maybe we can make this more robust by 1. adding a comment indicating this dependency or 2. using kubernetes dns to resolve to the correct service, something like |
||
|
|
||
| cortex-knowledge-controllers: | ||
| <<: *cortex | ||
|
|
@@ -134,7 +138,6 @@ cortex-knowledge-controllers: | |
| - datasource-controllers | ||
| - knowledge-controllers | ||
| - kpis-controller | ||
| - reservations-controller | ||
| enabledTasks: | ||
| - commitments-sync-task | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,8 @@ package extractor | |
|
|
||
| import ( | ||
| "context" | ||
| "encoding/json" | ||
| "reflect" | ||
| "time" | ||
|
|
||
| "github.com/cobaltcore-dev/cortex/api/v1alpha1" | ||
|
|
@@ -202,9 +204,27 @@ func (r *KnowledgeReconciler) Reconcile(ctx context.Context, req ctrl.Request) ( | |
| Reason: "KnowledgeExtracted", | ||
| Message: "knowledge extracted successfully", | ||
| }) | ||
|
|
||
| // Check if content actually changed by comparing deserialized data structures. | ||
| // This avoids false positives from JSON serialization non-determinism (e.g., map key ordering). | ||
| contentChanged := true | ||
| if len(knowledge.Status.Raw.Raw) > 0 { | ||
| var oldData, newData interface{} | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You should use |
||
| if err := json.Unmarshal(knowledge.Status.Raw.Raw, &oldData); err == nil { | ||
| if err := json.Unmarshal(raw.Raw, &newData); err == nil { | ||
| contentChanged = !reflect.DeepEqual(oldData, newData) | ||
| } | ||
| } | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is cool. I recently stumbled across
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice pointer, but lacks the same issue that content changes are detected but there was none, so false positives. |
||
| } | ||
|
|
||
| knowledge.Status.Raw = raw | ||
| knowledge.Status.LastExtracted = metav1.NewTime(time.Now()) | ||
| knowledge.Status.RawLength = len(features) | ||
|
|
||
| if contentChanged { | ||
| log.Info("content of knowledge has changed", "name", knowledge.Name) | ||
| knowledge.Status.LastContentChange = metav1.NewTime(time.Now()) | ||
| } | ||
| patch := client.MergeFrom(old) | ||
| if err := r.Status().Patch(ctx, knowledge, patch); err != nil { | ||
| log.Error(err, "failed to patch knowledge status") | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.