kubernetes/pkg/kubelet/kubeletconfig
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
..
checkpoint Add strict deserialization for kubelet component config 2019-10-24 19:37:35 +02:00
configfiles Add strict deserialization for kubelet component config 2019-10-24 19:37:35 +02:00
status Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
util Add strict deserialization for kubelet component config 2019-10-24 19:37:35 +02:00
BUILD Fix kubelet watches to propagate all options 2019-07-15 12:49:45 +02:00
configsync.go Clean up error messages (ST1005) 2019-08-21 10:40:21 -07:00
controller_test.go Don't compare interface values in dynamic config controller 2018-11-09 10:45:12 -08:00
controller.go Don't compare interface values in dynamic config controller 2018-11-09 10:45:12 -08:00
OWNERS Updated OWNERS files to include link to docs 2019-02-04 22:33:12 +01:00
watch.go Fix kubelet watches to propagate all options 2019-07-15 12:49:45 +02:00