mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-05-06 21:52:54 +08:00
fix(region): lb redirect rule create validate (#24728)
This commit is contained in:
@@ -553,9 +553,12 @@ func (man *SLoadbalancerListenerRuleManager) ValidateCreateData(ctx context.Cont
|
||||
}
|
||||
}
|
||||
if region.GetDriver().IsSupportLoadbalancerListenerRuleRedirect() {
|
||||
_, err := validators.ValidateModel(ctx, userCred, LoadbalancerBackendGroupManager, &input.BackendGroupId)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "ValidateModel LoadbalancerBackendGroupManager")
|
||||
// backend group can be empty if you support redirect in rule
|
||||
if len(input.BackendGroupId) > 0 {
|
||||
_, err := validators.ValidateModel(ctx, userCred, LoadbalancerBackendGroupManager, &input.BackendGroupId)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "ValidateModel LoadbalancerBackendGroupManager")
|
||||
}
|
||||
}
|
||||
}
|
||||
for i := range input.BackendGroups {
|
||||
|
||||
Reference in New Issue
Block a user