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

🐛 clarify usage of alpha generate command as internal-only #4247

Conversation

camilamacedo86
Copy link
Member

@camilamacedo86 camilamacedo86 commented Oct 30, 2024

Added comments to NewScaffoldCommand to clarify that the kubebuilder alpha generate command is designed for Kubebuilder’s internal use only.

The updated go documentation explains that importing this command into other projects is not supported, as it relies on Kubebuilder-specific configurations, key mappings, and plugins, which may not be applicable to other setups.

Projects that use Kubebuilder as a library and require similar functionality should implement a custom solution for compatibility with their specific configurations and plugins.

Closes: #4200

Added comments to `NewScaffoldCommand` to clarify that the `kubebuilder alpha generate` command is designed for Kubebuilder’s internal use only.

The updated go documentation explains that importing this command into other projects is not supported, as it relies on Kubebuilder-specific configurations, key mappings, and plugins, which may not be applicable to other setups.

Projects that use Kubebuilder as a library and require similar functionality should implement a custom solution for compatibility with their specific configurations and plugins.
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: camilamacedo86

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. approved Indicates a PR has been approved by an approver from all required OWNERS files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Oct 30, 2024
@camilamacedo86
Copy link
Member Author

Hi @acornett21, JFY.

@TAM360
Copy link
Contributor

TAM360 commented Oct 30, 2024

@camilamacedo86 shouldn't this also be mentioned in the kubebuilder's official docs? Devs rely on the official website 1st before, exploring the repo.

@camilamacedo86
Copy link
Member Author

camilamacedo86 commented Oct 30, 2024

Hi @TAM360

@camilamacedo86 shouldn't this also be mentioned in the kubebuilder's official docs? Devs rely on the official website 1st before, exploring the repo.

It is only relevant for those who maintain projects which uses Kubebuilder as Lib. Example maintainers of Operator-SDK
The only doc section relevant in this case is the plugins
Also, the golang docs which will be updated when we do a new release with those changes.

So, I have no idea about where more add the info. If you have any suggestion please feel free to let us know.

@TAM360
Copy link
Contributor

TAM360 commented Oct 30, 2024

Also, the golang docs which will be updated when we do a new release with those changes.

@camilamacedo86 Go docs would be enough IMO.

@acornett21
Copy link

@camilamacedo86 Is there some unforeseen issue caused by this that I'm missing?

@camilamacedo86
Copy link
Member Author

Hi @acornett21

It seems that we are importing the alpha generated in SDK, see: https://github.com/operator-framework/operator-sdk/blob/819984d4c1a51c8ff2ef6c23944554148ace0752/website/content/en/docs/cli/operator-sdk_alpha_generate.md?plain=1#L4

If we at some point bump KB there we might want to give a look on that and ensure that we are not using this command there. It cannot work with SDK projects.

@camilamacedo86
Copy link
Member Author

I am moving forward with this one since here we are only add a comment to clarify the intent purpose of the command.
If anyone would like to propose improvements please feel free to push a PR with your suggestions.

@camilamacedo86 camilamacedo86 added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 31, 2024
@k8s-ci-robot k8s-ci-robot merged commit 64161fe into kubernetes-sigs:master Oct 31, 2024
18 checks passed
@acornett21
Copy link

It seems that we are importing the alpha generated in SDK, see: https://github.com/operator-framework/operator-sdk/blob/819984d4c1a51c8ff2ef6c23944554148ace0752/website/content/en/docs/cli/operator-sdk_alpha_generate.md?plain=1#L4

If we at some point bump KB there we might want to give a look on that and ensure that we are not using this command there. It cannot work with SDK projects.

It looks like NewScaffoldCommand() isn't used anywhere in operator-sdk and the alpha-generate cmd is just using the below

https://github.com/operator-framework/operator-sdk/blob/819984d4c1a51c8ff2ef6c23944554148ace0752/internal/cmd/operator-sdk/alpha/config3alphato3/convert_config_3-alpha_to_3.go#L28

maybe that this point this cmd should just be removed. Thanks for the callout.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Alpha Generate Command Explicitly Calls Kubebuilder Binary
4 participants