Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

🌱 cleanup/refactor: Alpha Generate command #4180

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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