jaeger-operator
jaeger-operator copied to clipboard
fixes #1568 #2225
added function getIngressClass which set default or nginx ingress class to jaeger define ingress for providing loadbalancer IP.
Which problem is this PR solving?
- Resolve #1568 #2225
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
- [x] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [ ] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
- for
jaeger
:make lint test
- for
jaeger-ui
:yarn lint
andyarn test
- for
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.
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 ?
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.
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.
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.
@rubenvp8510 could you take a look to this PR?
There is an small issue with the linter. and small style comments other than that this LGTM