Skip to content

feat(load-balancer): add service data source - #1426

Open
phm07 wants to merge 24 commits into
mainfrom
load-balancer-service-data-source
Open

phm07 wants to merge 24 commits into
mainfrom
load-balancer-service-data-source

Conversation

@phm07

@phm07 phm07 commented May 28, 2026

Copy link
Copy Markdown
Contributor

This PR adds a dedicated data source for Load Balancer Services. The services field in the original Load Balancer data source was not populated and is deprecated after this PR.

Fixes #1413 and #1136

@codecov

codecov Bot commented May 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.30435% with 28 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.99%. Comparing base (93291f4) to head (e15ac4d).

Files with missing lines Patch % Lines
internal/loadbalancer/data_source_service.go 90.56% 9 Missing and 6 partials ⚠️
internal/loadbalancer/data_source_service_list.go 77.77% 7 Missing and 5 partials ⚠️
internal/loadbalancer/model.go 99.03% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1426      +/-   ##
==========================================
+ Coverage   73.29%   73.99%   +0.69%     
==========================================
  Files         116      118       +2     
  Lines       12804    13124     +320     
==========================================
+ Hits         9385     9711     +326     
+ Misses       2344     2325      -19     
- Partials     1075     1088      +13     
Flag Coverage Δ
e2e 73.99% <91.30%> (+0.69%) ⬆️
unit 38.06% <44.09%> (+0.14%) ⬆️

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.

@jooola jooola left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Did a first pass, looks good. It needs some more work though.

Comment thread internal/loadbalancer/data_source_service.go Outdated
Comment thread internal/loadbalancer/data_source_service.go Outdated
Comment thread internal/loadbalancer/data_source_service_list.go Outdated
Comment thread internal/loadbalancer/data_source_service_list.go Outdated
Comment thread internal/loadbalancer/model.go Outdated
Comment thread internal/loadbalancer/model.go Outdated
@phm07
phm07 requested a review from jooola May 29, 2026 15:53
Comment thread internal/loadbalancer/data_source_service.go
Comment thread internal/loadbalancer/data_source_service.go
Comment thread internal/loadbalancer/data_source_service.go Outdated
Comment thread internal/loadbalancer/resource_service.go Outdated
@phm07
phm07 marked this pull request as ready for review June 5, 2026 11:35
@phm07
phm07 requested a review from a team as a code owner June 5, 2026 11:35

@jooola jooola left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A bunch of things to address and the tests are missing.

For the tests, please try to test fetching the 3 protocols (tcp, http, https).

Comment thread internal/loadbalancer/model.go Outdated
Comment thread internal/loadbalancer/model.go
Comment thread internal/loadbalancer/data_source_service.go Outdated
Comment thread internal/loadbalancer/data_source_service.go Outdated
Comment thread internal/loadbalancer/data_source_service.go Outdated
Comment thread internal/loadbalancer/data_source_service.go Outdated
Comment thread internal/loadbalancer/data_source_service_list.go Outdated
@jooola
jooola force-pushed the load-balancer-service-data-source branch from 048720a to e15ac4d Compare July 31, 2026 12:24
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.

[Bug]: hcloud_load_balancer data source not correctly populated

2 participants