Skip to content

Conversation

@pkalsi97
Copy link
Contributor

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.

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

@github-actions
Copy link
Contributor

✔️ Unit test coverage report - coverage increased from 51.6% to 51.7% (+0.1%)

@pkalsi97 pkalsi97 force-pushed the fix/Dry-build-deploy-fails branch from bbd1e65 to 6b4e463 Compare December 15, 2025 16:46
@pkalsi97
Copy link
Contributor Author

Changes I have made after feedback

  1. Add hasNeverDeployed() - Uses two checks, DeployTimestamp and Ready condition's FirstTruthyTime
  2. Added some unit test
  3. Added an extra e2e test to ensure this works reliably.

@github-actions
Copy link
Contributor

✔️ Unit test coverage report - coverage increased from 51.6% to 51.7% (+0.1%)

@squakez squakez merged commit c8c513a into apache:main Dec 16, 2025
10 checks passed
@pkalsi97 pkalsi97 deleted the fix/Dry-build-deploy-fails branch December 16, 2025 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dry-build deploy fails

2 participants