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

adding priority-class for esIndexCleaner #1732

Merged

Conversation

swapnilpotnis
Copy link
Contributor

@swapnilpotnis swapnilpotnis commented Feb 1, 2022

Signed-off-by: Swapnil Potnis [email protected]

Which problem is this PR solving?

Short description of the changes

  • Adding the attribute of "priorityclassName" for "esIndexCleaner"

@djsly
Copy link

djsly commented Feb 1, 2022

thanks @swapnilpotnis for this effort!

@rubenvp8510
Copy link
Collaborator

The linter is complaining. You need to regenerate the bundle.

You can use the following command.
VERSION=1.30.0 USER=jaegertracing make bundle

@swapnilpotnis swapnilpotnis force-pushed the priorityClass-esIndexCleaner branch from 1c067dd to f9e8d67 Compare February 2, 2022 12:22
@swapnilpotnis
Copy link
Contributor Author

@rubenvp8510 : Done.

@swapnilpotnis swapnilpotnis force-pushed the priorityClass-esIndexCleaner branch from c34fd9b to f76e31a Compare February 4, 2022 06:07
@rubenvp8510
Copy link
Collaborator

DCO is failing, You need to sign your commits :)

@codecov
Copy link

codecov bot commented Feb 4, 2022

Codecov Report

Merging #1732 (c3728f5) into main (d60fada) will decrease coverage by 0.02%.
The diff coverage is 60.00%.

@@            Coverage Diff             @@
##             main    #1732      +/-   ##
==========================================
- Coverage   89.45%   89.42%   -0.03%     
==========================================
  Files         100      100              
  Lines        6116     6118       +2     
==========================================
  Hits         5471     5471              
- Misses        470      471       +1     
- Partials      175      176       +1     
Impacted Files Coverage Δ
apis/v1/jaeger_types.go 87.50% <ø> (ø)
pkg/cronjob/es_index_cleaner.go 97.22% <50.00%> (-2.78%) ⬇️
pkg/deployment/query.go 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d60fada...c3728f5. Read the comment docs.

@rubenvp8510
Copy link
Collaborator

Hi @swapnilpotnis are you still interesting on this one? If so please rebase and sign your commits I think after that it will be ready to be merged :)

Thanks for your contribution!

@swapnilpotnis
Copy link
Contributor Author

Really sorry for the late response. Will fix it up by today itself and have the PR ready for review.

@swapnilpotnis swapnilpotnis force-pushed the priorityClass-esIndexCleaner branch from ddf6137 to 6f4c3f0 Compare February 11, 2022 04:25
@swapnilpotnis swapnilpotnis force-pushed the priorityClass-esIndexCleaner branch 3 times, most recently from 6ce380f to 5646a21 Compare February 12, 2022 07:20
@swapnilpotnis swapnilpotnis force-pushed the priorityClass-esIndexCleaner branch from 7b3e94e to c4aa417 Compare March 4, 2022 10:19
Signed-off-by: Swapnil Potnis <[email protected]>
@swapnilpotnis swapnilpotnis force-pushed the priorityClass-esIndexCleaner branch from c4aa417 to bff72dd Compare March 4, 2022 10:20
@swapnilpotnis
Copy link
Contributor Author

@rubenvp8510 : hey...I have added the unit test case as well as updated the PR with the latest branch commit. Can you please take a look?

@swapnilpotnis
Copy link
Contributor Author

@rubenvp8510 : can you please allow the tests to be run over the PR again?

@swapnilpotnis
Copy link
Contributor Author

@rubenvp8510 : the earlier check seemed to have failed with the error "Build failed: the api.md file has been changed but the generated api.md file isn't up to date. Run 'make api-docs' and update your PR." (https://github.com/jaegertracing/jaeger-operator/runs/5548885043?check_suite_focus=true#step:6:171) but running the command states that no rule has been found to the target "api-docs". I am a bit confused as to how to deal with the error and google wasn't helpful as well in that aspect. Can you please provide me some pointers??

@swapnilpotnis
Copy link
Contributor Author

@rubenvp8510 : the earlier check seemed to have failed with the error "Build failed: the api.md file has been changed but the generated api.md file isn't up to date. Run 'make api-docs' and update your PR." (https://github.com/jaegertracing/jaeger-operator/runs/5548885043?check_suite_focus=true#step:6:171) but running the command states that no rule has been found to the target "api-docs". I am a bit confused as to how to deal with the error and google wasn't helpful as well in that aspect. Can you please provide me some pointers??

@rubenvp8510 : can you please help me with this??

@rubenvp8510
Copy link
Collaborator

rubenvp8510 commented Mar 23, 2022

@rubenvp8510 : the earlier check seemed to have failed with the error "Build failed: the api.md file has been changed but the generated api.md file isn't up to date. Run 'make api-docs' and update your PR." (https://github.com/jaegertracing/jaeger-operator/runs/5548885043?check_suite_focus=true#step:6:171) but running the command states that no rule has been found to the target "api-docs". I am a bit confused as to how to deal with the error and google wasn't helpful as well in that aspect. Can you please provide me some pointers??

@rubenvp8510 : can you please help me with this??

Hi did you rebase your PR? try to run it with the PR rebased on top of main. I checkout your branch and I was able to run it and generated the doc file. I can also push a commit with the change if you want.

You should see this rule on your Makefile: https://github.com/jaegertracing/jaeger-operator/blob/main/Makefile#L496

@swapnilpotnis swapnilpotnis force-pushed the priorityClass-esIndexCleaner branch from 230d838 to 7a8f8f5 Compare March 23, 2022 13:02
Signed-off-by: Swapnil Potnis <[email protected]>
@swapnilpotnis swapnilpotnis force-pushed the priorityClass-esIndexCleaner branch from 7a8f8f5 to 980c6c5 Compare March 23, 2022 13:06
@swapnilpotnis
Copy link
Contributor Author

@rubenvp8510 : thanks for your help. I have updated the PR with the required changes. Can you please run the checks??

@swapnilpotnis
Copy link
Contributor Author

@rubenvp8510 : Forgive me as I wasn't aware of the naming convention that was suppose to be followed for which the earlier check had failed. Can you please re-run the tests as I have rectified the variable name as part of the latest commit?

@rubenvp8510
Copy link
Collaborator

@rubenvp8510 : Forgive me as I wasn't aware of the naming convention that was suppose to be followed for which the earlier check had failed. Can you please re-run the tests as I have rectified the variable name as part of the latest commit?

No problem :)

@rubenvp8510
Copy link
Collaborator

2022-03-23T14:25:57.3007810Z --- FAIL: TestPriorityClassName (0.00s) :(

@swapnilpotnis
Copy link
Contributor Author

@rubenvp8510 : can you please run the tests for the latest commit ?

@swapnilpotnis
Copy link
Contributor Author

@rubenvp8510 : alas..!!! The pipelines finally Green :)
Can you also please review the PR whenever you have some bandwidth??

Copy link
Member

@frzifus frzifus left a comment

Choose a reason for hiding this comment

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

hi @swapnilpotnis, thanks for your pr. I have only 2 last questions :)

apis/v1/jaeger_types.go Show resolved Hide resolved
@@ -45,6 +45,11 @@ func CreateEsIndexCleaner(jaeger *v1.Jaeger) *batchv1beta1.CronJob {

ca.Update(jaeger, commonSpec)

priorityClassName := ""
if jaeger.Spec.Storage.EsIndexCleaner.PriorityClassName != "" {
Copy link
Member

Choose a reason for hiding this comment

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

Do we need this condition?
if the field is not empty, we update priorityClassName. But if its empty, we dont update priorityClassName that is initialized with an empty string.

means it is equal to just priorityClassName := jaeger.Spec.Storage.EsIndexCleaner.PriorityClassName right?

Would it then make sense to assign it directly in the metav1 object?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Agree on this comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually I looked at other parts of the code where priorityClass has been reference and this was the general approach followed elsewhere as well. Having to go with the same flow, I implemented the same set of changes

ref:

  1. https://github.com/jaegertracing/jaeger-operator/blob/main/pkg/deployment/agent.go#L92
  2. https://github.com/jaegertracing/jaeger-operator/blob/main/pkg/deployment/query.go#L89

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let me know if you guys wish to have the assignment in the metav1 object itself so that I can make the changes. Also let me know if you guys wish to have the same set of changes made at other places as well. If that be the case, should I do it in the same PR or create a new PR altogether??

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rubenvp8510 / @frzifus : Guys, can you please share your inputs over it?

Copy link
Member

Choose a reason for hiding this comment

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

Sorry for the long response. From my point of view it would make sense to change it at least in this pr. But feel free to change it on the other places too in this or a new pr. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure. Will make the necessary change only for the priorityClass which is part of this PR.
And would create a new PR for the other 2 PriorityClass.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I would say only do the change related to this PR, we can do other changes in a separate PR

Copy link
Member

Choose a reason for hiding this comment

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

still a bit confused, isnt it the same like?

Suggested change
if jaeger.Spec.Storage.EsIndexCleaner.PriorityClassName != "" {
priorityClassName := "jaeger.Spec.Storage.EsIndexCleaner.PriorityClassName"

up to you @rubenvp8510

Copy link
Collaborator

Choose a reason for hiding this comment

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

I agree with the change, but for not blocking this PR we can do the changes in a follow up PR.

@swapnilpotnis swapnilpotnis force-pushed the priorityClass-esIndexCleaner branch from 084c7ef to f7f292b Compare April 12, 2022 12:28
@swapnilpotnis
Copy link
Contributor Author

@rubenvp8510 / @frzifus : Can you guys please review my PR?

@rubenvp8510 rubenvp8510 enabled auto-merge (squash) April 13, 2022 05:13
@rubenvp8510 rubenvp8510 merged commit 2969950 into jaegertracing:main Apr 13, 2022
@swapnilpotnis
Copy link
Contributor Author

@rubenvp8510: thanks alot :)
will soon create a PR for the priorityClass change at other 2 places

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.

4 participants