Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Ingress.status.loadBalancer.ingress when reconciling #69

Merged
merged 2 commits into from
May 8, 2024

Conversation

UnstoppableMango
Copy link
Contributor

@UnstoppableMango UnstoppableMango commented Jan 7, 2024

Should resolve #68

A note about the implementation, I wasn't a fan of mutating the Service inside of FromIngressToExposure but it was the most convenient place for it right now. I could move the mutation into the reconcile method directly, but then we would need a redundant client.Get() call. We could move it somewhere else as well, but that would probably require a bit of refactoring.

@codecov-commenter
Copy link

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (c685e37) 25.91% compared to head (c7ed1c5) 26.48%.
Report is 1 commits behind head on master.

Files Patch % Lines
pkg/controller/transform.go 76.92% 2 Missing and 1 partial ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #69      +/-   ##
==========================================
+ Coverage   25.91%   26.48%   +0.57%     
==========================================
  Files           9        9              
  Lines         629      638       +9     
==========================================
+ Hits          163      169       +6     
- Misses        456      458       +2     
- Partials       10       11       +1     

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

Copy link
Owner

@STRRL STRRL left a comment

Choose a reason for hiding this comment

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

Hi @UnstoppableMango , thanks for your contributions! Before this PR get merged, there is something needs changes:

@STRRL
Copy link
Owner

STRRL commented Jan 19, 2024

PTAL @UnstoppableMango, I would very much appreciate it if you could address these changes. 🥰🥰

@UnstoppableMango
Copy link
Contributor Author

You got it! That first one is a little embarrassing 😳 should be able to make the updates this afternoon!

@@ -99,6 +99,19 @@ func (i *IngressController) Reconcile(ctx context.Context, request reconcile.Req
}
}

origin.Status.LoadBalancer.Ingress = append(origin.Status.LoadBalancer.Ingress,
networkingv1.IngressLoadBalancerIngress{
Hostname: i.tunnelClient.TunnelDomain(),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the original comment in #68 they mentioned using the cloudflare cname value, do you agree with this? Or should this use the ingress hostname?

Also, should https:// be appended to the beginning?

Copy link
Owner

Choose a reason for hiding this comment

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

Hi @UnstoppableMango , sorry for the late response.

we do not need https:// prefix.

@UnstoppableMango
Copy link
Contributor Author

Ach I apoligize that first attempt was really half-baked!

I didn't see a great spot to move tests to, is there a place you think they should live?

@UnstoppableMango UnstoppableMango changed the title Update Service.status.loadBalancer.ingress when reconciling Update Ingress.status.loadBalancer.ingress when reconciling Feb 15, 2024
@@ -99,6 +99,19 @@ func (i *IngressController) Reconcile(ctx context.Context, request reconcile.Req
}
}

origin.Status.LoadBalancer.Ingress = append(origin.Status.LoadBalancer.Ingress,
networkingv1.IngressLoadBalancerIngress{
Hostname: i.tunnelClient.TunnelDomain(),
Copy link
Owner

Choose a reason for hiding this comment

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

Hi @UnstoppableMango , sorry for the late response.

we do not need https:// prefix.

@STRRL STRRL merged commit 8b4fb07 into STRRL:master May 8, 2024
@UnstoppableMango UnstoppableMango deleted the lb-status branch May 8, 2024 23:07
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.

support reporting external hostname
3 participants