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 2026/09/24 05:55:14 UTC

(camel-k) branch main updated: Fix #6800: Flag to skip the camel-observability-services dependency

This is an automated email from the ASF dual-hosted git repository.

squakez pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git


The following commit(s) were added to refs/heads/main by this push:
     new 40d0f1d81 Fix #6800: Flag to skip the camel-observability-services dependency
40d0f1d81 is described below

commit 40d0f1d813e0d0c707a059b2e8428ed5810e5b55
Author: Keerthan <po...@gmail.com>
AuthorDate: Tue Sep 22 15:50:58 2026 +0530

    Fix #6800: Flag to skip the camel-observability-services dependency
---
 docs/modules/ROOT/partials/apis/camel-k-crds.adoc  |  7 ++
 docs/modules/traits/pages/camel.adoc               |  4 ++
 helm/camel-k/crds/camel-k-crds.yaml                | 36 ++++++++++
 pkg/apis/camel/v1/camelcatalog_types.go            |  3 +
 pkg/apis/camel/v1/trait/camel.go                   |  3 +
 pkg/apis/camel/v1/trait/zz_generated.deepcopy.go   |  5 ++
 pkg/apis/camel/v1/zz_generated.deepcopy.go         |  1 +
 pkg/controller/catalog/initialize.go               |  2 +-
 .../bases/camel.apache.org_integrationkits.yaml    |  4 ++
 .../camel.apache.org_integrationplatforms.yaml     |  8 +++
 .../camel.apache.org_integrationprofiles.yaml      |  8 +++
 .../crd/bases/camel.apache.org_integrations.yaml   |  8 +++
 .../config/crd/bases/camel.apache.org_pipes.yaml   |  8 +++
 pkg/trait/dependencies.go                          | 18 +++++
 pkg/trait/dependencies_test.go                     | 79 ++++++++++++++++++++++
 15 files changed, 193 insertions(+), 1 deletion(-)

diff --git a/docs/modules/ROOT/partials/apis/camel-k-crds.adoc b/docs/modules/ROOT/partials/apis/camel-k-crds.adoc
index a53be7ad1..7f8518c7b 100644
--- a/docs/modules/ROOT/partials/apis/camel-k-crds.adoc
+++ b/docs/modules/ROOT/partials/apis/camel-k-crds.adoc
@@ -6830,6 +6830,13 @@ to the best matching Catalog existing on the cluster (Default, the one provided
 
 A list of properties to be provided to the Integration runtime
 
+|`skipObservabilityServices` +
+bool
+|
+
+
+Whether to skip the default Camel Observability Services dependency
+
 
 |===
 
diff --git a/docs/modules/traits/pages/camel.adoc b/docs/modules/traits/pages/camel.adoc
index ed6e8a7d8..f80086462 100755
--- a/docs/modules/traits/pages/camel.adoc
+++ b/docs/modules/traits/pages/camel.adoc
@@ -43,6 +43,10 @@ to the best matching Catalog existing on the cluster (Default, the one provided
 | []string
 | A list of properties to be provided to the Integration runtime
 
+| camel.skipObservabilityServices
+| bool
+| Whether to skip the default Camel Observability Services dependency
+
 |===
 
 NOTE: the variable names are "snake case" if you're using in `kamel` CLI, for example `trait.myParam` has to be translated as `-t trait.my-param`
diff --git a/helm/camel-k/crds/camel-k-crds.yaml b/helm/camel-k/crds/camel-k-crds.yaml
index 72eff8bd7..1a775f7e8 100644
--- a/helm/camel-k/crds/camel-k-crds.yaml
+++ b/helm/camel-k/crds/camel-k-crds.yaml
@@ -3102,6 +3102,10 @@ spec:
                           You can use a fixed version (for example "3.2.3") or a semantic version (for example "3.x") which will try to resolve
                           to the best matching Catalog existing on the cluster (Default, the one provided by the operator version).
                         type: string
+                      skipObservabilityServices:
+                        description: Whether to skip the default Camel Observability
+                          Services dependency
+                        type: boolean
                     type: object
                   quarkus:
                     description: |-
@@ -4061,6 +4065,10 @@ spec:
                           You can use a fixed version (for example "3.2.3") or a semantic version (for example "3.x") which will try to resolve
                           to the best matching Catalog existing on the cluster (Default, the one provided by the operator version).
                         type: string
+                      skipObservabilityServices:
+                        description: Whether to skip the default Camel Observability
+                          Services dependency
+                        type: boolean
                     type: object
                   container:
                     description: The configuration of Container trait
@@ -6632,6 +6640,10 @@ spec:
                           You can use a fixed version (for example "3.2.3") or a semantic version (for example "3.x") which will try to resolve
                           to the best matching Catalog existing on the cluster (Default, the one provided by the operator version).
                         type: string
+                      skipObservabilityServices:
+                        description: Whether to skip the default Camel Observability
+                          Services dependency
+                        type: boolean
                     type: object
                   container:
                     description: The configuration of Container trait
@@ -9164,6 +9176,10 @@ spec:
                           You can use a fixed version (for example "3.2.3") or a semantic version (for example "3.x") which will try to resolve
                           to the best matching Catalog existing on the cluster (Default, the one provided by the operator version).
                         type: string
+                      skipObservabilityServices:
+                        description: Whether to skip the default Camel Observability
+                          Services dependency
+                        type: boolean
                     type: object
                   container:
                     description: The configuration of Container trait
@@ -11684,6 +11700,10 @@ spec:
                           You can use a fixed version (for example "3.2.3") or a semantic version (for example "3.x") which will try to resolve
                           to the best matching Catalog existing on the cluster (Default, the one provided by the operator version).
                         type: string
+                      skipObservabilityServices:
+                        description: Whether to skip the default Camel Observability
+                          Services dependency
+                        type: boolean
                     type: object
                   container:
                     description: The configuration of Container trait
@@ -21266,6 +21286,10 @@ spec:
                           You can use a fixed version (for example "3.2.3") or a semantic version (for example "3.x") which will try to resolve
                           to the best matching Catalog existing on the cluster (Default, the one provided by the operator version).
                         type: string
+                      skipObservabilityServices:
+                        description: Whether to skip the default Camel Observability
+                          Services dependency
+                        type: boolean
                     type: object
                   container:
                     description: The configuration of Container trait
@@ -23674,6 +23698,10 @@ spec:
                           You can use a fixed version (for example "3.2.3") or a semantic version (for example "3.x") which will try to resolve
                           to the best matching Catalog existing on the cluster (Default, the one provided by the operator version).
                         type: string
+                      skipObservabilityServices:
+                        description: Whether to skip the default Camel Observability
+                          Services dependency
+                        type: boolean
                     type: object
                   container:
                     description: The configuration of Container trait
@@ -34617,6 +34645,10 @@ spec:
                               You can use a fixed version (for example "3.2.3") or a semantic version (for example "3.x") which will try to resolve
                               to the best matching Catalog existing on the cluster (Default, the one provided by the operator version).
                             type: string
+                          skipObservabilityServices:
+                            description: Whether to skip the default Camel Observability
+                              Services dependency
+                            type: boolean
                         type: object
                       container:
                         description: The configuration of Container trait
@@ -36949,6 +36981,10 @@ spec:
                           You can use a fixed version (for example "3.2.3") or a semantic version (for example "3.x") which will try to resolve
                           to the best matching Catalog existing on the cluster (Default, the one provided by the operator version).
                         type: string
+                      skipObservabilityServices:
+                        description: Whether to skip the default Camel Observability
+                          Services dependency
+                        type: boolean
                     type: object
                   container:
                     description: The configuration of Container trait
diff --git a/pkg/apis/camel/v1/camelcatalog_types.go b/pkg/apis/camel/v1/camelcatalog_types.go
index 18734384c..a6d0cecc3 100644
--- a/pkg/apis/camel/v1/camelcatalog_types.go
+++ b/pkg/apis/camel/v1/camelcatalog_types.go
@@ -26,6 +26,9 @@ const (
 	// CamelCatalogKind -- .
 	CamelCatalogKind    string = "CamelCatalog"
 	MavenQuarkusGroupID string = "org.apache.camel.quarkus"
+
+	// CamelQuarkusObservabilityServicesArtifactID -- .
+	CamelQuarkusObservabilityServicesArtifactID string = "camel-quarkus-observability-services"
 )
 
 // +genclient
diff --git a/pkg/apis/camel/v1/trait/camel.go b/pkg/apis/camel/v1/trait/camel.go
index 502bef4aa..c4b33bb42 100644
--- a/pkg/apis/camel/v1/trait/camel.go
+++ b/pkg/apis/camel/v1/trait/camel.go
@@ -34,4 +34,7 @@ type CamelTrait struct {
 	RuntimeVersion string `json:"runtimeVersion,omitempty" property:"runtime-version"`
 	// A list of properties to be provided to the Integration runtime
 	Properties []string `json:"properties,omitempty" property:"properties"`
+
+	// Whether to skip the default Camel Observability Services dependency
+	SkipObservabilityServices *bool `json:"skipObservabilityServices,omitempty" property:"skip-observability-services"`
 }
diff --git a/pkg/apis/camel/v1/trait/zz_generated.deepcopy.go b/pkg/apis/camel/v1/trait/zz_generated.deepcopy.go
index 190cbfade..5466a9cb0 100644
--- a/pkg/apis/camel/v1/trait/zz_generated.deepcopy.go
+++ b/pkg/apis/camel/v1/trait/zz_generated.deepcopy.go
@@ -170,6 +170,11 @@ func (in *CamelTrait) DeepCopyInto(out *CamelTrait) {
 		*out = make([]string, len(*in))
 		copy(*out, *in)
 	}
+	if in.SkipObservabilityServices != nil {
+		in, out := &in.SkipObservabilityServices, &out.SkipObservabilityServices
+		*out = new(bool)
+		**out = **in
+	}
 }
 
 // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CamelTrait.
diff --git a/pkg/apis/camel/v1/zz_generated.deepcopy.go b/pkg/apis/camel/v1/zz_generated.deepcopy.go
index 07e39cd5e..af1a8a1dc 100644
--- a/pkg/apis/camel/v1/zz_generated.deepcopy.go
+++ b/pkg/apis/camel/v1/zz_generated.deepcopy.go
@@ -6,6 +6,7 @@ package v1
 
 import (
 	"encoding/json"
+
 	"github.com/apache/camel-k/v2/pkg/apis/camel/v1/trait"
 	corev1 "k8s.io/api/core/v1"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
diff --git a/pkg/controller/catalog/initialize.go b/pkg/controller/catalog/initialize.go
index b0388a6ea..c92188fdb 100644
--- a/pkg/controller/catalog/initialize.go
+++ b/pkg/controller/catalog/initialize.go
@@ -110,7 +110,7 @@ func (action *initializeAction) addPlainQuarkusCatalog(ctx context.Context, cata
 			// opinionated set of observability services
 			{
 				GroupID:    v1.MavenQuarkusGroupID,
-				ArtifactID: "camel-quarkus-observability-services",
+				ArtifactID: v1.CamelQuarkusObservabilityServicesArtifactID,
 			},
 		}
 		if clonedCatalog.Spec.Runtime.Capabilities != nil {
diff --git a/pkg/resources/config/crd/bases/camel.apache.org_integrationkits.yaml b/pkg/resources/config/crd/bases/camel.apache.org_integrationkits.yaml
index 2a3ffc624..512626d21 100644
--- a/pkg/resources/config/crd/bases/camel.apache.org_integrationkits.yaml
+++ b/pkg/resources/config/crd/bases/camel.apache.org_integrationkits.yaml
@@ -386,6 +386,10 @@ spec:
                           You can use a fixed version (for example "3.2.3") or a semantic version (for example "3.x") which will try to resolve
                           to the best matching Catalog existing on the cluster (Default, the one provided by the operator version).
                         type: string
+                      skipObservabilityServices:
+                        description: Whether to skip the default Camel Observability
+                          Services dependency
+                        type: boolean
                     type: object
                   quarkus:
                     description: |-
diff --git a/pkg/resources/config/crd/bases/camel.apache.org_integrationplatforms.yaml b/pkg/resources/config/crd/bases/camel.apache.org_integrationplatforms.yaml
index 3b318a775..09ad21815 100644
--- a/pkg/resources/config/crd/bases/camel.apache.org_integrationplatforms.yaml
+++ b/pkg/resources/config/crd/bases/camel.apache.org_integrationplatforms.yaml
@@ -753,6 +753,10 @@ spec:
                           You can use a fixed version (for example "3.2.3") or a semantic version (for example "3.x") which will try to resolve
                           to the best matching Catalog existing on the cluster (Default, the one provided by the operator version).
                         type: string
+                      skipObservabilityServices:
+                        description: Whether to skip the default Camel Observability
+                          Services dependency
+                        type: boolean
                     type: object
                   container:
                     description: The configuration of Container trait
@@ -3324,6 +3328,10 @@ spec:
                           You can use a fixed version (for example "3.2.3") or a semantic version (for example "3.x") which will try to resolve
                           to the best matching Catalog existing on the cluster (Default, the one provided by the operator version).
                         type: string
+                      skipObservabilityServices:
+                        description: Whether to skip the default Camel Observability
+                          Services dependency
+                        type: boolean
                     type: object
                   container:
                     description: The configuration of Container trait
diff --git a/pkg/resources/config/crd/bases/camel.apache.org_integrationprofiles.yaml b/pkg/resources/config/crd/bases/camel.apache.org_integrationprofiles.yaml
index 66a0aa2a2..69e52466a 100644
--- a/pkg/resources/config/crd/bases/camel.apache.org_integrationprofiles.yaml
+++ b/pkg/resources/config/crd/bases/camel.apache.org_integrationprofiles.yaml
@@ -678,6 +678,10 @@ spec:
                           You can use a fixed version (for example "3.2.3") or a semantic version (for example "3.x") which will try to resolve
                           to the best matching Catalog existing on the cluster (Default, the one provided by the operator version).
                         type: string
+                      skipObservabilityServices:
+                        description: Whether to skip the default Camel Observability
+                          Services dependency
+                        type: boolean
                     type: object
                   container:
                     description: The configuration of Container trait
@@ -3198,6 +3202,10 @@ spec:
                           You can use a fixed version (for example "3.2.3") or a semantic version (for example "3.x") which will try to resolve
                           to the best matching Catalog existing on the cluster (Default, the one provided by the operator version).
                         type: string
+                      skipObservabilityServices:
+                        description: Whether to skip the default Camel Observability
+                          Services dependency
+                        type: boolean
                     type: object
                   container:
                     description: The configuration of Container trait
diff --git a/pkg/resources/config/crd/bases/camel.apache.org_integrations.yaml b/pkg/resources/config/crd/bases/camel.apache.org_integrations.yaml
index 5154f6f11..9466171e1 100644
--- a/pkg/resources/config/crd/bases/camel.apache.org_integrations.yaml
+++ b/pkg/resources/config/crd/bases/camel.apache.org_integrations.yaml
@@ -7731,6 +7731,10 @@ spec:
                           You can use a fixed version (for example "3.2.3") or a semantic version (for example "3.x") which will try to resolve
                           to the best matching Catalog existing on the cluster (Default, the one provided by the operator version).
                         type: string
+                      skipObservabilityServices:
+                        description: Whether to skip the default Camel Observability
+                          Services dependency
+                        type: boolean
                     type: object
                   container:
                     description: The configuration of Container trait
@@ -10139,6 +10143,10 @@ spec:
                           You can use a fixed version (for example "3.2.3") or a semantic version (for example "3.x") which will try to resolve
                           to the best matching Catalog existing on the cluster (Default, the one provided by the operator version).
                         type: string
+                      skipObservabilityServices:
+                        description: Whether to skip the default Camel Observability
+                          Services dependency
+                        type: boolean
                     type: object
                   container:
                     description: The configuration of Container trait
diff --git a/pkg/resources/config/crd/bases/camel.apache.org_pipes.yaml b/pkg/resources/config/crd/bases/camel.apache.org_pipes.yaml
index 93c1730a2..893ae100a 100644
--- a/pkg/resources/config/crd/bases/camel.apache.org_pipes.yaml
+++ b/pkg/resources/config/crd/bases/camel.apache.org_pipes.yaml
@@ -7784,6 +7784,10 @@ spec:
                               You can use a fixed version (for example "3.2.3") or a semantic version (for example "3.x") which will try to resolve
                               to the best matching Catalog existing on the cluster (Default, the one provided by the operator version).
                             type: string
+                          skipObservabilityServices:
+                            description: Whether to skip the default Camel Observability
+                              Services dependency
+                            type: boolean
                         type: object
                       container:
                         description: The configuration of Container trait
@@ -10116,6 +10120,10 @@ spec:
                           You can use a fixed version (for example "3.2.3") or a semantic version (for example "3.x") which will try to resolve
                           to the best matching Catalog existing on the cluster (Default, the one provided by the operator version).
                         type: string
+                      skipObservabilityServices:
+                        description: Whether to skip the default Camel Observability
+                          Services dependency
+                        type: boolean
                     type: object
                   container:
                     description: The configuration of Container trait
diff --git a/pkg/trait/dependencies.go b/pkg/trait/dependencies.go
index b5641a553..efd01e898 100644
--- a/pkg/trait/dependencies.go
+++ b/pkg/trait/dependencies.go
@@ -24,6 +24,7 @@ import (
 	"github.com/apache/camel-k/v2/pkg/util"
 	"github.com/apache/camel-k/v2/pkg/util/camel"
 	"github.com/apache/camel-k/v2/pkg/util/sets"
+	"k8s.io/utils/ptr"
 )
 
 const (
@@ -50,6 +51,16 @@ func (t *dependenciesTrait) Configure(e *Environment) (bool, *TraitCondition, er
 	return e.IntegrationInPhase(v1.IntegrationPhaseInitialization), nil, nil
 }
 
+func (t *dependenciesTrait) isSkipObservabilityServices(e *Environment) bool {
+	if ct := e.Catalog.GetTrait(camelTraitID); ct != nil {
+		if camel, ok := ct.(*camelTrait); ok {
+			return ptr.Deref(camel.SkipObservabilityServices, false)
+		}
+	}
+
+	return false
+}
+
 func (t *dependenciesTrait) Apply(e *Environment) error {
 	if e.Integration.Status.Dependencies == nil {
 		e.Integration.Status.Dependencies = make([]string, 0)
@@ -64,8 +75,15 @@ func (t *dependenciesTrait) Apply(e *Environment) error {
 		dependencies.Add(e.Integration.Spec.Dependencies...)
 	}
 
+	skipObservabilityServices := t.isSkipObservabilityServices(e)
+
 	// Add runtime specific dependencies
 	for _, d := range e.CamelCatalog.Runtime.Dependencies {
+		if skipObservabilityServices &&
+			d.GroupID == v1.MavenQuarkusGroupID &&
+			d.ArtifactID == v1.CamelQuarkusObservabilityServicesArtifactID {
+			continue
+		}
 		dependencies.Add(d.GetDependencyID())
 	}
 
diff --git a/pkg/trait/dependencies_test.go b/pkg/trait/dependencies_test.go
index 2cb05e1e4..f36178c3b 100644
--- a/pkg/trait/dependencies_test.go
+++ b/pkg/trait/dependencies_test.go
@@ -25,6 +25,7 @@ import (
 
 	v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
 	"github.com/apache/camel-k/v2/pkg/util/camel"
+	"k8s.io/utils/ptr"
 )
 
 func TestDependenciesTraitApplicability(t *testing.T) {
@@ -395,3 +396,81 @@ func TestIntegrationProfileDependency(t *testing.T) {
 		},
 	)
 }
+
+func TestDependenciesTraitSkipObservabilityServices(t *testing.T) {
+	catalog, err := camel.DefaultCatalog()
+	require.NoError(t, err)
+	catalog.Runtime.Dependencies = []v1.MavenArtifact{
+		{
+			GroupID:    v1.MavenQuarkusGroupID,
+			ArtifactID: "camel-quarkus-core",
+		},
+		{
+			GroupID:    v1.MavenQuarkusGroupID,
+			ArtifactID: v1.CamelQuarkusObservabilityServicesArtifactID,
+		},
+	}
+
+	e := &Environment{
+		Catalog:      NewEnvironmentTestCatalog(),
+		CamelCatalog: catalog,
+		Integration: &v1.Integration{
+			Status: v1.IntegrationStatus{
+				Phase: v1.IntegrationPhaseInitialization,
+			},
+		},
+	}
+
+	camelTrait, ok := e.Catalog.GetTrait(camelTraitID).(*camelTrait)
+	require.True(t, ok)
+	camelTrait.SkipObservabilityServices = ptr.To(true)
+
+	trait := newDependenciesTrait()
+	enabled, condition, err := trait.Configure(e)
+	require.NoError(t, err)
+	assert.Nil(t, condition)
+	assert.True(t, enabled)
+
+	err = trait.Apply(e)
+	require.NoError(t, err)
+
+	assert.Contains(t, e.Integration.Status.Dependencies, "mvn:org.apache.camel.quarkus:camel-quarkus-core")
+	assert.NotContains(t, e.Integration.Status.Dependencies, "mvn:org.apache.camel.quarkus:camel-quarkus-observability-services")
+}
+
+func TestDependenciesTraitObservabilityServicesDefault(t *testing.T) {
+	catalog, err := camel.DefaultCatalog()
+	require.NoError(t, err)
+	catalog.Runtime.Dependencies = []v1.MavenArtifact{
+		{
+			GroupID:    v1.MavenQuarkusGroupID,
+			ArtifactID: "camel-quarkus-core",
+		},
+		{
+			GroupID:    v1.MavenQuarkusGroupID,
+			ArtifactID: v1.CamelQuarkusObservabilityServicesArtifactID,
+		},
+	}
+
+	e := &Environment{
+		Catalog:      NewEnvironmentTestCatalog(),
+		CamelCatalog: catalog,
+		Integration: &v1.Integration{
+			Status: v1.IntegrationStatus{
+				Phase: v1.IntegrationPhaseInitialization,
+			},
+		},
+	}
+
+	trait := newDependenciesTrait()
+	enabled, condition, err := trait.Configure(e)
+	require.NoError(t, err)
+	assert.Nil(t, condition)
+	assert.True(t, enabled)
+
+	err = trait.Apply(e)
+	require.NoError(t, err)
+
+	assert.Contains(t, e.Integration.Status.Dependencies, "mvn:org.apache.camel.quarkus:camel-quarkus-core")
+	assert.Contains(t, e.Integration.Status.Dependencies, "mvn:org.apache.camel.quarkus:camel-quarkus-observability-services")
+}