mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
Merge pull request #3978 from yousong/bugfix/yousong-cloudnet
cloudnet: fix router rules
This commit is contained in:
@@ -103,7 +103,7 @@ func (man *SRouteManager) ValidateCreateData(ctx context.Context, userCred mccli
|
||||
router.Name+"-"+iface.Name+"-"+rand.String(4)),
|
||||
)
|
||||
}
|
||||
return nil, nil
|
||||
return data, nil
|
||||
}
|
||||
|
||||
func (man *SRouteManager) ListItemFilter(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, query jsonutils.JSONObject) (*sqlchemy.SQuery, error) {
|
||||
|
||||
@@ -115,7 +115,7 @@ func (man *SRuleManager) validateData(ctx context.Context, userCred mcclient.Tok
|
||||
protoV := validators.NewStringChoicesValidator("match_proto", protoChoices)
|
||||
srcPortV := validators.NewPortValidator("match_src_port")
|
||||
destPortV := validators.NewPortValidator("match_dest_port")
|
||||
actionV := validators.NewStringChoicesValidator("action", protoChoices)
|
||||
actionV := validators.NewStringChoicesValidator("action", actionChoices)
|
||||
actionOptsV := validators.NewStringLenRangeValidator("action_options", 0, 256)
|
||||
if isUpdate {
|
||||
inIfnameV.Default(rule.MatchInIfname)
|
||||
@@ -200,7 +200,7 @@ func (man *SRuleManager) ValidateCreateData(ctx context.Context, userCred mcclie
|
||||
if err := man.validateData(ctx, userCred, ownerId, query, data, nil); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, nil
|
||||
return data, nil
|
||||
}
|
||||
|
||||
func (man *SRuleManager) ListItemFilter(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, query jsonutils.JSONObject) (*sqlchemy.SQuery, error) {
|
||||
|
||||
@@ -26,8 +26,8 @@ type RuleCreateOptions struct {
|
||||
MatchSrcNet string
|
||||
MatchDestNet string
|
||||
MatchProto string
|
||||
MatchSrcPort int
|
||||
MatchDestPort int
|
||||
MatchSrcPort int `json:",omitzero"`
|
||||
MatchDestPort int `json:",omitzero"`
|
||||
MatchInIfname string
|
||||
MatchOutIfname string
|
||||
|
||||
|
||||
Reference in New Issue
Block a user