vendor: remove dep and use vndr

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
Antonio Murdaca 2017-06-06 09:19:04 +02:00
parent 16f44674a4
commit 148e72d81e
No known key found for this signature in database
GPG key ID: B2BEAD150DE936B9
16131 changed files with 73815 additions and 4235138 deletions

View file

@ -37,6 +37,8 @@ var (
providers = make(map[string]Factory)
)
const externalCloudProvider = "external"
// RegisterCloudProvider registers a cloudprovider.Factory by name. This
// is expected to happen during app startup.
func RegisterCloudProvider(name string, cloud Factory) {
@ -85,6 +87,11 @@ func GetCloudProvider(name string, config io.Reader) (Interface, error) {
return f(config)
}
// Detects if the string is an external cloud provider
func IsExternal(name string) bool {
return name == externalCloudProvider
}
// InitCloudProvider creates an instance of the named cloud provider.
func InitCloudProvider(name string, configFilePath string) (Interface, error) {
var cloud Interface
@ -95,6 +102,11 @@ func InitCloudProvider(name string, configFilePath string) (Interface, error) {
return nil, nil
}
if IsExternal(name) {
glog.Info("External cloud provider specified")
return nil, nil
}
if configFilePath != "" {
var config *os.File
config, err = os.Open(configFilePath)