Skip to content

Commit 9916697

Browse files
clarify usage of alpha generate command as internal-only
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.
1 parent f7a02ad commit 9916697

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

pkg/cli/alpha/command.go

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,21 @@ import (
1919
"sigs.k8s.io/kubebuilder/v4/pkg/cli/alpha/internal"
2020
)
2121

22-
// NewScaffoldCommand return a new scaffold command
22+
// NewScaffoldCommand returns a new scaffold command, providing the `kubebuilder alpha generate`
23+
// feature to re-scaffold projects and assist users with updates.
24+
//
25+
// IMPORTANT: This command is intended solely for Kubebuilder's use, as it is designed to work
26+
// specifically within Kubebuilder's project configuration, key mappings, and plugin initialization.
27+
// Its implementation includes fixed values and logic tailored to Kubebuilder’s unique setup, which may
28+
// not apply to other projects. Consequently, importing and using this command directly in other projects
29+
// will likely result in unexpected behavior, as external projects may have different supported plugin
30+
// structures, configurations, and requirements.
31+
//
32+
// For other projects using Kubebuilder as a library, replicating similar functionality would require
33+
// a custom implementation to ensure compatibility with the specific configurations and plugins of that project.
34+
//
35+
// Technically, implementing functions that allow re-scaffolding with the exact plugins and project-specific
36+
// code of external projects is not feasible within Kubebuilder’s current design.
2337
func NewScaffoldCommand() *cobra.Command {
2438
opts := internal.Generate{}
2539
scaffoldCmd := &cobra.Command{

0 commit comments

Comments
 (0)