kubernetes/pkg/kubelet/kubeletconfig/configfiles
obitech bba15d358c Add strict deserialization for kubelet component config
CodecFactory is started with EnableStrict that throws an error when deserializing
a Kubelet component config that is malformed (e.g. unknown or duplicate keys).

When strict decoding a v1beta1 config fails, non-strict decoding is used and a warning is emitted.
For this, NewSchemeAndCodecs is now a variadic function that can take multiple
arguments for augmenting the returned codec factory. Strict decoding is
then explicitely enabled when decoding a kubelet config.
Additionally, decoding a RemoteConfigSource needs to be non-strict
to avoid an accidental error when it contains newer API fields that are not
yet known to the Kubelet.

DecodeKubeletConfiguration returns a wrapped error instead of a simple string
so its type can be tested.

Add unit tests for unhappy paths when loading a component config

Add keys for test cases struct fields, remove nil field initialization

Co-Authored-By: Jordan Liggitt <jordan@liggitt.net>
2019-10-24 19:37:35 +02:00
..
BUILD Add strict deserialization for kubelet component config 2019-10-24 19:37:35 +02:00
configfiles_test.go Add strict deserialization for kubelet component config 2019-10-24 19:37:35 +02:00
configfiles.go Add strict deserialization for kubelet component config 2019-10-24 19:37:35 +02:00