Skip to content

Commit

Permalink
lbbackend: kvm: allow adding 'host',"ip" backend type
Browse files Browse the repository at this point in the history
For "host" type, as long as the requesting user can get access to it's
id and the validator plus userCred allows it
  • Loading branch information
yousong committed Jun 3, 2020
1 parent 97c5afd commit b6110fd
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions pkg/compute/regiondrivers/kvm.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,6 @@ func (self *SKVMRegionDriver) ValidateCreateLoadbalancerBackendData(ctx context.
basename = guest.Name
backend = backendV.Model
case api.LB_BACKEND_HOST:
if !db.IsAdminAllowCreate(userCred, man) {
return nil, httperrors.NewInputParameterError("only sysadmin can specify host as backend")
}
backendV := validators.NewModelIdOrNameValidator("backend", "host", userCred)
err := backendV.Validate(data)
if err != nil {
Expand All @@ -211,9 +208,6 @@ func (self *SKVMRegionDriver) ValidateCreateLoadbalancerBackendData(ctx context.
basename = host.Name
backend = backendV.Model
case api.LB_BACKEND_IP:
if !db.IsAdminAllowCreate(userCred, man) {
return nil, fmt.Errorf("only sysadmin can specify ip address as backend")
}
backendV := validators.NewIPv4AddrValidator("backend")
err := backendV.Validate(data)
if err != nil {
Expand Down

0 comments on commit b6110fd

Please sign in to comment.