Prints a ton of JSON non stop
ahmetb opened this issue · comments
I just ran kubectl view-allocations -g pod
on my cluster and it prints a ton of json for many seconds that starts like
{"v":0,"name":"kubectl_view_allocations","msg":"{\"kind\":\"PodList\",\"apiVersion\":\"v1\",\"metadata\":{\"resourceVersion\":\"744704835\"},\"items\":[{\"metadata\":{\"name\":\....
I can't post a screenshot as it contains sensitive information, but I don't recall the plugin working this way.
The behavior is to log (warning, error,...) as json. So I guess that the plugin failed to get the list of pod (see at the end) and also print the response from the kube-server-api ("{\"kind\":\"PodList\",\"apiVersion\":\"v1\"
)
Can you share the end on the error message (and provide the related part of the json response from api server) to help debug and to improve the plugin ?
Can no longer repro (on a new machine, so lost the repro) but I now understand that's the format the program prints the errors as. I recommend making sure msg
field has some clear prefix before dumping the json.