-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AV-231513 HTTPRoute Rewrite Filter #1662
base: master
Are you sure you want to change the base?
Conversation
fb4f04e
to
dcf8deb
Compare
@@ -350,6 +350,13 @@ func (o *AviObjectGraph) BuildHTTPPolicySet(key string, vsNode *nodes.AviEvhVsNo | |||
utils.AviLog.Infof("key: %s, msg: Attached HTTP redirect policy to vs %s", key, vsNode.Name) | |||
return | |||
} | |||
isUrlRewritePresent := o.BuildHTTPPolicySetHTTPRequestUrlRewriteRules(key, httpPSName, vsNode, routeModel, rule.Filters, index) | |||
if isUrlRewritePresent { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RequestHeader and ResposeHeader modifier add, remove, modify headers of request / response. URLRewriteFilter works on path and hostname. These filters seems to be compatible with each other. Do we want to skip processing those?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was an older code. Have updated the recent code without skipping
|
||
func (o *AviObjectGraph) BuildHTTPPolicySetHTTPRequestUrlRewriteRules(key, httpPSname string, vsNode *nodes.AviEvhVsNode, routeModel RouteModel, filters []*Filter, index int) bool { | ||
urlRewriteAction := &models.HTTPRewriteURLAction{} | ||
isUrlRewritePresent := false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: We can avoid this variable by returning true or false.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the variable altogether
fd4862d
to
6490c68
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pkoshtavmware Changes looks good to me.
We should add few test cases:
- Ingestion test case to validate urlRewrite (This will validate our Validation logic)
- GraphLayer test case/ FT test cases where we only mention one of the urlrewrite filter (hostname/path) and check what is the behaviour.
6490c68
to
5b64a6f
Compare
@akshayhavile Added unit testcases in ingestion graph and status layer. However, validation is added in the status layer since we have recently moved httproute validation to ingestion layer |
5b64a6f
to
f56327a
Compare
build ako |
AV-231513 HTTPRoute Rewrite Filter