Skip to content

feat(konnector): annotate synced objects with source namespace and UID#519

Merged
cnvergence merged 5 commits into
kbind-dev:mainfrom
mirzakopic:feat/objectmetadata
Apr 16, 2026
Merged

feat(konnector): annotate synced objects with source namespace and UID#519
cnvergence merged 5 commits into
kbind-dev:mainfrom
mirzakopic:feat/objectmetadata

Conversation

@mirzakopic

@mirzakopic mirzakopic commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Annotates synced objects with source metadata annotations (kube-bind.io/consumer-namespace, kube-bind.io/consumer-uid, kube-bind.io/provider-namespace, kube-bind.io/provider-uid) so that both sides of the sync can trace the origin
of synced objects. This is applied in both the claimed resources reconciler (bidirectional) and the spec reconciler (consumer → provider).

What Type of PR Is This?

/kind feature

Related Issue(s)

Fixes #315

Release Notes

Added source metadata annotations on synced objects (`kube-bind.io/consumer-namespace`, `kube-bind.io/consumer-uid`, `kube-bind.io/provider-namespace`, `kube-bind.io/provider-uid`) to allow tracing the origin of objects across provider
and consumer clusters.

@mirzakopic mirzakopic requested a review from a team as a code owner April 8, 2026 07:40
@mirzakopic mirzakopic mentioned this pull request Apr 8, 2026
@mirzakopic mirzakopic linked an issue Apr 8, 2026 that may be closed by this pull request
Comment thread test/e2e/bind/happy-case_test.go
Comment thread pkg/konnector/controllers/cluster/claimedresources/claimedresources_reconciler.go Outdated
Comment thread pkg/konnector/controllers/cluster/serviceexport/spec/spec_reconcile.go Outdated
@mirzakopic

Copy link
Copy Markdown
Contributor Author

@cnvergence I tried to address your comments in the latest commit:

 1. "check both sides for annotations" (happy-case_test.go:451) — Added provider-namespace/provider-uid checks on the consumer-side object alongside the existing consumer→provider checks.
  
  2. "add expectedAnnotations map" (claimedresources_reconciler_test.go:80) — Both test files now use
  expectedAnnotations map[string]string in the test struct and assert in a loop.
  
  3. "make one generic function" (claimedresources_reconciler.go:243) — Single shared
  konnectortypes.SetSourceMetadataAnnotations() in pkg/konnector/types/types.go, used by both reconcilers.
 
  4. **"it doesn't reference (r reconciler)"* (spec_reconcile.go:257) — The receiver method is gone; the shared
  function is a plain function.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Apr 13, 2026
@mjudeikis

Copy link
Copy Markdown
Contributor

I think test failures are legging:

provider-namespace annotation must exist on consumer object

@cnvergence cnvergence left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

@cnvergence cnvergence merged commit 708f99a into kbind-dev:main Apr 16, 2026
7 checks passed
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.

Object metadata

3 participants