mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 07:47:56 +00:00
Merge pull request #7211 from anguslees/lbmethod-fix
OpenStack: lb_method required when creating LbaaS pool
This commit is contained in:
commit
0b153eb522
@ -67,6 +67,7 @@ func (d *MyDuration) UnmarshalText(text []byte) error {
|
|||||||
|
|
||||||
type LoadBalancerOpts struct {
|
type LoadBalancerOpts struct {
|
||||||
SubnetId string `gcfg:"subnet-id"` // required
|
SubnetId string `gcfg:"subnet-id"` // required
|
||||||
|
LBMethod string `gfcg:"lb-method"`
|
||||||
CreateMonitor bool `gcfg:"create-monitor"`
|
CreateMonitor bool `gcfg:"create-monitor"`
|
||||||
MonitorDelay MyDuration `gcfg:"monitor-delay"`
|
MonitorDelay MyDuration `gcfg:"monitor-delay"`
|
||||||
MonitorTimeout MyDuration `gcfg:"monitor-timeout"`
|
MonitorTimeout MyDuration `gcfg:"monitor-timeout"`
|
||||||
@ -485,10 +486,15 @@ func (lb *LoadBalancer) CreateTCPLoadBalancer(name, region string, externalIP ne
|
|||||||
return "", fmt.Errorf("unsupported load balancer affinity: %v", affinity)
|
return "", fmt.Errorf("unsupported load balancer affinity: %v", affinity)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lbmethod := lb.opts.LBMethod
|
||||||
|
if lbmethod == "" {
|
||||||
|
lbmethod = pools.LBMethodRoundRobin
|
||||||
|
}
|
||||||
pool, err := pools.Create(lb.network, pools.CreateOpts{
|
pool, err := pools.Create(lb.network, pools.CreateOpts{
|
||||||
Name: name,
|
Name: name,
|
||||||
Protocol: pools.ProtocolTCP,
|
Protocol: pools.ProtocolTCP,
|
||||||
SubnetID: lb.opts.SubnetId,
|
SubnetID: lb.opts.SubnetId,
|
||||||
|
LBMethod: lbmethod,
|
||||||
}).Extract()
|
}).Extract()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
|
Loading…
Reference in New Issue
Block a user