-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
🏃 structure and expose cobra cmds #1148
Conversation
This restructures the cmd directory into pkgs that follows the hierarchy of CLI subcommands. This helps to expose the New***Command() functions that return the cobra subcommands so they can be consumed by downstream projects that need to reuse Kubebuilder CLI for scaffolding projects.
Welcome @hasbro17! |
Hi @hasbro17. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the 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. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: hasbro17 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/assign @DirectXMan12 |
While this does expose all the cobra subcommands functions, the ones strictly needed for our purposes are the Also since this effectively exposes a public API in Kubebuilder, #1042 would eventually need a fix to allow importing this as |
/ok-to-test |
@hasbro17: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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. I understand the commands that are listed here. |
EDIT: I can definitely read PR descriptions. Yep. I definitely read that whole thing and didn't skip like 2 paragraphs at the end. Nope, not at all. /hold |
This makes me inherently nervous, since it means that things are depending on the internals, more or less. Can we chat about this next week at the meeting? I was imagining prototyping would be done via "fork & custom plugin" or something similar, and then any changes to the plugin subsystem would be resubmitted. |
@DirectXMan12 Sorry, we didn't mean to catch you off guard with this. Let's chat more at the community meeting next week. We can talk through our thought process and discuss if there are any other alternatives. |
Closing this per our offline discussion to explore a different strategy of reusing the plugin interface without exposing the CLI directly. |
Description:
This restructures the cmd directory into pkgs that follows the
hierarchy of CLI subcommands. This helps to expose the
New***Command()
functionsthat return the cobra subcommands so they can be consumed by downstream
projects that need to reuse Kubebuilder CLI for scaffolding projects.
The new pkg layout for cmd:
Motivation:
This follows up on the proposal to integrate the Operator SDK with Kubebuilder.
The goal here is to expose the cobra commands for
kubebuilder init
andkubebuilder create
so that the SDK can consume them downstream in its own CLI.This allow the SDK to easily reuse Kubebuilder's scaffolding and CLI workflow.
While the plugins-based-extensions approach would still be a long term goal, consuming the Kubebuilder CLI in the SDK in the short run allows us to prototype and make changes in the SDK to make it compatible with Kubebuilder's project layout and expected workflow.