Skip to content

Commit 4ba7474

Browse files
authored
Merge pull request #4848 from camilamacedo86/fix-alpha-generate
🐛 (cli)(fix): postscaffold for alpha generate should return warning (follow-up: 4843)
2 parents 74eb284 + 111456b commit 4ba7474

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

pkg/cli/alpha/internal/generate.go

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,17 @@ func (opts *Generate) Generate() error {
119119
return fmt.Errorf("error migrating deploy-image plugin: %w", err)
120120
}
121121

122-
log.Info("Running: make manifests generate fmt vet lint-fix")
123-
err = util.RunCmd("Running make targets", "make", "manifests", "generate", "fmt", "vet", "lint-fix")
124-
if err != nil {
125-
log.Error("Post-scaffold make commands failed:", err)
126-
return fmt.Errorf("post-scaffold make commands failed: %w", err)
122+
// Run make targets to ensure the project is properly set up.
123+
// These steps are performed on a best-effort basis: if any of the targets fail,
124+
// we log a warning to inform the user, but we do not stop the process or return an error.
125+
// This is to avoid blocking the migration flow due to non-critical issues during setup.
126+
targets := []string{"manifests", "generate", "fmt", "vet", "lint-fix"}
127+
for _, target := range targets {
128+
log.Infof("Running: make %s", target)
129+
err := util.RunCmd(fmt.Sprintf("Running make %s", target), "make", target)
130+
if err != nil {
131+
log.Warnf("make %s failed: %v", target, err)
132+
}
127133
}
128134

129135
return nil

0 commit comments

Comments
 (0)