pkalsi97 opened a new pull request, #6423:
URL: https://github.com/apache/camel-k/pull/6423

   Closes #6422
   
   ### Summary
   When we run `kamel run --dont-run-after-build`, the operator: 
   1. Builds the integration kit
   2. Stops at `BuildComplete` phase instead of deploying
   3. Waits for you to explicitly call `kamel deploy` later
   
   #### Problem
   When an Integration/Pipe uses kamelets (like timer-source, log-sink), the 
operator creates ConfigMaps containing the kamelet templates:
   ```
   <integration-name>-kamelet-timer-source-template
   <integration-name>-kamelet-log-sink-template
   ``` 
   
   But because of current gc behaviour: Any time an integration is in 
BuildComplete → run GC → delete ConfigMaps.
   ```go
   if e.Integration.GetGeneration() > 1 || 
e.IntegrationInPhase(v1.IntegrationPhaseBuildComplete) {
       // Run garbage collection - delete resources
   }
   ``` 
   
   The old code treated both Dry Build and Undeploy the same → always deleted 
resources.
   
   #### Solution:
   Dry-build → Replicas = nil → Skip GC → ConfigMaps preserved
   Undeploy → Replicas > 0 → Run GC → Runtime resources cleaned up
   
   ```
   BEFORE FIX:
     dry-build → BuildComplete → GC runs → ConfigMaps DELETED → deploy FAILS
   AFTER FIX:
     dry-build → BuildComplete → Replicas=nil → Skip GC → ConfigMaps KEPT → 
deploy WORKS
     undeploy  → BuildComplete → Replicas>0  → Run GC   → Cleanup WORKS
   ``` 


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