Skip to content

feat: parse nested load balancer label_selector targets#633

Merged
jooola merged 2 commits intohetznercloud:mainfrom
Bre77:claude/fix-nested-lb-targets-6svdA
Mar 5, 2026
Merged

feat: parse nested load balancer label_selector targets#633
jooola merged 2 commits intohetznercloud:mainfrom
Bre77:claude/fix-nested-lb-targets-6svdA

Conversation

@Bre77
Copy link
Contributor

@Bre77 Bre77 commented Mar 5, 2026

When a load balancer has a label_selector type target, the API returns a nested "targets" array containing the resolved individual server targets with their health statuses. This data was previously discarded.

  • Add targets parameter to LoadBalancerTarget.__init__ in domain.py
  • Parse nested targets in BoundLoadBalancer.__init__ for label_selector targets, creating LoadBalancerTarget objects with server, health_status, type, and use_private_ip fields
  • Add test fixture and test case for nested target parsing

claude and others added 2 commits March 5, 2026 01:52
When a load balancer has a label_selector type target, the API returns
a nested "targets" array containing the resolved individual server
targets with their health statuses. This data was previously discarded.

- Add `targets` parameter to `LoadBalancerTarget.__init__` in domain.py
- Parse nested targets in `BoundLoadBalancer.__init__` for label_selector
  targets, creating `LoadBalancerTarget` objects with server, health_status,
  type, and use_private_ip fields
- Add test fixture and test case for nested target parsing

https://claude.ai/code/session_018oDf81V2LsgKcFheq7KSRp
@jooola jooola changed the title Fix: Parse nested targets within label_selector load balancer targets feat: parse nested load balancer label_selector targets Mar 5, 2026
@codecov
Copy link

codecov bot commented Mar 5, 2026

Codecov Report

❌ Patch coverage is 95.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 96.72%. Comparing base (7aaaa72) to head (cd3e6aa).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
hcloud/load_balancers/client.py 94.73% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #633      +/-   ##
==========================================
+ Coverage   96.62%   96.72%   +0.10%     
==========================================
  Files          76       76              
  Lines        4031     4033       +2     
==========================================
+ Hits         3895     3901       +6     
+ Misses        136      132       -4     

☔ View full report in Codecov by Sentry.
📢 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.

@jooola jooola merged commit cde61e5 into hetznercloud:main Mar 5, 2026
12 checks passed
jooola pushed a commit that referenced this pull request Mar 5, 2026
<!-- section-start changelog -->
### Features

- parse nested load balancer `label_selector` targets (#633)

<!-- section-end changelog -->

---

<details>
<summary><h4>PR by <a
href="https://github.com/apricote/releaser-pleaser">releaser-pleaser</a>
🤖</h4></summary>

If you want to modify the proposed release, add you overrides here. You
can learn more about the options in the docs.

## Release Notes

### Prefix / Start

This will be added to the start of the release notes.

~~~~rp-prefix
~~~~

### Suffix / End

This will be added to the end of the release notes.

~~~~rp-suffix
~~~~

</details>

Co-authored-by: Hetzner Cloud Bot <>
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.

3 participants