Skip to content

fix(controller): dedup shared clients before limit - #1126

Closed
bennyz wants to merge 1 commit into
codex/lease-sharing-reconcilefrom
codex/lease-sharing-dedup
Closed

bennyz wants to merge 1 commit into
codex/lease-sharing-reconcilefrom
codex/lease-sharing-dedup

Conversation

@bennyz

@bennyz bennyz commented Sep 24, 2026

Copy link
Copy Markdown
Member

Summary

Deduplicate requested shared_with clients before enforcing the maximum number of entries. The limit now applies to distinct clients.

Reproduction and validation

  • The regression test fails on the pre-fix commit: 12 copies of one client are rejected as exceeding the 10-client limit.
  • The test passes with this change; the same request was accepted and deduplicated on the Pi's k3s cluster.
  • go test ./internal/service/client/v1 passes.

Stack: 2 of 5; depends on the shared-access reconciliation PR below it.

CreateLease deduplicated the shared_with list only after checking it against
MaxSharedWithEntries, so a request with duplicate entries could be rejected even
though its distinct set fit under the limit. Dedup first, then enforce the limit.
@coderabbitai

coderabbitai Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@bennyz
bennyz added this pull request to stack #1130 September 24, 2026 14:59
@bennyz bennyz closed this Sep 24, 2026
@bennyz
bennyz deleted the codex/lease-sharing-dedup branch October 3, 2026 17:27
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.

1 participant