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

   ### Issue description
   
   update apisixroute.yaml spec.http.name from a981a76 to api,Sometimes two 
routes are generated
   
   `kubectl get ar -A |grep screensaver`  ,only one data
   
![image](https://user-images.githubusercontent.com/19382017/165519896-7c219f31-b895-4234-aba8-2957ddb08bb5.png)
   
   However, there are two data on dashboard, apisix-Ingress-Controller's log is 
missing, so I can't find the problem now .
   
![image](https://user-images.githubusercontent.com/19382017/165520165-27fcd25f-a825-4d67-9c1a-f04660038b6d.png)
   
   Etcd has some of the same data,Id and name are different
   routes/5341fe35
   
{"status":1,"uris":["\/business-screensaver\/*"],"hosts":["****"],"upstream_id":"e0a2d230","desc":"Created
 by apisix-ingress-controller, DO NOT modify it 
manually","update_time":1650358919,"create_time":1650358919,"priority":0,"id":"5341fe35","name":"****-business-screensaver_api","labels":{"managed-by":"apisix-ingress-controller"},"plugins":{"proxy-rewrite":{"regex_uri":["****business-screensaver\/(.*)","\/$1"]}}}
   
   routes/31f041fe
   
{"status":1,"uris":["\/business-screensaver\/*"],"hosts":["****"],"upstream_id":"e0a2d230","desc":"Created
 by apisix-ingress-controller, DO NOT modify it 
manually","update_time":1649379005,"create_time":1649379005,"priority":0,"id":"31f041fe","name":"*****business-screensaver_a981a76","labels":{"managed-by":"apisix-ingress-controller"},"plugins":{"proxy-rewrite":{"regex_uri":["^\****business-screensaver\/(.*)","\/$1"]}}}
   
   Currently, only this route is found to be faulty.  All other routes change 
spec.http.name to API, and only change the original data a981a76 does not 
generate a new route entry 。
   
   It is not clear when apisix-Controller creates a new route entry, and when 
does it modify the original data  
   
   
   At present, only the phenomenon can be seen, but it is not clear how to 
troubleshoot and reappear,Ask for Help
   
   ### Environment
   
   - your apisix-ingress-controller version (output of 
apisix-ingress-controller version --long):
   - your Kubernetes cluster version (output of kubectl version):
   - if you run apisix-ingress-controller in Bare-metal environment, also show 
your OS version (uname -a):
   
   
   ### Minimal test code / Steps to reproduce
   
   ```yaml1
   {{- if .Values.apisixroute.enabled -}}
   apiVersion: apisix.apache.org/v2beta3
   kind: ApisixRoute
   metadata:
     name: {{ include "test.fullname" . }}
   spec:
     http:
     - name: a981a76
       match:
         hosts:
         - "{{ .Values.apisixroute.host }}"
         paths:
         - "{{ .Values.apisixroute.path }}*"
       plugins: 
       - name: proxy-rewrite
         enable: true 
         config: 
           regex_uri: ["^{{ .Values.apisixroute.path }}(.*)", "/$1"]
       backends:
       - serviceName: "{{ include "test.fullname" . }}"
         servicePort: 80
   {{- end -}}
   ```
   ```yaml2
   {{- if .Values.apisixroute.enabled -}}
   apiVersion: apisix.apache.org/v2beta3
   kind: ApisixRoute
   metadata:
     name: {{ include "test.fullname" . }}
   spec:
     http:
     - name: api
       match:
         hosts:
         - "{{ .Values.apisixroute.host }}"
         paths:
         - "{{ .Values.apisixroute.path }}*"
       plugins: 
       - name: proxy-rewrite
         enable: true 
         config: 
           regex_uri: ["^{{ .Values.apisixroute.path }}(.*)", "/$1"]
       backends:
       - serviceName: "{{ include "test.fullname" . }}"
         servicePort: 80
   {{- end -}}
   ```
   Render yamL1 template with helm changed to render YamL2 template with helm  
   
   ### Actual result
   
   The dashboard produces two identical servername and path
   
![image](https://user-images.githubusercontent.com/19382017/165524603-ba1544da-509a-46d8-9f32-07eec6b1164c.png)
   
![image](https://user-images.githubusercontent.com/19382017/165525754-4873baf2-934c-4704-b327-8fbfaa69b91e.png)
   
   Etcd has some of the same data,Id and name are different
   routes/5341fe35
   
{"status":1,"uris":["\/business-screensaver\/*"],"hosts":["****"],"upstream_id":"e0a2d230","desc":"Created
 by apisix-ingress-controller, DO NOT modify it 
manually","update_time":1650358919,"create_time":1650358919,"priority":0,"id":"5341fe35","name":"****-business-screensaver_api","labels":{"managed-by":"apisix-ingress-controller"},"plugins":{"proxy-rewrite":{"regex_uri":["****business-screensaver\/(.*)","\/$1"]}}}
   
   routes/31f041fe
   
{"status":1,"uris":["\/business-screensaver\/*"],"hosts":["****"],"upstream_id":"e0a2d230","desc":"Created
 by apisix-ingress-controller, DO NOT modify it 
manually","update_time":1649379005,"create_time":1649379005,"priority":0,"id":"31f041fe","name":"*****business-screensaver_a981a76","labels":{"managed-by":"apisix-ingress-controller"},"plugins":{"proxy-rewrite":{"regex_uri":["^\****business-screensaver\/(.*)","\/$1"]}}}
   
   ### Error log
   
   There is no error log
   [GIN] 2022/04/27 - 20:44:33 | 200 |      27.103µs |     169.254.1.1 | GET    
  "/healthz"
   [GIN] 2022/04/27 - 20:44:43 | 200 |      30.804µs |     169.254.1.1 | GET    
  "/healthz"
   [GIN] 2022/04/27 - 20:44:43 | 200 |      26.288µs |     169.254.1.1 | GET    
  "/healthz"
   [GIN] 2022/04/27 - 20:44:53 | 200 |        27.1µs |     169.254.1.1 | GET    
  "/healthz"
   [GIN] 2022/04/27 - 20:44:53 | 200 |       27.51µs |     169.254.1.1 | GET    
  "/healthz"
   [GIN] 2022/04/27 - 20:45:03 | 200 |      29.087µs |     169.254.1.1 | GET    
  "/healthz"
   [GIN] 2022/04/27 - 20:45:03 | 200 |      24.202µs |     169.254.1.1 | GET    
  "/healthz"
   [GIN] 2022/04/27 - 20:45:13 | 200 |      24.406µs |     169.254.1.1 | GET    
  "/healthz"
   [GIN] 2022/04/27 - 20:45:13 | 200 |      28.976µs |     169.254.1.1 | GET    
  "/healthz"
   W0427 20:45:16.346147       1 warnings.go:70] apisix.apache.org/v2beta1 
ApisixRoute is deprecated; use apisix.apache.org/v2beta3 ApisixRoute
   [GIN] 2022/04/27 - 20:45:23 | 200 |       29.95µs |     169.254.1.1 | GET    
  "/healthz"
   [GIN] 2022/04/27 - 20:45:23 | 200 |      24.161µs |     169.254.1.1 | GET    
  "/healthz"
   [GIN] 2022/04/27 - 20:45:33 | 200 |      34.457µs |     169.254.1.1 | GET    
  "/healthz"
   [GIN] 2022/04/27 - 20:45:33 | 200 |      24.054µs |     169.254.1.1 | GET    
  "/healthz"
   [GIN] 2022/04/27 - 20:45:43 | 200 |       26.65µs |     169.254.1.1 | GET    
  "/healthz"
   [GIN] 2022/04/27 - 20:45:43 | 200 |      24.778µs |     169.254.1.1 | GET    
  "/healthz"
   [GIN] 2022/04/27 - 20:45:53 | 200 |      31.825µs |     169.254.1.1 | GET    
  "/healthz"
   [GIN] 2022/04/27 - 20:45:53 | 200 |      21.546µs |     169.254.1.1 | GET    
  "/healthz"
   [GIN] 2022/04/27 - 20:46:03 | 200 |      28.885µs |     169.254.1.1 | GET    
  "/healthz"
   [GIN] 2022/04/27 - 20:46:03 | 200 |       23.01µs |     169.254.1.1 | GET    
  "/healthz"
   [GIN] 2022/04/27 - 20:46:13 | 200 |      24.818µs |     169.254.1.1 | GET    
  "/healthz"
   [GIN] 2022/04/27 - 20:46:13 | 200 |      22.304µs |     169.254.1.1 | GET    
  "/healthz"
   
   ### Expected result
   
   Update the apisixRoute spec.http.name field and only one route appears  


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