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

⚠️ cleanup/refactor: Alpha Generate command #4180

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions pkg/cli/alpha/generate.go → pkg/cli/alpha/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,13 @@ package alpha

import (
log "github.com/sirupsen/logrus"

"github.com/spf13/cobra"
"sigs.k8s.io/kubebuilder/v4/pkg/rescaffold"
"sigs.k8s.io/kubebuilder/v4/pkg/cli/alpha/internal"
)

// NewScaffoldCommand return a new scaffold command
func NewScaffoldCommand() *cobra.Command {
opts := rescaffold.MigrateOptions{}
opts := internal.Generate{}
scaffoldCmd := &cobra.Command{
Use: "generate",
Short: "Re-scaffold an existing Kuberbuilder project",
Expand All @@ -36,8 +35,8 @@ Then we will re-scaffold the project by Kubebuilder in the directory specified b
return opts.Validate()
},
Run: func(_ *cobra.Command, _ []string) {
if err := opts.Rescaffold(); err != nil {
log.Fatalf("Failed to rescaffold %s", err)
if err := opts.Generate(); err != nil {
log.Fatalf("Failed to command %s", err)
}
},
}
Expand Down
Loading
Loading