You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by pc...@apache.org on 2025/12/15 08:05:16 UTC
(camel-k) branch main updated (b4346a735 -> 0e13fc0a9)
This is an automated email from the ASF dual-hosted git repository.
pcongiusti pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git
from b4346a735 fix(e2e): add camel-kubernetes dependency for plain-quarkus compatibility
new 4d7fd196c feat(ctrl): dry build - support Pipe BuildComplete phase
new e78e4cf58 fix(cmd): clarify deploy/undeploy support for Integrations and Pipes
new 0e13fc0a9 fix(cmd): remove flag reference from deploy command description
The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
e2e/common/cli/deploy_test.go | 40 +++++++++++++++++++++++++++++++++
pkg/apis/camel/v1/pipe_types.go | 2 ++
pkg/cmd/deploy.go | 9 ++++----
pkg/cmd/deploy_test.go | 4 ++--
pkg/cmd/undeploy.go | 8 +++----
pkg/cmd/undeploy_test.go | 2 +-
pkg/controller/pipe/monitor.go | 13 ++++++++++-
pkg/controller/pipe/monitor_test.go | 44 +++++++++++++++++++++++++++++++++++++
8 files changed, 109 insertions(+), 13 deletions(-)
(camel-k) 02/03: fix(cmd): clarify deploy/undeploy support for Integrations and Pipes
Posted by pc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
pcongiusti pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit e78e4cf58e03f7ac7b6c4746bc87fcd7ec958d55
Author: Pranjul Kalsi <pr...@gmail.com>
AuthorDate: Sun Dec 14 15:16:26 2025 +0530
fix(cmd): clarify deploy/undeploy support for Integrations and Pipes
---
e2e/common/cli/deploy_test.go | 19 +++++++++++++++++++
pkg/cmd/deploy.go | 9 ++++-----
pkg/cmd/deploy_test.go | 4 ++--
pkg/cmd/undeploy.go | 8 ++++----
pkg/cmd/undeploy_test.go | 2 +-
5 files changed, 30 insertions(+), 12 deletions(-)
diff --git a/e2e/common/cli/deploy_test.go b/e2e/common/cli/deploy_test.go
index 4f7a907b5..3be66f585 100644
--- a/e2e/common/cli/deploy_test.go
+++ b/e2e/common/cli/deploy_test.go
@@ -87,5 +87,24 @@ func TestPipeBuildDontRun(t *testing.T) {
g.Eventually(PipeCondition(t, ctx, ns, name, v1.PipeConditionReady), TestTimeoutShort).Should(
WithTransform(PipeConditionReason, Equal("BuildComplete")))
})
+ t.Run("deploy the pipe", func(t *testing.T) {
+ t.Skip("Skipping: deploy/undeploy pipe lifecycle needs further investigation")
+ 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) {
+ t.Skip("Skipping: deploy/undeploy pipe lifecycle needs further investigation")
+ 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())
+ })
})
}
diff --git a/pkg/cmd/deploy.go b/pkg/cmd/deploy.go
index f44e09b74..8249110cf 100644
--- a/pkg/cmd/deploy.go
+++ b/pkg/cmd/deploy.go
@@ -32,9 +32,8 @@ func newCmdDeploy(rootCmdOptions *RootCmdOptions) (*cobra.Command, *deployCmdOpt
RootCmdOptions: rootCmdOptions,
}
cmd := cobra.Command{
- Use: "deploy my-it",
- Short: "Deploy an Integration",
- Long: "Deploy an Integration that was previously built",
+ Use: "deploy <name>",
+ Short: "Deploy an Integration or Pipe that was previously built with --dont-run-after-build flag",
PreRunE: decode(&options, options.Flags),
RunE: options.run,
}
@@ -48,7 +47,7 @@ type deployCmdOptions struct {
func (o *deployCmdOptions) validate(_ *cobra.Command, args []string) error {
if len(args) != 1 {
- return errors.New("deploy requires an Integration name argument")
+ return errors.New("deploy requires an Integration or Pipe name argument")
}
return nil
@@ -67,7 +66,7 @@ func (o *deployCmdOptions) run(cmd *cobra.Command, args []string) error {
existing, err := getIntegration(o.Context, c, name, o.Namespace)
if err != nil {
- return fmt.Errorf("could not get Integration "+name+": %w", err)
+ return fmt.Errorf("could not get Integration or Pipe "+name+": %w", err)
}
if existing.Status.Phase != v1.IntegrationPhaseBuildComplete {
return fmt.Errorf("could not run an Integration in %s status", existing.Status.Phase)
diff --git a/pkg/cmd/deploy_test.go b/pkg/cmd/deploy_test.go
index dfe4934df..066190c63 100644
--- a/pkg/cmd/deploy_test.go
+++ b/pkg/cmd/deploy_test.go
@@ -60,14 +60,14 @@ func TestDeployMissingInput(t *testing.T) {
cmd, _ := initializeDeployCmdOptions(t)
_, err := ExecuteCommand(cmd, cmdDeploy)
require.Error(t, err)
- assert.Equal(t, "deploy requires an Integration name argument", err.Error())
+ assert.Equal(t, "deploy requires an Integration or Pipe name argument", err.Error())
}
func TestDeployMissingIntegration(t *testing.T) {
cmd, _ := initializeDeployCmdOptions(t)
_, err := ExecuteCommand(cmd, cmdDeploy, "missing-it")
require.Error(t, err)
- assert.Equal(t, "could not get Integration missing-it: integrations.camel.apache.org \"missing-it\" not found", err.Error())
+ assert.Equal(t, "could not get Integration or Pipe missing-it: integrations.camel.apache.org \"missing-it\" not found", err.Error())
}
func TestDeployCantDeployRunningIntegration(t *testing.T) {
diff --git a/pkg/cmd/undeploy.go b/pkg/cmd/undeploy.go
index 92039df85..fcb7495da 100644
--- a/pkg/cmd/undeploy.go
+++ b/pkg/cmd/undeploy.go
@@ -33,9 +33,9 @@ func newCmdUndeploy(rootCmdOptions *RootCmdOptions) (*cobra.Command, *undeployCm
RootCmdOptions: rootCmdOptions,
}
cmd := cobra.Command{
- Use: "undeploy [integration1] [integration2] ...",
- Short: "Undeploy one or more integrations previously deployed.",
- Long: `Clear the state of one or more integrations causing them to move back to a Build Complete status.`,
+ Use: "undeploy [name1] [name2] ...",
+ Short: "Undeploy one or more Integrations or Pipes previously deployed.",
+ Long: `Clear the state of one or more Integrations or Pipes causing them to move back to a Build Complete status.`,
PreRunE: decode(&options, options.Flags),
RunE: func(cmd *cobra.Command, args []string) error {
if err := options.validate(args); err != nil {
@@ -55,7 +55,7 @@ type undeployCmdOptions struct {
func (o *undeployCmdOptions) validate(args []string) error {
if len(args) == 0 {
- return errors.New("undeploy requires an Integration name argument")
+ return errors.New("undeploy requires an Integration or Pipe name argument")
}
return nil
diff --git a/pkg/cmd/undeploy_test.go b/pkg/cmd/undeploy_test.go
index 2649fb8e7..380c6d851 100644
--- a/pkg/cmd/undeploy_test.go
+++ b/pkg/cmd/undeploy_test.go
@@ -60,7 +60,7 @@ func TestUndeployNoArgs(t *testing.T) {
cmd, _ := initializeUndeployCmdOptions(t)
_, err := ExecuteCommand(cmd, cmdUndeploy)
require.Error(t, err)
- assert.Equal(t, "undeploy requires an Integration name argument", err.Error())
+ assert.Equal(t, "undeploy requires an Integration or Pipe name argument", err.Error())
}
func TestUndeployMissingIntegrations(t *testing.T) {
(camel-k) 01/03: feat(ctrl): dry build - support Pipe BuildComplete phase
Posted by pc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
pcongiusti pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit 4d7fd196cc494e48d23182d4799fe8b569051eb1
Author: Pranjul Kalsi <pr...@gmail.com>
AuthorDate: Sat Dec 13 00:40:43 2025 +0530
feat(ctrl): dry build - support Pipe BuildComplete phase
---
e2e/common/cli/deploy_test.go | 21 ++++++++++++++++++
pkg/apis/camel/v1/pipe_types.go | 2 ++
pkg/controller/pipe/monitor.go | 13 ++++++++++-
pkg/controller/pipe/monitor_test.go | 44 +++++++++++++++++++++++++++++++++++++
4 files changed, 79 insertions(+), 1 deletion(-)
diff --git a/e2e/common/cli/deploy_test.go b/e2e/common/cli/deploy_test.go
index 88f407fcf..4f7a907b5 100644
--- a/e2e/common/cli/deploy_test.go
+++ b/e2e/common/cli/deploy_test.go
@@ -68,3 +68,24 @@ func TestBuildDontRun(t *testing.T) {
})
})
}
+
+func TestPipeBuildDontRun(t *testing.T) {
+ t.Parallel()
+ WithNewTestNamespace(t, func(ctx context.Context, g *WithT, ns string) {
+ name := RandomizedSuffixName("pipe-deploy")
+ t.Run("build and dont run pipe", func(t *testing.T) {
+ g.Expect(KamelBind(t, ctx, ns, "timer-source?message=HelloPipe", "log-sink",
+ "--name", name,
+ "--annotation", "camel.apache.org/dont-run-after-build=true",
+ ).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.Consistently(IntegrationPhase(t, ctx, ns, name), 10*time.Second).Should(Equal(v1.IntegrationPhaseBuildComplete))
+ g.Consistently(PipePhase(t, ctx, ns, name), 10*time.Second).Should(Equal(v1.PipePhaseBuildComplete))
+ g.Eventually(Deployment(t, ctx, ns, name)).Should(BeNil())
+ // Pipe condition should indicate build is complete
+ g.Eventually(PipeCondition(t, ctx, ns, name, v1.PipeConditionReady), TestTimeoutShort).Should(
+ WithTransform(PipeConditionReason, Equal("BuildComplete")))
+ })
+ })
+}
diff --git a/pkg/apis/camel/v1/pipe_types.go b/pkg/apis/camel/v1/pipe_types.go
index a61eca0ce..ccdb7ff19 100644
--- a/pkg/apis/camel/v1/pipe_types.go
+++ b/pkg/apis/camel/v1/pipe_types.go
@@ -159,6 +159,8 @@ const (
PipePhaseError PipePhase = "Error"
// PipePhaseReady --.
PipePhaseReady PipePhase = "Ready"
+ // PipePhaseBuildComplete --.
+ PipePhaseBuildComplete PipePhase = "Build Complete"
)
// +kubebuilder:object:root=true
diff --git a/pkg/controller/pipe/monitor.go b/pkg/controller/pipe/monitor.go
index 8d16d4aa7..f75e5af7d 100644
--- a/pkg/controller/pipe/monitor.go
+++ b/pkg/controller/pipe/monitor.go
@@ -48,7 +48,8 @@ func (action *monitorAction) Name() string {
func (action *monitorAction) CanHandle(pipe *v1.Pipe) bool {
return pipe.Status.Phase == v1.PipePhaseCreating ||
pipe.Status.Phase == v1.PipePhaseError ||
- pipe.Status.Phase == v1.PipePhaseReady
+ pipe.Status.Phase == v1.PipePhaseReady ||
+ pipe.Status.Phase == v1.PipePhaseBuildComplete
}
func (action *monitorAction) Handle(ctx context.Context, pipe *v1.Pipe) (*v1.Pipe, error) {
@@ -128,6 +129,16 @@ func (action *monitorAction) Handle(ctx context.Context, pipe *v1.Pipe) (*v1.Pip
target.Status.Phase = v1.PipePhaseError
setPipeReadyCondition(target, &it)
+ case v1.IntegrationPhaseBuildComplete:
+ target.Status.Phase = v1.PipePhaseBuildComplete
+ c := v1.PipeCondition{
+ Type: v1.PipeConditionReady,
+ Status: corev1.ConditionFalse,
+ Reason: "BuildComplete",
+ Message: fmt.Sprintf("Integration %q build completed successfully", it.GetName()),
+ }
+ target.Status.SetConditions(c)
+
default:
target.Status.Phase = v1.PipePhaseCreating
diff --git a/pkg/controller/pipe/monitor_test.go b/pkg/controller/pipe/monitor_test.go
index 543a918f9..ba2269b2b 100644
--- a/pkg/controller/pipe/monitor_test.go
+++ b/pkg/controller/pipe/monitor_test.go
@@ -376,3 +376,47 @@ func TestPipeIntegrationPipeTraitAnnotations(t *testing.T) {
assert.Equal(t, corev1.ConditionFalse, handledPipe.Status.GetCondition(v1.PipeConditionReady).Status)
assert.Equal(t, "Integration \"my-pipe\" is in \"Creating\" phase", handledPipe.Status.GetCondition(v1.PipeConditionReady).Message)
}
+
+func TestPipeIntegrationBuildComplete(t *testing.T) {
+ pipe := &v1.Pipe{
+ TypeMeta: metav1.TypeMeta{
+ APIVersion: v1.SchemeGroupVersion.String(),
+ Kind: v1.PipeKind,
+ },
+ ObjectMeta: metav1.ObjectMeta{
+ Namespace: "ns",
+ Name: "my-pipe",
+ },
+ Spec: v1.PipeSpec{
+ Source: v1.Endpoint{
+ URI: ptr.To("timer:tick"),
+ },
+ Sink: v1.Endpoint{
+ URI: ptr.To("log:info"),
+ },
+ },
+ Status: v1.PipeStatus{
+ Phase: v1.PipePhaseCreating,
+ },
+ }
+
+ c, err := internal.NewFakeClient(pipe)
+ require.NoError(t, err)
+ it, err := CreateIntegrationFor(context.TODO(), c, pipe)
+ require.NoError(t, err)
+ it.Status.Phase = v1.IntegrationPhaseBuildComplete
+ c, err = internal.NewFakeClient(pipe, it)
+ require.NoError(t, err)
+
+ a := NewMonitorAction()
+ a.InjectLogger(log.Log)
+ a.InjectClient(c)
+ assert.Equal(t, "monitor", a.Name())
+ assert.True(t, a.CanHandle(pipe))
+ handledPipe, err := a.Handle(context.TODO(), pipe)
+ require.NoError(t, err)
+ assert.Equal(t, v1.PipePhaseBuildComplete, handledPipe.Status.Phase)
+ assert.Equal(t, corev1.ConditionFalse, handledPipe.Status.GetCondition(v1.PipeConditionReady).Status)
+ assert.Equal(t, "BuildComplete", handledPipe.Status.GetCondition(v1.PipeConditionReady).Reason)
+ assert.Equal(t, "Integration \"my-pipe\" build completed successfully", handledPipe.Status.GetCondition(v1.PipeConditionReady).Message)
+}
(camel-k) 03/03: fix(cmd): remove flag reference from deploy command description
Posted by pc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
pcongiusti pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit 0e13fc0a9472317908fd612fce347724f8b54dc6
Author: Pranjul Kalsi <pr...@gmail.com>
AuthorDate: Sun Dec 14 15:38:11 2025 +0530
fix(cmd): remove flag reference from deploy command description
---
pkg/cmd/deploy.go | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pkg/cmd/deploy.go b/pkg/cmd/deploy.go
index 8249110cf..51f04f385 100644
--- a/pkg/cmd/deploy.go
+++ b/pkg/cmd/deploy.go
@@ -33,7 +33,7 @@ func newCmdDeploy(rootCmdOptions *RootCmdOptions) (*cobra.Command, *deployCmdOpt
}
cmd := cobra.Command{
Use: "deploy <name>",
- Short: "Deploy an Integration or Pipe that was previously built with --dont-run-after-build flag",
+ Short: "Deploy an Integration or Pipe that was previously built",
PreRunE: decode(&options, options.Flags),
RunE: options.run,
}