Skip to content

Commit

Permalink
lblistener: fix updating lblistener without backend_group field
Browse files Browse the repository at this point in the history
Fixes dd01610 ("lblistener: allow setting http/https listener
backendgroup to empty")
  • Loading branch information
yousong committed Apr 24, 2020
1 parent 7688a13 commit 1224cd8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/compute/models/loadbalancerlisteners.go
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ func (lblis *SLoadbalancerListener) StartLoadBalancerListenerSyncstatusTask(ctx
func (lblis *SLoadbalancerListener) ValidateUpdateData(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data *jsonutils.JSONDict) (*jsonutils.JSONDict, error) {
ownerId := lblis.GetOwnerId()
backendGroupV := validators.NewModelIdOrNameValidator("backend_group", "loadbalancerbackendgroup", ownerId)
backendGroupV.AllowEmpty(true).Optional(true)
backendGroupV.AllowEmpty(true).Default(lblis.BackendGroupId)
if err := backendGroupV.Validate(data); err != nil {
return nil, err
}
Expand Down

0 comments on commit 1224cd8

Please sign in to comment.