You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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] golang/go#8687
oe.RegisterPlugin(socketPath, time.Now(), nil/* plugin handlers */, nil/* actual state of the world updator */)
63
+
64
+
// First registration should not fail.
65
+
err:=oe.RegisterPlugin(socketPath, uuid.NewUUID(), nil/* plugin handlers */, nil/* actual state of the world updator */)
66
+
assert.NoError(t, err)
67
+
68
+
fori:=1; i<numPluginsToRegister; i++ {
69
+
err:=oe.RegisterPlugin(socketPath, uuid.NewUUID(), nil/* plugin handlers */, nil/* actual state of the world updator */)
70
+
iferr==nil {
71
+
t.Fatalf("RegisterPlugin did not fail. Expected: <Failed to create operation with name \"%s\". An operation with that name is already executing.> Actual: <no error>", socketPath)
0 commit comments