Skip to content

Commit ca69902

Browse files
committed
chore: minor changes
Signed-off-by: Tanisha goyal <tanishag@nvidia.com>
1 parent d314731 commit ca69902

3 files changed

Lines changed: 4 additions & 11 deletions

File tree

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

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

371368
return healthEvent, nil

tests/csp_health_monitor_test.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -460,9 +460,6 @@ func TestCSPHealthMonitorStoreOnlyProcessingStrategy(t *testing.T) {
460460
feature.Assess("Injecting PENDING maintenance event and verifying node was not cordoned when processing STORE_ONLY strategy", func(ctx context.Context, t *testing.T, c *envconf.Config) context.Context {
461461
t.Log("Injecting GCP maintenance event with PENDING status into mock Cloud Logging API")
462462

463-
t.Logf("verify if pod has correct strategy configured")
464-
time.Sleep(20 * time.Second)
465-
466463
scheduledStart := time.Now().Add(15 * time.Minute)
467464
scheduledEnd := time.Now().Add(75 * time.Minute)
468465
event := helpers.CSPMaintenanceEvent{
@@ -505,9 +502,8 @@ func TestCSPHealthMonitorStoreOnlyProcessingStrategy(t *testing.T) {
505502
require.Eventually(t, func() bool {
506503
events := helpers.GetMockEvents(t, c)
507504
event, found := helpers.FindEventByNodeAndCheckName(events, testCtx.NodeName, "CSPMaintenance", false)
508-
if found {
509-
receivedEvent = event
510-
return true
505+
if !found {
506+
return false
511507
}
512508

513509
t.Log("Validating received CloudEvent")
@@ -524,7 +520,7 @@ func TestCSPHealthMonitorStoreOnlyProcessingStrategy(t *testing.T) {
524520
require.NoError(t, err)
525521

526522
helpers.SetDeploymentArgs(ctx, client, "csp-health-monitor", helpers.NVSentinelNamespace, "maintenance-notifier", map[string]string{
527-
"--processing-strategy": "EXECUTE_REMEDIATION",
523+
"--processing-strategy": "STORE_ONLY",
528524
})
529525

530526
helpers.WaitForDeploymentRollout(ctx, t, client, "csp-health-monitor", helpers.NVSentinelNamespace)

tests/helpers/kube.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2359,7 +2359,7 @@ func setArgsOnContainer(container *v1.Container, args map[string]string) {
23592359
}
23602360
}
23612361

2362-
// RemoveDeploymentArgs removes environment variables from containers in a deployment.
2362+
// RemoveDeploymentArgs removes arguments from containers in a deployment.
23632363
// If containerName is empty, removes from all containers. Otherwise, removes only from the named container.
23642364
// Uses retry.RetryOnConflict for automatic retry handling.
23652365
func RemoveDeploymentArgs(

0 commit comments

Comments
 (0)