Skip to content

improvement(worker-slice-config): emit update-failed event and metric in ReconcileWorkerSliceConfig#383

Open
mdryaan wants to merge 1 commit into
kubeslice:masterfrom
mdryaan:improvement/workersliceconfig-reconcile-update-event
Open

improvement(worker-slice-config): emit update-failed event and metric in ReconcileWorkerSliceConfig#383
mdryaan wants to merge 1 commit into
kubeslice:masterfrom
mdryaan:improvement/workersliceconfig-reconcile-update-event

Conversation

@mdryaan

@mdryaan mdryaan commented May 17, 2026

Copy link
Copy Markdown

Description

ReconcileWorkerSliceConfig in service/worker_slice_config_service.go (lines 282–286) called util.UpdateResource and returned the error silently on failure — no Kubernetes Event and no Prometheus metric were recorded. The identical failure path in CreateMinimalWorkerSliceConfig (lines 397–414 of the same file)
correctly records EventWorkerSliceConfigUpdateFailed and increments the KubeSliceEventsCounter metric. Both eventRecorder and s.mf were already in scope at the failure site. Added the missing util.RecordEvent and s.mf.RecordCounterMetric calls to match the established pattern, making update failures visible in kubectl get events and Prometheus dashboards.

Fixes #382

How Has This Been Tested?

service/worker_slice_config_service.go lines 283–284: inserted util.RecordEvent(ctx, eventRecorder, workerSliceConfig, nil, events.EventWorkerSliceConfigUpdateFailed) and s.mf.RecordCounterMetric(...) before the return, copying the exact pattern from lines 399–408 in the same file. go build ./... passes. Pre-existing make vet failure (undefined: util.Client in access_control_service_test.go) exists on master before this
branch and is unrelated to this change.

Checklist:

  • The title of the PR states what changed and the related issues number (used for the release note).
  • Does this PR requires documentation updates? — No.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have tested it for all user roles.
  • I have added all the required unit test cases.

Does this PR introduce a breaking change for other components like worker-operator?

No

Fix ReconcileWorkerSliceConfig to emit EventWorkerSliceConfigUpdateFailed event and metric on update failure, consistent with CreateMinimalWorkerSliceConfig    

… in ReconcileWorkerSliceConfig

Signed-off-by: mdryaan <alikhurshid4u@gmail.com>
@mdryaan mdryaan requested a review from that-backend-guy as a code owner May 17, 2026 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improvemen: ReconcileWorkerSliceConfig does not emit a Kubernetes Event when UpdateResource fails

1 participant