-
Notifications
You must be signed in to change notification settings - Fork 56
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
✨ Migrate Command Handling to Cobra for Simplified Flag Management #1598
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Horiodino <[email protected]>
Signed-off-by: Horiodino <[email protected]>
✅ Deploy Preview for olmv1 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
👋 Thanks for the contribution! Quick question, if we're going to do this for the catalogd binary, should we do the same for the operator-controller binary? I.e. https://github.com/operator-framework/operator-controller/blob/main/cmd/operator-controller/main.go I suspect there will be some opinions on the functional refactoring as the controllers are set up (isn't some of that handled by controller runtime and kubebuilder?) and it would probably be good for us to match in those places. I know that's outside the scope of that github issue, but I think that's an artifact of these two binaries being part of separate repositories until very recently. |
/assign @LalatenduMohanty |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1598 +/- ##
==========================================
- Coverage 66.68% 66.48% -0.21%
==========================================
Files 57 57
Lines 4584 4598 +14
==========================================
Hits 3057 3057
- Misses 1302 1316 +14
Partials 225 225
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Hey @Horiodino! Thanks for your PR (especially since you noticed catalogd's new home and reproduced it here). |
Signed-off-by: Horiodino <[email protected]>
This PR fixes the issue described in #1567.
Description:
This PR migrates the command-line handling logic in the
cmd/manager/main.go
file to utilize the [Cobra CLI framework]. The migration simplifies flag handling, improves readability, and enhances the extensibility of the CLI for future development.Key Changes:
Cobra Root Command:
rootCmd
for top-level command handling, providing a clean and standardized entry point for the CLI.Flag Migration:
flag
package to Cobra’scmd.Flags()
andcmd.PersistentFlags()
.Subcommand Restructuring:
Helper Functions: