Remove k8s.io/kubernetes dependency from multus

Fix #675
This commit is contained in:
Tomofumi Hayashi
2022-04-26 18:22:36 +09:00
parent 59415ad0d6
commit c6fa047212
1399 changed files with 109058 additions and 50747 deletions

View File

@@ -47,6 +47,13 @@ type AuthProviderConfigPersister interface {
Persist(map[string]string) error
}
type noopPersister struct{}
func (n *noopPersister) Persist(_ map[string]string) error {
// no operation persister
return nil
}
// All registered auth provider plugins.
var pluginsLock sync.Mutex
var plugins = make(map[string]Factory)
@@ -69,5 +76,8 @@ func GetAuthProvider(clusterAddress string, apc *clientcmdapi.AuthProviderConfig
if !ok {
return nil, fmt.Errorf("no Auth Provider found for name %q", apc.Name)
}
if persister == nil {
persister = &noopPersister{}
}
return p(clusterAddress, apc.Config, persister)
}