mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-06-08 23:45:40 +08:00
vpcagent: resolve ovn db address at args validation time
Until we find a reliable way to get k8s svc dns name
This commit is contained in:
@@ -19,6 +19,7 @@ import (
|
||||
|
||||
"yunion.io/x/onecloud/pkg/apis/compute"
|
||||
common_options "yunion.io/x/onecloud/pkg/cloudcommon/options"
|
||||
"yunion.io/x/onecloud/pkg/util/ovsutils"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -27,6 +28,7 @@ const (
|
||||
|
||||
const (
|
||||
ErrInvalidVpcProvider = errors.Error("invalid vpc provider")
|
||||
ErrInvalidOvnDatabase = errors.Error("invalid ovn database")
|
||||
)
|
||||
|
||||
type VpcAgentOptions struct {
|
||||
@@ -64,5 +66,11 @@ func (opts *Options) ValidateThenInit() error {
|
||||
if opts.OvnWorkerCheckInterval <= 60 {
|
||||
opts.OvnWorkerCheckInterval = 60
|
||||
}
|
||||
|
||||
if db, err := ovsutils.NormalizeDbHost(opts.OvnNorthDatabase); err != nil {
|
||||
return err
|
||||
} else {
|
||||
opts.OvnNorthDatabase = db
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user