fix slow dra unit test
This commit is contained in:
4
pkg/kubelet/pluginmanager/cache/types.go
vendored
4
pkg/kubelet/pluginmanager/cache/types.go
vendored
@@ -16,6 +16,8 @@ limitations under the License.
|
||||
|
||||
package cache
|
||||
|
||||
import "time"
|
||||
|
||||
// PluginHandler is an interface a client of the pluginwatcher API needs to implement in
|
||||
// order to consume plugins
|
||||
// The PluginHandler follows the simple following state machine:
|
||||
@@ -51,7 +53,7 @@ type PluginHandler interface {
|
||||
// RegisterPlugin is called so that the plugin can be registered by any
|
||||
// plugin consumer
|
||||
// Error encountered here can still be Notified to the plugin.
|
||||
RegisterPlugin(pluginName, endpoint string, versions []string) error
|
||||
RegisterPlugin(pluginName, endpoint string, versions []string, pluginClientTimeout *time.Duration) error
|
||||
// DeRegisterPlugin is called once the pluginwatcher observes that the socket has
|
||||
// been deleted.
|
||||
DeRegisterPlugin(pluginName string)
|
||||
|
||||
@@ -121,7 +121,7 @@ func (og *operationGenerator) GenerateRegisterPluginFunc(
|
||||
if err != nil {
|
||||
klog.ErrorS(err, "RegisterPlugin error -- failed to add plugin", "path", socketPath)
|
||||
}
|
||||
if err := handler.RegisterPlugin(infoResp.Name, infoResp.Endpoint, infoResp.SupportedVersions); err != nil {
|
||||
if err := handler.RegisterPlugin(infoResp.Name, infoResp.Endpoint, infoResp.SupportedVersions, nil); err != nil {
|
||||
return og.notifyPlugin(client, false, fmt.Sprintf("RegisterPlugin error -- plugin registration failed with err: %v", err))
|
||||
}
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ func (f *fakePluginHandler) ValidatePlugin(pluginName string, endpoint string, v
|
||||
}
|
||||
|
||||
// RegisterPlugin is a fake method
|
||||
func (f *fakePluginHandler) RegisterPlugin(pluginName, endpoint string, versions []string) error {
|
||||
func (f *fakePluginHandler) RegisterPlugin(pluginName, endpoint string, versions []string, pluginClientTimeout *time.Duration) error {
|
||||
f.Lock()
|
||||
defer f.Unlock()
|
||||
f.events = append(f.events, "register "+pluginName)
|
||||
|
||||
@@ -127,7 +127,7 @@ func (d *DummyImpl) ValidatePlugin(pluginName string, endpoint string, versions
|
||||
}
|
||||
|
||||
// RegisterPlugin is a dummy implementation
|
||||
func (d *DummyImpl) RegisterPlugin(pluginName string, endpoint string, versions []string) error {
|
||||
func (d *DummyImpl) RegisterPlugin(pluginName string, endpoint string, versions []string, pluginClientTimeout *time.Duration) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user