knockknock10 opened a new issue, #6943:
URL: https://github.com/apache/camel-k/issues/6943

   ### Bug description
   
   I was checking how the deployer and GC traits work during an Integration 
update and came across this case.
   
   When applying a new Deployment fails, the GC action still runs. This can 
cause the previous Deployment to be deleted even though the new one was not 
applied successfully.
   
   I looked into `trait.Apply()` in `pkg/trait/trait.go` and found that it 
continues executing the remaining post-actions even when one of them returns an 
error.
   
   I reproduced this on the current main branch using a fake client. When I 
made the new Deployment update fail, `trait.Apply()` returned an error, but the 
previous Deployment was still deleted.
   
   The relevant code is in:
   - `pkg/trait/trait.go`
   - `pkg/trait/deployer.go`
   - `pkg/trait/gc.go`
   
   The reproduction test is in `pkg/trait/gc_test.go`.
   
   Would it make sense to skip GC when the deployer action fails, so the 
previous Deployment isn't removed before the new one is applied successfully?
   
   ### Camel K or runtime version
   
   40c6bb4a86e115446544f5c95c4a747bfa913c9d


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