kudobuilder / kudo

Kubernetes Universal Declarative Operator (KUDO)
https://kudo.dev
Apache License 2.0
1.18k stars 103 forks source link

Reject null parameter values rather than crash. #1608

Closed porridge closed 4 years ago

porridge commented 4 years ago

What this PR does / why we need it:

Reject in a human-friendly manner as below rather than panic with a stack trace.

$ kubectl kudo install kafka -P a.yaml 
Error: could not parse parameters: errors while unmarshaling following keys of the parameter file a.yaml: a has a null value (https://yaml.org/spec/1.2/spec.html#id2803362) which is currently not supported
$ echo $?
255

Fixes #1602

porridge commented 4 years ago

Nice! ship Though we probably need this check on the server-side (IAW) too.

I believe it crashed in the same code. The line numbers and function names differ between the stack traces because the binaries were built at different commits and there was a refactoring in the meantime.