gxthrj commented on a change in pull request #576:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/576#discussion_r666190322



##########
File path: pkg/kube/translation/apisix_route.go
##########
@@ -133,6 +134,150 @@ func (t *translator) translateHTTPRouteNotStrictly(ctx 
*TranslateContext, ar *co
        return nil
 }
 
+func (t *translator) TranslateRouteV2beta1(ar *configv2beta1.ApisixRoute) 
(*TranslateContext, error) {
+       ctx := &TranslateContext{
+               upstreamMap: make(map[string]struct{}),
+       }
+
+       if err := t.translateHTTPRouteV2beta1(ctx, ar); err != nil {
+               return nil, err
+       }
+       if err := t.translateStreamRoute(ctx, ar); err != nil {
+               return nil, err
+       }
+       return ctx, nil
+}
+
+func (t *translator) TranslateRouteV2beta1NotStrictly(ar 
*configv2beta1.ApisixRoute) (*TranslateContext, error) {
+       ctx := &TranslateContext{
+               upstreamMap: make(map[string]struct{}),
+       }
+
+       if err := t.translateHTTPRouteV2beta1NotStrictly(ctx, ar); err != nil {
+               return nil, err
+       }
+       if err := t.translateStreamRouteNotStrictly(ctx, ar); err != nil {
+               return nil, err
+       }
+       return ctx, nil
+}
+
+func (t *translator) translateHTTPRouteV2beta1(ctx *TranslateContext, ar 
*configv2beta1.ApisixRoute) error {
+       ruleNameMap := make(map[string]struct{})
+       for _, part := range ar.Spec.HTTP {
+               if _, ok := ruleNameMap[part.Name]; ok {

Review comment:
       I didn’t do this specially, because some fields were modified in the 
v2beta1 version in the [previous 
PR](https://github.com/apache/apisix-ingress-controller/pull/572), some 
pointers in v2alpha1 were removed.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to