Skip to content

Opt placeholders out of the core's auto-claim - #5

Merged
Timofei Larkin (lllamnyp) merged 2 commits into
mainfrom
feat/placeholder-auto-claim-opt-out
Nov 6, 2026
Merged

Timofei Larkin (lllamnyp) merged 2 commits into
mainfrom
feat/placeholder-auto-claim-opt-out

Conversation

@lllamnyp

Copy link
Copy Markdown
Member

cozystack/address-controller#7 makes the core controller auto-provision an IPAddressClaim for any LoadBalancer Service that names no claim. This driver's reservation placeholders are exactly such Services, so without an opt-out the core would claim an address for every reservation the driver makes. This PR opts them out.

Two commits:

  1. Import address-controller from its cozystack module path. The core moved from github.com/lllamnyp/address-controller to github.com/cozystack/address-controller. metallb-iad still required the old module, so it could not pick up any API change made since. The change is imports plus go get/go mod tidy; no behaviour changes.
  2. Opt placeholders out of the core's auto-claim. NewPlaceholder stamps local.sdn.cozystack.io/auto-claim: "false" using the core's exported ServiceAutoClaimAnnotation, so the two sides share one constant. A driver test covers it, and design §4 notes it alongside the other placeholder properties.

Merge order. The module is pinned to the head commit of cozystack/address-controller#7. That repo merges with merge commits, so the pin stays reachable after #7 lands. Re-pinning to the merge commit afterwards is optional cleanup.

Rollout. Deploy this before marking any IPAddressClass with is-auto-claim-class. Existing hold placeholders already have an address, and the core skips Services that have one. Only a placeholder created by an older driver and still waiting for MetalLB at the moment a class gets marked could be claimed by mistake.

go build ./..., go test ./internal/... and golangci-lint run pass.

address-controller moved from github.com/lllamnyp to github.com/cozystack.
metallb-iad still required the old module, so it could not pick up any
API change made since the move.

Assisted-By: LLM
Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
address-controller can now auto-provision an IPAddressClaim for any
LoadBalancer Service that names none. Placeholders are such Services,
so without an opt-out the core would claim an address for every
reservation the driver makes. Placeholders now carry
local.sdn.cozystack.io/auto-claim: "false", using the constant the core
exports, and the module is bumped to the address-controller commit that
introduces it.

Assisted-By: LLM
Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
@coderabbitai

coderabbitai Bot commented Oct 30, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: dfff9dd7-3cd6-4b0b-a6de-4c4f9e076704
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@IvanHunters IvanHunters left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review: opt placeholders out of auto-claim

Correct and necessary. NewPlaceholder stamps local.sdn.cozystack.io/auto-claim: "false" on every reservation placeholder (internal/driver/driver.go:168-170), and TestNewPlaceholderForAllocation asserts it. The core's wantsAutoClaim honours that annotation, so this keeps the core from minting a claim against the driver's own holders.

One thing to flag for release sequencing rather than for the code here: until the core implements the §6 pool-or-pin exclusion, this annotation is the only protection against the core claiming the driver's placeholders. So this PR is a prerequisite for enabling any auto-claim class, as decision 0002 notes. It should land, and land before auto-claim is switched on anywhere.

LGTM.

@lllamnyp
Timofei Larkin (lllamnyp) merged commit a307d29 into main Nov 6, 2026
7 checks passed
@lllamnyp
Timofei Larkin (lllamnyp) deleted the feat/placeholder-auto-claim-opt-out branch November 6, 2026 19:01
@lllamnyp
Timofei Larkin (lllamnyp) restored the feat/placeholder-auto-claim-opt-out branch November 6, 2026 19:02
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.

2 participants