kubeconform icon indicating copy to clipboard operation
kubeconform copied to clipboard

use max initial buffer for stream scanner

Open raffis opened this issue 2 years ago • 1 comments

There is a bug related to the buffer. I have a stream of docs around 8MB and two documents fail yaml parsing. The yaml is incomplete and fails being parsed which let me to believe its related to the buffer.

If I increase the initial buffer it works perfectly fine. If I decrease the initial buffer I get even more documents which fail.

For now this pr just sets the max buffer size as initial one which is allocated. Not perfect but it works or at least raises the issue.

raffis avatar May 25 '22 10:05 raffis

Hi @raffis , think you could add the files (or a mock of the files) with an integration test that gets kubeconform to fail? Integration tests are really quite simple https://github.com/yannh/kubeconform/blob/master/acceptance.bats I am assuming that there might be a bug somewhere and that while increasing to 8MB makes this work for you, there might be another issue behind this :)

yannh avatar Jun 19 '22 16:06 yannh

Hi @raffis , I am closing this PR because of the lack of tests / information... I'd be interested in a test case that would show what you are trying to do and that fails :bow:

yannh avatar Oct 16 '22 10:10 yannh