Skip to content

fix: refresh binding status when work is first observed with reported status#567

Open
Asish Kumar (officialasishkumar) wants to merge 1 commit into
kubefleet-dev:mainfrom
officialasishkumar:fix/work-create-status-sync
Open

fix: refresh binding status when work is first observed with reported status#567
Asish Kumar (officialasishkumar) wants to merge 1 commit into
kubefleet-dev:mainfrom
officialasishkumar:fix/work-create-status-sync

Conversation

@officialasishkumar
Copy link
Copy Markdown
Contributor

Description of your changes

This PR makes the work generator recover when its cache first observes a Work object after the member side has already reported status. In that case the create event now requeues the parent binding so the binding and placement status can be refreshed instead of remaining stuck at ApplyInProgress.

To avoid changing the normal fresh-work flow, the create handler only enqueues when the created Work already carries reported status.

Fixes #558

I have:

  • Associated this change with a known KubeFleet Issue (Bug, Feature, etc).
  • Run make reviewable to ensure this PR is ready for review.

How has this code been tested

  • go test ./pkg/controllers/workgenerator -run TestWorkHandlerCreateFunc -count=1
  • go test ./pkg/controllers/workgenerator -run TestGetWorkNamePrefixFromSnapshotName -count=1

Special notes for your reviewer

  • The new create-event path is intentionally gated on Work objects that already have reported status to avoid regressing the existing ApplyInProgress behavior for freshly created works without member-side status yet.

Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 5, 2026

Codecov Report

❌ Patch coverage is 58.62069% with 12 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/controllers/workgenerator/controller.go 58.62% 9 Missing and 3 partials ⚠️

📢 Thoughts on this report? Let us know!

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.

[BUG] Placement status might fail to sync when caches are lagging

1 participant