-
Notifications
You must be signed in to change notification settings - Fork 916
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
move CreateOrUpdateWork() and related functions to controllers/ctrlutl #6018
Conversation
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #6018 +/- ##
=======================================
Coverage 48.36% 48.36%
=======================================
Files 665 666 +1
Lines 54831 54831
=======================================
+ Hits 26520 26521 +1
+ Misses 26593 26592 -1
Partials 1718 1718
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/assign
I guess the circular dependency issue is due to the package |
Thank you for your attention @RainbowMango , I'm sorry that I didn't provide the detail about the import chain. What I met is I want to call OTOH, the |
That's the key point. Generally speaking, both The function CreateOrUpdateWork you mentioned it's kind of business logic, also part of controllers. Do you think it should be moved out from |
I aggre with you, I'll try it and update this PR later. |
replace title "move pkg/util/helper/unstructured.go to pkg/util" with "move CreateOrUpdateWork() and related functions to controllers/common" Looks like it could work, although there is still a lot of business logic in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
How about naming this new package with the following options?
- ctrlutil
- ctrlhelper
- ctrlcommon
It's no big deal, just feel the common
seems to be used everywhere, and I don't like the import aliases.
I prefer the first one, and then the second.
Thanks for the reminder, I will be more careful when people try to put more things to |
sure, updated the pkg name. |
Signed-off-by: zach593 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/approve
/hold
until the ci gets green
Please feel free to unhold this.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: RainbowMango The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/hold cancel |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
When I followed up on #6017, I ran into a circular reference issue, move this package to pkg/util could help solve it.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: