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


   If my Reconciler `Create()`-d the resource using
   
   ```go
   Authentication: apisixv2beta3.ApisixRouteAuthentication{
       Enable: true,
       Type:   "keyAuth",
       KeyAuth: apisixv2beta3.ApisixRouteAuthenticationKeyAuth{
           Header: "XX",
       },
   },
   ```
   the resulting `k describe ar my-shiny-app` said:
   
   ```yaml
   Http:
       Authentication:
         Enable:  true
         Type:    keyAuth
   ```
   
   Note missing `AuthKey` field there. Though with the equivalen cli,  `kubectl 
appy -f my-shiny-app-route.yaml`, 
   ```yaml
   # my-shiny-app-route.yaml
       authentication:
         type: keyAuth
         enable: true
         keyAuth: 
           header: "XX"
   ```
   
   will result in 
   
   ```yaml
   Http:
       Authentication:
         Enable:  true
         Key Auth:
           Header:  XX
         Type:      keyAuth
   ```
   
   Another one is Reconciler `Patch()` will failed on *default* 
`Authentication` value with message `failed to create typed patch object: 
.spec.http[0].authentication.keyauth: field not declared in schema"`. The same 
error if i changed `my-shiny-app-route.yaml` key of `keyAuth` to `keyauth`. So, 
why `Create()` succeed because it ignore `Authentication` field?
   
   
   
   


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