added loadbalancer
This commit is contained in:
parent
90c5f8e98e
commit
bd94056453
9 changed files with 371 additions and 113 deletions
|
|
@ -31,6 +31,10 @@ func init() {
|
|||
_ = clientgoscheme.AddToScheme(scheme)
|
||||
}
|
||||
|
||||
type config struct {
|
||||
PVE pve.Config `json:"pve"`
|
||||
}
|
||||
|
||||
func main() {
|
||||
rand.Seed(time.Now().UnixNano())
|
||||
klog.InitFlags(nil)
|
||||
|
|
@ -85,17 +89,17 @@ func main() {
|
|||
}
|
||||
|
||||
var opts []pve.ClientOption
|
||||
config, err := os.Open(cloudConfig)
|
||||
cr, err := os.Open(cloudConfig)
|
||||
if err == nil {
|
||||
buf, _ := ioutil.ReadAll(config)
|
||||
buf, _ := ioutil.ReadAll(cr)
|
||||
if len(buf) != 0 {
|
||||
var cfg pve.Config
|
||||
var cfg config
|
||||
err = json.Unmarshal(buf, &cfg)
|
||||
if err != nil {
|
||||
setupLog.Error(err, "failed to read config file")
|
||||
os.Exit(1)
|
||||
}
|
||||
opts, err = pve.ClientOptionsFromConfig(cfg)
|
||||
opts, err = pve.ClientOptionsFromConfig(cfg.PVE)
|
||||
if err != nil {
|
||||
setupLog.Error(err, "failed to create client options from file")
|
||||
os.Exit(1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue