Skip to content

Commit 65ec55b

Browse files
committed
feat(trait): deprecate Jolokia
Favoring jvm.agents instead
1 parent 067dc3b commit 65ec55b

File tree

5 files changed

+22
-2
lines changed

5 files changed

+22
-2
lines changed

docs/modules/ROOT/partials/apis/camel-k-crds.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7637,6 +7637,9 @@ Make sure you have the right privileges to perform such an action on the cluster
76377637
76387638
See https://jolokia.org/reference/html/manual/agents.html
76397639
7640+
WARNING: The Jolokia trait is **deprecated** and will removed in future release versions:
7641+
use `jvm.agents` configuration instead.
7642+
76407643
76417644
[cols="2,2a",options="header"]
76427645
|===

docs/modules/traits/pages/jolokia.adoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
= Jolokia Trait
22

33
// Start of autogenerated code - DO NOT EDIT! (badges)
4+
[.badges]
5+
[.badge-key]##Deprecated since##[.badge-unsupported]##2.8.0##
46
// End of autogenerated code - DO NOT EDIT! (badges)
57
// Start of autogenerated code - DO NOT EDIT! (description)
68
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
911

1012
See https://jolokia.org/reference/html/manual/agents.html
1113

14+
WARNING: The Jolokia trait is **deprecated** and will removed in future release versions:
15+
use `jvm.agents` configuration instead.
16+
1217

1318
This trait is available in the following profiles: **Kubernetes, Knative, OpenShift**.
1419

pkg/apis/camel/v1/trait/jolokia.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ package trait
2323
//
2424
// See https://jolokia.org/reference/html/manual/agents.html
2525
//
26+
// WARNING: The Jolokia trait is **deprecated** and will removed in future release versions:
27+
// use `jvm.agents` configuration instead.
28+
//
2629
// +camel-k:trait=jolokia.
30+
// +camel-k:deprecated=2.8.0.
2731
type JolokiaTrait struct {
2832
Trait `property:",squash" json:",inline"`
2933
// The PEM encoded CA certification file path, used to verify client certificates,

pkg/trait/jolokia.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,15 @@ func (t *jolokiaTrait) Configure(e *Environment) (bool, *TraitCondition, error)
5454
return false, nil, nil
5555
}
5656

57-
return e.IntegrationInPhase(v1.IntegrationPhaseInitialization) || e.IntegrationInRunningPhases(), nil, nil
57+
condition := NewIntegrationCondition(
58+
"Jolokia",
59+
v1.IntegrationConditionTraitInfo,
60+
corev1.ConditionTrue,
61+
TraitConfigurationReason,
62+
"Jolokia trait is deprecated in favour of jvm.agents. It may be removed in future version.",
63+
)
64+
65+
return e.IntegrationInPhase(v1.IntegrationPhaseInitialization) || e.IntegrationInRunningPhases(), condition, nil
5866
}
5967

6068
func (t *jolokiaTrait) Apply(e *Environment) error {

pkg/trait/jolokia_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func TestConfigureJolokiaTraitInRunningPhaseDoesSucceed(t *testing.T) {
3939

4040
require.NoError(t, err)
4141
assert.True(t, configured)
42-
assert.Nil(t, condition)
42+
assert.NotNil(t, condition)
4343
}
4444

4545
func TestApplyJolokiaTraitNominalShouldSucceed(t *testing.T) {

0 commit comments

Comments
 (0)