Skip to content

Commit 786239c

Browse files
committed
fix: postgres failures
Signed-off-by: Tanisha goyal <[email protected]>
1 parent 662cd89 commit 786239c

File tree

11 files changed

+45
-26
lines changed

11 files changed

+45
-26
lines changed

data-models/pkg/protos/health_event.pb.go

Lines changed: 15 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

data-models/protobufs/health_event.proto

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ message HealthEvents {
3333
// EXECUTE_REMEDIATION: normal behavior; downstream modules may update cluster state.
3434
// STORE_ONLY: observability-only behavior; event should be persisted/exported but should not modify cluster resources.
3535
enum ProcessingStrategy {
36-
EXECUTE_REMEDIATION = 0;
37-
STORE_ONLY = 1;
36+
UNSPECIFIED = 0;
37+
EXECUTE_REMEDIATION = 1;
38+
STORE_ONLY = 2;
3839
}
3940

4041
enum RecommendedAction {

health-monitors/csp-health-monitor/pkg/triggerengine/trigger.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,9 @@ func (e *Engine) mapMaintenanceEventToHealthEvent(
359359
Metadata: event.Metadata, // Pass along metadata
360360
NodeName: event.NodeName, // K8s node name
361361
GeneratedTimestamp: timestamppb.New(time.Now()),
362+
// TODO: Remove hardcoded processing strategy and make it configurable via the config file.
363+
// PR: https://github.com/NVIDIA/NVSentinel/pull/641
364+
ProcessingStrategy: pb.ProcessingStrategy_EXECUTE_REMEDIATION,
362365
}
363366

364367
return healthEvent, nil

health-monitors/csp-health-monitor/pkg/triggerengine/trigger_test.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,9 @@ func TestMapMaintenanceEventToHealthEvent(t *testing.T) {
240240
EntitiesImpacted: []*pb.Entity{
241241
{EntityType: "gce_instance", EntityValue: "instance-123"},
242242
},
243-
Metadata: map[string]string{"key": "value"},
244-
NodeName: "node-a",
243+
Metadata: map[string]string{"key": "value"},
244+
NodeName: "node-a",
245+
ProcessingStrategy: pb.ProcessingStrategy_EXECUTE_REMEDIATION,
245246
},
246247
},
247248
{
@@ -268,7 +269,8 @@ func TestMapMaintenanceEventToHealthEvent(t *testing.T) {
268269
EntitiesImpacted: []*pb.Entity{
269270
{EntityType: "EC2", EntityValue: "i-abcdef"},
270271
},
271-
NodeName: "node-b",
272+
NodeName: "node-b",
273+
ProcessingStrategy: pb.ProcessingStrategy_EXECUTE_REMEDIATION,
272274
},
273275
},
274276
{
@@ -331,7 +333,8 @@ func TestMapMaintenanceEventToHealthEvent(t *testing.T) {
331333
EntitiesImpacted: []*pb.Entity{
332334
{EntityType: "gce_instance", EntityValue: "instance-789"},
333335
},
334-
NodeName: "node-e",
336+
NodeName: "node-e",
337+
ProcessingStrategy: pb.ProcessingStrategy_EXECUTE_REMEDIATION,
335338
},
336339
},
337340
}

health-monitors/gpu-health-monitor/gpu_health_monitor/protos/health_event_pb2.py

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

health-monitors/gpu-health-monitor/gpu_health_monitor/protos/health_event_pb2.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ DESCRIPTOR: _descriptor.FileDescriptor
1313

1414
class ProcessingStrategy(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
1515
__slots__ = ()
16+
UNSPECIFIED: _ClassVar[ProcessingStrategy]
1617
EXECUTE_REMEDIATION: _ClassVar[ProcessingStrategy]
1718
STORE_ONLY: _ClassVar[ProcessingStrategy]
1819

@@ -28,6 +29,7 @@ class RecommendedAction(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
2829
RUN_DCGMEUD: _ClassVar[RecommendedAction]
2930
UNKNOWN: _ClassVar[RecommendedAction]
3031

32+
UNSPECIFIED: ProcessingStrategy
3133
EXECUTE_REMEDIATION: ProcessingStrategy
3234
STORE_ONLY: ProcessingStrategy
3335
NONE: RecommendedAction

store-client/pkg/datastore/providers/postgresql/sql_filter_builder.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,7 @@ var fieldNameMapping = map[string]string{
401401
"faultremediated": "faultremediated",
402402
"status": "status",
403403
"message": "message",
404+
"processingstrategy": "processingStrategy",
404405
}
405406

406407
// isOperationTypeField checks if the field is the operationType field.

tests/data/fatal-health-event.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@
1616
"entityValue": "0"
1717
}
1818
],
19-
"nodeName": "NODE_NAME"
19+
"nodeName": "NODE_NAME",
20+
"processingStrategy": 1
2021
}

tests/data/healthy-event.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@
1616
"entityValue": "0"
1717
}
1818
],
19-
"nodeName": "NODE_NAME"
19+
"nodeName": "NODE_NAME",
20+
"processingStrategy": 1
2021
}

tests/data/unsupported-health-event.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@
1616
"entityValue": "0"
1717
}
1818
],
19-
"nodeName": "NODE_NAME"
19+
"nodeName": "NODE_NAME",
20+
"processingStrategy": 1
2021
}

0 commit comments

Comments
 (0)