panic at SpinnerLogSink.AddValues() and potentially logger.WithValues()
tiswanso opened this issue · comments
Tim Swanson commented
Describe the bug
For logger method WithValues() and SpinnerLogSink.AddValues() the values array is not checked nor allocated prior to attempting to assign to specific indices. This causes a panic that looks like:
panic: runtime error: index out of range [0] with length 0�[0m�[39m
goroutine 1 [running]:�[0m�[39m
github.com/banzaicloud/operator-tools/pkg/logger.(*SpinnerLogSink).AddValues(...)�[0m�[39m
/home/ubuntu/go/pkg/mod/github.com/banzaicloud/operator-tools@v0.28.3/pkg/logger/logsink.go:214�
Steps to reproduce the issue:
Use of SpinnerLogSink.AddValues() with non-zero len array arg.
Expected behavior
Don't crash
Screenshots
Additional context
v0.28.3
master