Skip to content

Commit

Permalink
Backport: internal/util/yamlutil: fix empty yaml bug (#1258) (#1273)
Browse files Browse the repository at this point in the history
* internal/util/yamlutil: fix empty yaml bug (#1258)

* CHANGELOG.md: update changelog
  • Loading branch information
AlexNPavel authored Apr 2, 2019
1 parent 43f4ecc commit 1ede19f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

### Bug Fixes

- Fix bug in the YAML scanner used by `operator-sdk test` and `operator-sdk scorecard` that could result in a panic if a manifest file started with `---` ([#1258](https://github.com/operator-framework/operator-sdk/pull/1258))

## v0.6.0

### Added
Expand Down
2 changes: 1 addition & 1 deletion internal/util/yamlutil/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func (s *Scanner) Scan() bool {
s.err = err
return false
}
if tok == nil {
if len(bytes.TrimSpace(tok)) == 0 {
s.empties++
if s.empties > maxExecutiveEmpties {
panic("yaml.Scan: too many empty tokens without progressing")
Expand Down

0 comments on commit 1ede19f

Please sign in to comment.