Skip to content

refactor: use a spec model for annotation extraction - #1329

Draft
lukasmetzner wants to merge 2 commits into
split/core-a-typed-annotationsfrom
split/core-b-lbspec
Draft

refactor: use a spec model for annotation extraction#1329
lukasmetzner wants to merge 2 commits into
split/core-a-typed-annotationsfrom
split/core-b-lbspec

Conversation

@lukasmetzner

Copy link
Copy Markdown
Contributor

Introduce internal/lbspec, which resolves a Service and the cluster-wide
configuration into a Spec describing the desired state, and which builds the
API opts from it.

  • An invalid annotation now fails the whole reconcile instead of only the
    step that happened to read it. A typo in an HTTP annotation therefore also
    stops node targets from being updated.
  • The remaining 5 hclbServiceOptsBuilder op label values disappear from
    hcloud_ccm_operations_total, and resolveCertificates is added.
  • Certificates are resolved once per Service rather than once per port, and
    on the reconcile context instead of a detached 5s timeout.
  • An empty name annotation no longer tries to rename the Load Balancer to the
    empty string, and an empty hostname annotation no longer publishes an empty
    hostname as the ingress address.
  • private-ipv4 is parsed, so the private network address is compared as an
    address rather than as the literal annotation text.

Introduce internal/lbspec, which resolves a Service and the cluster-wide
configuration into a Spec describing the desired state, and which builds the
API opts from it.

- An invalid annotation now fails the whole reconcilement instead of only the
step that happened to read it. A typo in an HTTP annotation therefore also
stops node targets from being updated.
- The remaining 5 hclbServiceOptsBuilder op label values disappear from
hcloud_ccm_operations_total, and resolveCertificates is added.
- Certificates are resolved once per Service rather than once per port, and
on the reconcile context instead of a detached 5s timeout.
- An empty name annotation no longer tries to rename the Load Balancer to the
empty string, and an empty hostname annotation no longer publishes an empty
hostname as the ingress address.
- private-ipv4 is parsed, so the private network address is compared as an
address rather than as the literal annotation text.
@codecov

codecov Bot commented Aug 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.65548% with 82 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.07%. Comparing base (19944e7) to head (48e2cf6).

Files with missing lines Patch % Lines
internal/lbspec/opts.go 62.80% 45 Missing ⚠️
internal/hcops/load_balancer.go 80.18% 13 Missing and 8 partials ⚠️
internal/testsupport/klog.go 0.00% 11 Missing ⚠️
hcloud/load_balancers.go 90.69% 3 Missing and 1 partial ⚠️
internal/hcops/mocks.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@                        Coverage Diff                         @@
##           split/core-a-typed-annotations    #1329      +/-   ##
==================================================================
- Coverage                           70.11%   69.07%   -1.05%     
==================================================================
  Files                                  29       32       +3     
  Lines                                2794     2658     -136     
==================================================================
- Hits                                 1959     1836     -123     
- Misses                                643      658      +15     
+ Partials                              192      164      -28     
Flag Coverage Δ
e2e 46.30% <59.40%> (+1.20%) ⬆️
unit 64.67% <76.06%> (-1.83%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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