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

MESH-6019 : Make ingress gateway selection consistent. #376

Merged
merged 12 commits into from
Jan 22, 2025

Conversation

virajrk
Copy link
Collaborator

@virajrk virajrk commented Jan 8, 2025

Checklist

🚨 Please review this repository's contribution guidelines.

  • I've read and agree to the project's contribution guidelines.
  • I'm requesting to pull a topic/feature/bugfix branch.
  • I checked that my code additions will pass code linting checks and unit tests.
  • I updated unit and integration tests (if applicable).
  • I'm ready to notify the team of this contribution.

Description

Currently admiral load ingress gateway via two point and two different selector getting used.

  • Name of Kubernetes service
  • Label selector

Moving this only label selector.

Thank you!

@codecov-commenter
Copy link

codecov-commenter commented Jan 8, 2025

Codecov Report

Attention: Patch coverage is 25.00000% with 6 lines in your changes missing coverage. Please review.

Project coverage is 77.22%. Comparing base (8226882) to head (6854f0a).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
admiral/pkg/controller/common/common.go 0.00% 4 Missing ⚠️
admiral/pkg/clusters/service_handler.go 0.00% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #376      +/-   ##
==========================================
- Coverage   77.22%   77.22%   -0.01%     
==========================================
  Files          75       75              
  Lines       10417    10420       +3     
==========================================
+ Hits         8045     8047       +2     
+ Misses       1963     1958       -5     
- Partials      409      415       +6     

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

Comment on lines 495 to 494
} else {
return false
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

nitpick, we can remove this else block and just return false

func IsIstioIngressGatewayService(svc *k8sV1.Service, key string) bool {

if svc != nil && len(svc.Labels) > 0 {
//return svc.Namespace == NamespaceIstioSystem && svc.Labels["app"] == GetAdmiralParams().LabelSet.GatewayApp
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we remove this comment?

@@ -188,7 +188,8 @@ func (s *serviceCache) GetLoadBalancer(key string, namespace string) (string, in
return lb, 0
}
for _, service := range services {
if service.Labels["app"] == key {
if common.IsIstioIngressGatewayService(service, key) {
//if service.Labels["app"] == key {
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we remove this comment?

ingressEndpoint, port := getIngressEndpointAndPort(rc)
ingressEndpoint, port := rc.ServiceController.Cache.GetLoadBalancer(common.GetAdmiralParams().LabelSet.GatewayApp, common.NamespaceIstioSystem)
Copy link
Collaborator

Choose a reason for hiding this comment

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

any reason we pulled the code out of the func?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No place is using that except this place.
Plan to clean up that method as well. Also func is not doing anything part from sending same thing.

Viraj Kulkarni and others added 11 commits January 21, 2025 15:58
Signed-off-by: Viraj Kulkarni <[email protected]>
Signed-off-by: Viraj Kulkarni <[email protected]>
Signed-off-by: Viraj Kulkarni <[email protected]>
Signed-off-by: Viraj Kulkarni <[email protected]>
Signed-off-by: Viraj Kulkarni <[email protected]>
Signed-off-by: vtiwari5 <[email protected]>

Signed-off-by: Viraj Kulkarni <[email protected]>
Signed-off-by: vtiwari5 <[email protected]>
Signed-off-by: Viraj Kulkarni <[email protected]>
Signed-off-by: vtiwari5 <[email protected]>
Signed-off-by: Viraj Kulkarni <[email protected]>
Signed-off-by: Viraj Kulkarni <[email protected]>
Signed-off-by: Viraj Kulkarni <[email protected]>
Signed-off-by: Viraj Kulkarni <[email protected]>
@virajrk virajrk merged commit cfd939d into istio-ecosystem:master Jan 22, 2025
2 checks passed
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