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/09/04 12:19:30 UTC
(camel-k) branch main updated: feat(trait): deprecate Jolokia
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
The following commit(s) were added to refs/heads/main by this push:
new 65ec55b5e feat(trait): deprecate Jolokia
65ec55b5e is described below
commit 65ec55b5e25c17aa13fbe161a68be3d087a851c4
Author: Pasquale Congiusti <pa...@gmail.com>
AuthorDate: Thu Sep 4 07:04:39 2025 +0200
feat(trait): deprecate Jolokia
Favoring jvm.agents instead
---
docs/modules/ROOT/partials/apis/camel-k-crds.adoc | 3 +++
docs/modules/traits/pages/jolokia.adoc | 5 +++++
pkg/apis/camel/v1/trait/jolokia.go | 4 ++++
pkg/trait/jolokia.go | 10 +++++++++-
pkg/trait/jolokia_test.go | 2 +-
5 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/docs/modules/ROOT/partials/apis/camel-k-crds.adoc b/docs/modules/ROOT/partials/apis/camel-k-crds.adoc
index ed2224828..febfe8c40 100644
--- a/docs/modules/ROOT/partials/apis/camel-k-crds.adoc
+++ b/docs/modules/ROOT/partials/apis/camel-k-crds.adoc
@@ -7637,6 +7637,9 @@ Make sure you have the right privileges to perform such an action on the cluster
See https://jolokia.org/reference/html/manual/agents.html
+WARNING: The Jolokia trait is **deprecated** and will removed in future release versions:
+use `jvm.agents` configuration instead.
+
[cols="2,2a",options="header"]
|===
diff --git a/docs/modules/traits/pages/jolokia.adoc b/docs/modules/traits/pages/jolokia.adoc
index 1b055b4a6..02e9a245e 100755
--- a/docs/modules/traits/pages/jolokia.adoc
+++ b/docs/modules/traits/pages/jolokia.adoc
@@ -1,6 +1,8 @@
= Jolokia Trait
// Start of autogenerated code - DO NOT EDIT! (badges)
+[.badges]
+[.badge-key]##Deprecated since##[.badge-unsupported]##2.8.0##
// End of autogenerated code - DO NOT EDIT! (badges)
// Start of autogenerated code - DO NOT EDIT! (description)
The Jolokia trait activates and configures the Jolokia Java agent.
@@ -9,6 +11,9 @@ Make sure you have the right privileges to perform such an action on the cluster
See https://jolokia.org/reference/html/manual/agents.html
+WARNING: The Jolokia trait is **deprecated** and will removed in future release versions:
+use `jvm.agents` configuration instead.
+
This trait is available in the following profiles: **Kubernetes, Knative, OpenShift**.
diff --git a/pkg/apis/camel/v1/trait/jolokia.go b/pkg/apis/camel/v1/trait/jolokia.go
index d90487cd1..03725c5e7 100644
--- a/pkg/apis/camel/v1/trait/jolokia.go
+++ b/pkg/apis/camel/v1/trait/jolokia.go
@@ -23,7 +23,11 @@ package trait
//
// See https://jolokia.org/reference/html/manual/agents.html
//
+// WARNING: The Jolokia trait is **deprecated** and will removed in future release versions:
+// use `jvm.agents` configuration instead.
+//
// +camel-k:trait=jolokia.
+// +camel-k:deprecated=2.8.0.
type JolokiaTrait struct {
Trait `property:",squash" json:",inline"`
// The PEM encoded CA certification file path, used to verify client certificates,
diff --git a/pkg/trait/jolokia.go b/pkg/trait/jolokia.go
index 4d58863ce..4ae6a09d0 100644
--- a/pkg/trait/jolokia.go
+++ b/pkg/trait/jolokia.go
@@ -54,7 +54,15 @@ func (t *jolokiaTrait) Configure(e *Environment) (bool, *TraitCondition, error)
return false, nil, nil
}
- return e.IntegrationInPhase(v1.IntegrationPhaseInitialization) || e.IntegrationInRunningPhases(), nil, nil
+ condition := NewIntegrationCondition(
+ "Jolokia",
+ v1.IntegrationConditionTraitInfo,
+ corev1.ConditionTrue,
+ TraitConfigurationReason,
+ "Jolokia trait is deprecated in favour of jvm.agents. It may be removed in future version.",
+ )
+
+ return e.IntegrationInPhase(v1.IntegrationPhaseInitialization) || e.IntegrationInRunningPhases(), condition, nil
}
func (t *jolokiaTrait) Apply(e *Environment) error {
diff --git a/pkg/trait/jolokia_test.go b/pkg/trait/jolokia_test.go
index 123834b5a..3343ab47d 100644
--- a/pkg/trait/jolokia_test.go
+++ b/pkg/trait/jolokia_test.go
@@ -39,7 +39,7 @@ func TestConfigureJolokiaTraitInRunningPhaseDoesSucceed(t *testing.T) {
require.NoError(t, err)
assert.True(t, configured)
- assert.Nil(t, condition)
+ assert.NotNil(t, condition)
}
func TestApplyJolokiaTraitNominalShouldSucceed(t *testing.T) {