jianghushinian opened a new issue, #2153:
URL: https://github.com/apache/apisix-ingress-controller/issues/2153

   ### Current Behavior
   
   ```go
   func buildK8sApisixRoute(name, namespace string, port int32) 
*apisixv2.ApisixRoute {
        return &apisixv2.ApisixRoute{
                TypeMeta: metav1.TypeMeta{
                        APIVersion: "apisix.apache.org/v2",
                        Kind:       "ApisixRoute",
                },
                ObjectMeta: metav1.ObjectMeta{
                        Name:      name,
                        Namespace: namespace,
                },
                Spec: apisixv2.ApisixRouteSpec{
                        HTTP: []apisixv2.ApisixRouteHTTP{
                                {
                                        Name: name,
                                        Match: apisixv2.ApisixRouteHTTPMatch{
                                                Hosts: []string{"xxx"},
                                                Paths: []string{"/*"},
                                        },
                                        Backends: 
[]apisixv2.ApisixRouteHTTPBackend{
                                                {
                                                        ServiceName: name,
                                                        ServicePort: 
intstr.IntOrString{
                                                                Type:   
intstr.Int,
                                                                IntVal: port,
                                                        },
                                                },
                                        },
                                        Authentication: 
apisixv2.ApisixRouteAuthentication{
                                                Enable: false,
                                                Type:   "basicAuth",
                                        },
                                },
                        },
                },
        }
   }
   ```
   
   ### Expected Behavior
   
   success
   
   ### Error Logs
   
   ```
   ApisixRoute.apisix.apache.org "demo" is invalid: 
spec.http[0].authentication.type: Unsupported value: "": supported values: 
"basicAuth", "keyAuth", "jwtAuth", "wolfRBAC", "hmacAuth", "ldapAuth"
   ```
   
   ### Steps to Reproduce
   
   1. create apisixroutes cr
   2. failed
   
   ### Environment
   
   - APISIX Ingress controller version (run `apisix-ingress-controller version 
--long`)
   - Kubernetes cluster version (run `kubectl version`)
   - OS version if running APISIX Ingress controller in a bare-metal 
environment (run `uname -a`)
   


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