mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-05 13:05:17 +00:00
issue 6693: partially fail restore if CSI snapshot is involved but CSI feature is not ready
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
This commit is contained in:
@@ -61,6 +61,10 @@ func (r *mockRegistry) Get(kind common.PluginKind, name string) (framework.Plugi
|
||||
return id, args.Error(1)
|
||||
}
|
||||
|
||||
func (r *mockRegistry) Find(kind common.PluginKind, name string) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func TestNewManager(t *testing.T) {
|
||||
logger := test.NewLogger()
|
||||
logLevel := logrus.InfoLevel
|
||||
|
||||
@@ -37,6 +37,9 @@ type Registry interface {
|
||||
List(kind common.PluginKind) []framework.PluginIdentifier
|
||||
// Get returns the PluginIdentifier for kind and name.
|
||||
Get(kind common.PluginKind, name string) (framework.PluginIdentifier, error)
|
||||
|
||||
// Find checks if the specified plugin exists in the registry
|
||||
Find(kind common.PluginKind, name string) bool
|
||||
}
|
||||
|
||||
// KindAndName is a convenience struct that combines a PluginKind and a name.
|
||||
@@ -125,6 +128,12 @@ func (r *registry) Get(kind common.PluginKind, name string) (framework.PluginIde
|
||||
return p, nil
|
||||
}
|
||||
|
||||
// Contain if the specified plugin exists in the registry
|
||||
func (r *registry) Find(kind common.PluginKind, name string) bool {
|
||||
_, found := r.pluginsByID[KindAndName{Kind: kind, Name: name}]
|
||||
return found
|
||||
}
|
||||
|
||||
// readPluginsDir recursively reads dir looking for plugins.
|
||||
func (r *registry) readPluginsDir(dir string) ([]string, error) {
|
||||
if _, err := r.fs.Stat(dir); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user