Currently, when a Kubelet Plugin is being added in the DesiredStateOfWorld,
a timestamp is saved in the PluginInfo. This timestamp is then updated on
subsequent plugin reregistrations.
The Reconciler, when it detects different timestamps for a Plugin in its
DesiredStateOfWorld and ActualStateOfWorld, it will then trigger a Plugin unregister
and then a new Plugin registration.
Basically, the timestamp is being used to detect whether or not a Plugin needs to
be reregistered or not. However, this can be an issue on Windows, where the time
measurements are not as fine-grained. time.Now() calls within the same ~1-15ms
window will have the same timestamp. This can mean that Plugin Reregistration events
can be missed on Windows [1]. Because of this, some of the Plugin registration unit
tests fail on Windows.
This commit updates the behaviour, instead of relying on different timestamps,
the Reconciler will check the set PluginInfo UUID to detect a Plugin Reregistration.
With this change, the unit tests mentioned above will also pass on Windows.
[1] https://github.com/golang/go/issues/8687
Decoding to map[string]interface{} and passing the result to UnstructuredList's
SetUnstructuredContent method does not produce objects that are identical to those produced by
UnstructuredJSONScheme's decode method. UnstructuredJSONScheme's decode:
1. removes the "items" key from the map in its Object field
2. sets "apiVersion" and "kind" (determined heuristically from the list's GVK) on elements of its
Items slice that were not serialized with a nonempty string "apiVersion" and "kind"
3. returns a missing kind error if any element is missing "kind"
The original assumption is wrong, as the node name may not match the
hostname of the host in some circumstances.
Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
Tag 55799 (self-described CBOR) imparts no special semantics on the item it encloses. The CBOR
encoder always encloses its output in this tag so that the prefix 0xd9d9f7 can be used to
mechanically distinguish encoded CBOR from encoded JSON, and the decoder must be able to accept any
sequence of bytes that the encoder can produce.
When JSONFrameReader read a JSON object longer than the length of the destination slice, but not
larger than the capacity of the destination slice, it would retain a reference to a slice sharing
the same underlying array as the destination slice. If the underlying array is modified between
calls to Read, corrupt frame data could be returned.
This is also called out in the io.Reader contract: "Implementations must not retain p."