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

   ### Bug description
   
   If `kamel deploy routes` overlaps with `kamel rebuild routes`, the deploy 
command can report success and leave the Integration in `Deploying` with an 
empty image and no IntegrationKit. The operator then reports `no kit nor 
container image set on integration routes`.
   
   The ordering matters. I reproduced it on main in a Go test using the 
controller-runtime fake client with the Integration status subresource enabled. 
The test exercises the same status operations as the two commands:
   
   1. Start with `routes` in `Build Complete` with a populated status image. 
Read it as `kamel deploy` does and prepare the transition with 
`SetDeployingPhase()`.
   2. Before sending the deploy patch, clear the status with `Status().Update`, 
as `kamel rebuild` does.
   3. Send the deploy patch with `Status().Patch(ctx, deploy, 
client.MergeFrom(original))`, using the copy from step 1.
   
   The patch succeeds. Reading the Integration back gives phase `Deploying` 
with an empty image, and the monitor returns the error above. Once the rebuild 
clears the status, the pending deploy should report the conflict and leave the 
rebuild in control. Deploying an Integration that is still in `Build Complete` 
should continue to succeed.
   
   This is a separate CLI writer from the controller in #7000. [Deploy status 
patch](https://github.com/apache/camel-k/blob/a12c64f68f9ca4a791f4529770f02c1a706de36a/pkg/cmd/deploy.go#L67-L94)
 ยท [Rebuild status 
reset](https://github.com/apache/camel-k/blob/a12c64f68f9ca4a791f4529770f02c1a706de36a/pkg/cmd/rebuild.go#L106-L114)
   
   ### Camel K or runtime version
   
   Camel K main at a12c64f68f9ca4a791f4529770f02c1a706de36a.
   
   _AI-generated by OpenAI Codex on behalf of @AkhDmitrii._
   


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