Skip to content

Conversation

@enrichman
Copy link
Collaborator

Fix #432

When a Cluster is exposed with a LoadBalancer but the IP is not yet issued the Status of the Service is empty, because the ExternalIP is still in a <pending> state.

This PR adds a check, and logs a warning.

image

@enrichman enrichman self-assigned this Nov 11, 2025
@codecov-commenter
Copy link

codecov-commenter commented Nov 11, 2025

Codecov Report

❌ Patch coverage is 25.00000% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.67%. Comparing base (a84c49f) to head (2955af1).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
pkg/controller/kubeconfig/kubeconfig.go 25.00% 8 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #554      +/-   ##
==========================================
+ Coverage   59.58%   59.67%   +0.09%     
==========================================
  Files          56       56              
  Lines        5151     5158       +7     
==========================================
+ Hits         3069     3078       +9     
- Misses       1798     1799       +1     
+ Partials      284      281       -3     
Flag Coverage Δ
cli 53.70% <16.66%> (+0.58%) ⬆️
controller 58.37% <25.00%> (-0.09%) ⬇️
e2e 58.37% <25.00%> (-0.09%) ⬇️
unit 41.46% <0.00%> (-0.07%) ⬇️

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

☔ 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.

}

if len(k3kService.Spec.Ports) == 0 {
logrus.Warn("No exposed port in LoadBalancer service.")

Choose a reason for hiding this comment

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

Should this be a different message from the one above?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Do you mean that it could be the same message, like "No exposed ports in service."?

I'm not even sure you can have a Service without a Port actually.

Choose a reason for hiding this comment

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

Oops...should've clarified this, you can't have a Service without a Port, spec.ports is a required value.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah, awesome. So should I drop the check altogether? I'm fine with this, it simplify the code, and it was not really the reason of the PR. 🙂

@enrichman enrichman merged commit 7dc4726 into rancher:main Nov 11, 2025
9 checks passed
@enrichman enrichman deleted the 432-fix-panic-cli branch November 11, 2025 16:18
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.

Panic when trying to generate a kubeconfig with a <pending> LoadBalancer

3 participants