Skip to content

feat(api)!: report loadBalancerClass in IPAddressClass status, not spec - #19

Merged
Timofei Larkin (lllamnyp) merged 2 commits into
mainfrom
feat/class-status-loadbalancerclass
Nov 27, 2026
Merged

Timofei Larkin (lllamnyp) merged 2 commits into
mainfrom
feat/class-status-loadbalancerclass

Conversation

@lllamnyp

@lllamnyp Timofei Larkin (lllamnyp) commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

Removes IPAddressClass.spec.loadBalancerClass, added in #18, and has the provisioner report the value in the class's status instead, as decision 0003 of the ip-address-claims design proposal (cozystack/community#35) specifies. Releases as v0.3.0.

Why

The loadBalancerClass a consuming Service must carry is a property of the driver's deployment: the driver is configured with the --lb-class of the implementation it fronts. With the field on the class, an admin restated it on every class. A class naming a value no driver serves left its claims pending, and nothing could report why. #18 added the field so that cozystack/cozystack#4324 had a value to read; 0003's driver-reported status was the specified contract and had not been implemented.

Changes

  • API. spec.loadBalancerClass and its CEL immutability rule are removed. IPAddressClass gains a status subresource written by the provisioner, never by the core:
    • status.loadBalancerClass, empty for the cluster's default implementation;
    • an Accepted condition. The value is valid only while Accepted is True for the class's current generation; before that an empty value is unreported, not the default. IPAddressClass.AcceptedLoadBalancerClass() applies the rule for consumers, which must wait for it because a Service's loadBalancerClass cannot change after creation.
    • Print columns for both.
  • Auto-claim. Nothing is claimed from a class its provisioner has not accepted; the class's status update requeues the Service. The Service's loadBalancerClass is matched against the reported value, unset matching empty. A Service that names an unaccepted class gets a ClassNotAccepted warning event; for the marked auto-claim class this is silent, as a mismatch already is.
  • Docs. docs/design.md §2, §7 (a seventh driver obligation: report the class) and §10, the README, and the operating guide's schema table.
  • Release. Chart version/appVersion and the Makefile's CHART_VERSION set to 0.3.0.

Upgrade

Tests

  • internal/controller: auto-claim waits for a class with no status, Accepted=False, or Accepted for an older generation, with and without the class named by the Service, recording ClassNotAccepted only when named. The match cases (both unset, equal, either side only, different) now take the class's value from status.
  • test/crd (envtest): a class's status survives an update of the class itself, as the core's finalizer handling needs.

make test and make lint pass.

The loadBalancerClass a Service consuming a claim must carry belongs to
the provisioner's deployment: the driver is configured with the --lb-class
of the implementation it fronts. Restating it on every class let a class
name a value no driver serves, and its claims then stayed pending with
nothing reporting why. This follows decision 0003 of the ip-address-claims
design proposal (cozystack/community#35).

- API: IPAddressClass.spec.loadBalancerClass and its immutability rule
  are removed. The class gains a status subresource, written by the
  provisioner and never by the core: status.loadBalancerClass, and an
  Accepted condition. The value is valid only while Accepted is True for
  the class's current generation, since an empty value otherwise cannot
  be told from an unreported one. AcceptedLoadBalancerClass() applies
  that rule for consumers.
- Auto-claim claims nothing from a class its provisioner has not
  accepted, and matches the Service's loadBalancerClass against the
  reported value. A Service that names an unaccepted class gets a
  ClassNotAccepted warning event.
- Docs: design.md §2, §7 (a seventh driver obligation, reporting the
  class) and §10, the README, and the operating guide's schema table.
- The envtest CRD suite now checks that a write to the class does not
  reset the provisioner's status.

The CRD no longer defines spec.loadBalancerClass, so the apiserver drops
it from classes that set it.

Assisted-By: LLM
Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
Cozystack vendors chart/address-controller/ from the tagged commit, so
Chart.yaml's version and appVersion, and the Makefile's CHART_VERSION,
must match the v0.3.0 tag. The operating guide's schema table moves its
unreleased row to v0.3.0.

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

coderabbitai Bot commented Nov 27, 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: 7adf8f38-6078-4069-b5fc-9b629b8deb66
  • 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

@lllamnyp
Timofei Larkin (lllamnyp) merged commit 10c701b into main Nov 27, 2026
6 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.

2 participants