2018-06-06 19:11:47 +02:00
|
|
|
package custom
|
|
|
|
|
2020-07-11 09:24:19 -07:00
|
|
|
import v3 "github.com/rancher/rke/types"
|
2018-06-06 19:11:47 +02:00
|
|
|
|
|
|
|
type CloudProvider struct {
|
|
|
|
Name string
|
|
|
|
Config string
|
|
|
|
}
|
|
|
|
|
|
|
|
func GetInstance() *CloudProvider {
|
|
|
|
return &CloudProvider{}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *CloudProvider) Init(cloudProviderConfig v3.CloudProvider) error {
|
|
|
|
p.Name = cloudProviderConfig.Name
|
|
|
|
p.Config = cloudProviderConfig.CustomCloudProvider
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *CloudProvider) GetName() string {
|
|
|
|
return p.Name
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *CloudProvider) GenerateCloudConfigFile() (string, error) {
|
|
|
|
return p.Config, nil
|
|
|
|
}
|