diff --git a/pkg/skaffold/debug/debug_test.go b/pkg/skaffold/debug/debug_test.go index 0fc18748b6c..ed6fa22f600 100644 --- a/pkg/skaffold/debug/debug_test.go +++ b/pkg/skaffold/debug/debug_test.go @@ -592,7 +592,9 @@ status: {}`, return imageConfiguration{}, nil } - result, err := applyDebuggingTransforms(manifest.Load(bytes.NewReader([]byte(test.in))), retriever, "HELPERS") + l, err := manifest.Load(bytes.NewReader([]byte(test.in))) + t.CheckError(false, err) + result, err := applyDebuggingTransforms(l, retriever, "HELPERS") t.CheckErrorAndDeepEqual(test.shouldErr, err, test.out, result.String()) }) diff --git a/pkg/skaffold/kubernetes/manifest/manifests.go b/pkg/skaffold/kubernetes/manifest/manifests.go index aa4ab5e7a44..7bbe3b83291 100644 --- a/pkg/skaffold/kubernetes/manifest/manifests.go +++ b/pkg/skaffold/kubernetes/manifest/manifests.go @@ -36,14 +36,16 @@ func Load(in io.Reader) (ManifestList, error) { var docs [][]byte for { doc, err := r.Read() - if err == io.EOF { - break - } else { + switch { + case err == io.EOF: + return ManifestList(docs), nil + case err != nil: return nil, err + default: + docs = append(docs, doc) } - docs = append(docs, doc) } - return ManifestList(docs), nil + } func (l *ManifestList) String() string {