AlinsRan opened a new pull request, #2902:
URL: https://github.com/apache/apisix-ingress-controller/pull/2902

   ### Type of change:
   
   - [x] Bugfix (flaky e2e test)
   
   ### What this PR does / why we need it:
   
   The TCPRoute/UDPRoute e2e specs fetch an object with `kubectl get -o yaml` 
and pass that yaml to `ResourceApplied`, which runs `kubectl apply` on it 
again. The fetched yaml carries the server `resourceVersion`. If the controller 
writes the object (status update, `gc-protection` finalizer) between the get 
and the apply, the apiserver rejects the patch:
   
   ```
   Operation cannot be fulfilled on gatewayclasses.gateway.networking.k8s.io 
"ingress-apisix-e2e-tests-default-681954318":
   the object has been modified; please apply your changes to the latest 
version and try again
   ```
   
   Seen in 
https://github.com/apache/apisix-ingress-controller/actions/runs/37904133535/job/113733392133
 (`UDPRoute Base [BeforeEach]`, `creating GatewayClass`).
   
   This PR passes the original spec to `ResourceApplied` instead. 
`ResourceApplied` already applies the resource and then waits for `status: 
"True"` / `observedGeneration`, so the separate create + get steps are dropped. 
These were the only four call sites that re-applied server-fetched yaml:
   
   - `test/e2e/gatewayapi/udproute.go`: GatewayClass, Gateway, UDPRoute
   - `test/e2e/gatewayapi/tcproute.go`: TCPRoute
   
   ### Pre-submission checklist:
   
   - [x] Did you explain what problem does this PR solve? Or what new features 
have been added?
   - [ ] Have you added corresponding test cases?
   - [ ] Have you modified the corresponding document?
   - [x] Is this PR backward compatible? If it is not backward compatible, 
please discuss on the mailing list first
   


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