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

fixes #1568 #2225 #2466

Merged
merged 16 commits into from
Mar 11, 2024
Merged

fixes #1568 #2225 #2466

merged 16 commits into from
Mar 11, 2024

Conversation

antoniomerlin
Copy link
Contributor

added function getIngressClass which set default or nginx ingress class to jaeger define ingress for providing loadbalancer IP.

Which problem is this PR solving?

Description of the changes

  • if spec.IngressClassName is not specified in CRD, then this will query kubernetes API for getting list of IngressClasses and look for if any default IngressClass is available, if present the it attach that IngressClass to networkingv1.IngressSpec of jaegerIngress and if not available then it check for nginx ingress controller and attach that and if nothing is avalable then it do nothing.

How was this change tested?

  • local multinode cluster with ngnix as ingress controller

Checklist

added function getIngressClass which set default or nginx ingress class to jaeger define ingress for providing loadbalancer IP.

Signed-off-by: Gaurav Singh <gauravsinghbr@hotmail.com>
Copy link

openshift-ci bot commented Feb 12, 2024

Hi @antoniomerlin. Thanks for your PR.

I'm waiting for a jaegertracing member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@antoniomerlin antoniomerlin mentioned this pull request Feb 12, 2024
4 tasks
Copy link
Collaborator

@iblancasa iblancasa left a comment

Choose a reason for hiding this comment

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

Please, add a test for this.

Copy link
Collaborator

@iblancasa iblancasa left a comment

Choose a reason for hiding this comment

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

Please, add a test for this.

@antoniomerlin
Copy link
Contributor Author

Hi, thanks for reviewing, i've modified the changes just a query you already having test mentioning this scenario :-

func TestQueryIngressClass(t *testing.T) {
	jaeger := v1.NewJaeger(types.NamespacedName{Name: "TestQueryIngressClass"})
	jaegerNoIngressNoClass := v1.NewJaeger(types.NamespacedName{Name: "TestQueryIngressNoClass"})

	inressClassName := "nginx"
	jaeger.Spec.Ingress.IngressClassName = &inressClassName

	ingress := NewQueryIngress(jaeger)
	ingressNoClass := NewQueryIngress(jaegerNoIngressNoClass)

	dep := ingress.Get()

	assert.NotNil(t, dep.Spec.IngressClassName)
	assert.Equal(t, "nginx", *dep.Spec.IngressClassName)
	assert.Nil(t, ingressNoClass.Get().Spec.IngressClassName)
}

pkg/ingress/query_test.go do i need to write again or can use existing one or do any modification in this ?

@iblancasa
Copy link
Collaborator

pkg/ingress/query_test.go do i need to write again or can use existing one or do any modification in this ?

You can complete that test to set a custom value and check if the custom value is properly set.

@antoniomerlin
Copy link
Contributor Author

pkg/ingress/query_test.go do i need to write again or can use existing one or do any modification in this ?

You can complete that test to set a custom value and check if the custom value is properly set.

okay thanks.

@antoniomerlin
Copy link
Contributor Author

Hi, I've modified that test case to set ingressNoClass to default or nginx available ingress controller. And if any error or unable to find any ingress controller installed then it would be remain empty.

pkg/ingress/query.go Outdated Show resolved Hide resolved
pkg/ingress/query.go Outdated Show resolved Hide resolved
pkg/ingress/query.go Outdated Show resolved Hide resolved
pkg/ingress/query_test.go Outdated Show resolved Hide resolved
antoniomerlin and others added 2 commits February 16, 2024 18:10
… ingressClass is not set then the default or nginx ingressClass is added to the jaeger ingress.

Signed-off-by: Gaurav Singh <gauravsinghbr@hotmail.com>
@iblancasa
Copy link
Collaborator

@rubenvp8510 could you take a look to this PR?

pkg/ingress/query.go Outdated Show resolved Hide resolved
Gaurav Singh added 2 commits March 5, 2024 19:00
getInClusterAvailableIngressClass() and updated manifests

Signed-off-by: Gaurav Singh <gauravsinghbr@hotmail.com>
Signed-off-by: Gaurav Singh <gauravsinghbr@hotmail.com>
return "", err
}
for _, ingress := range ingressList.Items {
if ingress.Name == "nginx" {
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: may be we should put this on a constant

@rubenvp8510
Copy link
Collaborator

There is an small issue with the linter. and small style comments other than that this LGTM

@iblancasa iblancasa merged commit c8b3e73 into jaegertracing:main Mar 11, 2024
22 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Facing issues in getting the IP address to access Jaeger-UI on Linux platform
3 participants