apit commented on issue #852:
URL: 
https://github.com/apache/apisix-ingress-controller/issues/852#issuecomment-1025990359


   i missed adding it to scheme :speak_no_evil:
   
   ```go
   // main.go
   func init() {
     apisixv2beta3.AddToScheme(scheme)
   }
   ```
   
   Updated controller that works:
   
   ```go
   ingressRoute := &apisixv2beta3.ApisixRoute{
     TypeMeta: metav1.TypeMeta{APIVersion: 
apisixv2beta3.SchemeGroupVersion.String(), Kind: "ApisixRoute"},
     ObjectMeta: metav1.ObjectMeta{
       Name:      dapp.Name,
       Namespace: dapp.Namespace,
       Labels:    map[string]string{"dapp": dapp.Name, "author": 
dapp.Labels["author"]},
     },
     Spec: apisixv2beta3.ApisixRouteSpec{
       HTTP: []apisixv2beta3.ApisixRouteHTTP{
         {
           Name: dapp.Name,
           Match: apisixv2beta3.ApisixRouteHTTPMatch{
             Hosts: []string{dapp.Name + ".local"},
             Paths: []string{"/"},
           },
           Authentication: apisixv2beta3.ApisixRouteAuthentication{
             Enable: false,
             Type: "keyAuth",
             KeyAuth: apisixv2beta3.ApisixRouteAuthenticationKeyAuth{
               Header: "",
             },
           },
           Backends: []apisixv2beta3.ApisixRouteHTTPBackend{
             {
               ServiceName: dapp.Name,
               ServicePort: intstr.FromInt(8080),
             },
           },
         },
       },
     },
   }
   ```
   Though `Authentication` is mandatory even when the spec isn't marked so. 
   


-- 
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