(helm/v2-alpha) `kubebuilder edit` hangs forever if dist/install.yaml is malformed
good first issuekind/bughelm/v2-alpha
## What broke? What's expected?
`extractNamespaceFromManifests` in `pkg/plugins/optional/helm/v2alpha/edit.go`
does `continue` on YAML decode errors:
```go
if err := decoder.Decode(&doc); err != nil {
if err == io.EOF {
break
}
continue
}
```
After a syntax error the yaml/v3 decoder returns the same error on every
call, so the loop never makes progress. A malformed `dist/install.yaml`
makes `kubebuilder edit --plugins=helm/v2-alpha` hang forever.
Expected: bail out on any non-EOF error and fall back to the default
namespace (`<project>-system`), as the function already does in other
failure cases.
## Suggested fix
Replace `continue` with `break`. A regression test fits next to the
existing tests in `edit_test.go`.
## KubeBuilder (CLI) Version
master (introduced by #5442)
1 条评论