Skip to content

Conversation

@pkalsi97
Copy link
Contributor

@pkalsi97 pkalsi97 commented Dec 12, 2025

Fixes #6340

When using dry build (--dont-run-after-build) with a Pipe, the Pipe now correctly shows 'Build Complete' phase instead of staying stuck on 'Creating'.

Changes:

  • Added PipePhaseBuildComplete constant
  • Updated monitor to handle IntegrationPhaseBuildComplete
  • Added unit test and E2E test

New Changes:

  • Updated deploy/undeploy CLI help text to clarify Pipe support
  • Skipped pipe deploy/undeploy E2E tests pending further investigation

Copy link
Contributor

@squakez squakez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work. I think we need to complement the CLI deploy and provide some test to verify that, after the user build the Pipe, can deploy the Pipe in a similar way done for the Integration. And, in that case, the flow proceed correctly.

Let me know if you want to include this in a follow up issue or you can tackle in this same PR.

@github-actions
Copy link
Contributor

⚠️ Unit test coverage report - coverage decreased from 51.6% to 51.5% (-0.1%)

@pkalsi97
Copy link
Contributor Author

@squakez I'll add it here itself in some time.

@pkalsi97
Copy link
Contributor Author

@squakez I am working on CLI deploy, I am facing some trouble in the e2e test.

When running kamel bind --dont-run-after-build followed by kamel deploy for Pipes, the deploy fails with:

kamelets trait configuration failed: ConfigMap "pipe-xxx-kamelet-log-sink-template" not found

here are the new test I am running

		t.Run("deploy the pipe", func(t *testing.T) {
			g.Expect(Kamel(t, ctx, "deploy", name, "-n", ns).Execute()).To(Succeed())
			g.Eventually(IntegrationPhase(t, ctx, ns, name), TestTimeoutMedium).Should(Equal(v1.IntegrationPhaseRunning))
			g.Eventually(PipePhase(t, ctx, ns, name), TestTimeoutMedium).Should(Equal(v1.PipePhaseReady))
			g.Eventually(Deployment(t, ctx, ns, name)).ShouldNot(BeNil())
			g.Eventually(IntegrationPodPhase(t, ctx, ns, name), TestTimeoutMedium).Should(Equal(corev1.PodRunning))
			g.Eventually(IntegrationConditionStatus(t, ctx, ns, name, v1.IntegrationConditionReady), TestTimeoutMedium).
				Should(Equal(corev1.ConditionTrue))
			g.Eventually(IntegrationLogs(t, ctx, ns, name), TestTimeoutMedium).Should(ContainSubstring("HelloPipe"))
		})
		t.Run("undeploy the pipe", func(t *testing.T) {
			g.Expect(Kamel(t, ctx, "undeploy", name, "-n", ns).Execute()).To(Succeed())
			g.Eventually(IntegrationPhase(t, ctx, ns, name), TestTimeoutMedium).Should(Equal(v1.IntegrationPhaseBuildComplete))
			g.Eventually(PipePhase(t, ctx, ns, name), TestTimeoutMedium).Should(Equal(v1.PipePhaseBuildComplete))
			g.Eventually(IntegrationPodsNumbers(t, ctx, ns, name)).Should(Equal(ptr.To(int32(0))))
			g.Eventually(Deployment(t, ctx, ns, name)).Should(BeNil())
		})

I'll look into this, I am not sure how much time it will take. do the test look good to you?

@pkalsi97
Copy link
Contributor Author

@squakez Here are some more findings

=== RUN   TestPipeBuildDontRun/build_and_dont_run_pipe
binding "pipe-deploygfnaz" created
=== RUN   TestPipeBuildDontRun/deploy_the_pipe
Integration "pipe-deploygfnaz" deployed
...
Integration Status:
  conditions:
  - message: 'error during trait customization: kamelets trait configuration failed:
      ConfigMap "pipe-deploygfnaz-kamelet-log-sink-template" not found'
    reason: InitializationFailed
    status: "False"
    type: Ready
  phase: Error
  
  generatedSources:
  - contentRef: pipe-deploygfnaz-kamelet-log-sink-template   # ConfigMap MISSING
    from-kamelet: true
    name: log-sink.yaml
  - contentRef: pipe-deploygfnaz-kamelet-timer-source-template
    from-kamelet: true
    name: timer-source.yaml
Found 0 deployments
Found 0 pods
--- FAIL: TestPipeBuildDontRun (203.80s)
    --- PASS: TestPipeBuildDontRun/build_and_dont_run_pipe (23.58s)
    --- FAIL: TestPipeBuildDontRun/deploy_the_pipe (180.07s)
FAIL

As per my understanding and looking at the flow and doing some digging my findings are that this is related to gc.go file in trait.

Explanation: I think the GC trait assumes BuildComplete phase always means "undeploy cleanup". However, BuildComplete after --dont-run-after-build is not an undeploy, it's the initial build state where resources should be preserved. Hence the Deploy step is unable to find ConfigMap.

Let me know if you resonate with this findinding. We can create an issue and deal with it in a separate PR.

@squakez
Copy link
Contributor

squakez commented Dec 14, 2025

@pkalsi97 you may have a look at the PR which introduced the Integration dry-build: #6339 - in theory the gc trait would only affect Integration lifecycle, so, already managed by the Integration. However, it could be exactly a bug. Please, try the dry-build with an Integration with a kamelet to confirm it's a bug we're suffering that. In such case, please, just open a new bug issue to be fixed eventually and we can merge this. If you already have the code to deploy/undeploy the Pipe I think we can include it here, and leave the e2e test as well but temporary disabled until the confimap issue is solved. Thanks!

@pkalsi97 pkalsi97 changed the title feat(ctrl): dry build - support Pipe BuildComplete phase feat(ctrl): dry build - support Pipe BuildComplete phase and deploy/undeploy CLI Dec 14, 2025
@pkalsi97
Copy link
Contributor Author

pkalsi97 commented Dec 14, 2025

@squakez Thanks for the input. Please take a look at the deploy/undeploy and let me know if it needs any changes.

I'll refer to the PR mentioned above and investigate further to figure out why exactly these test are failing. If I am able to find a bug I'll raise the issue and PR fix.

Alternatively we can directly create an issue stating that these e2e test are being skipped and we need to investigate further why they are failing and how they can be fixed.

@squakez squakez merged commit 0e13fc0 into apache:main Dec 15, 2025
10 checks passed
@pkalsi97 pkalsi97 deleted the fix/6340 branch December 15, 2025 08:06
@pkalsi97 pkalsi97 mentioned this pull request Dec 15, 2025
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 - support Pipe

3 participants