Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/modules/ROOT/partials/apis/camel-k-crds.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7630,6 +7630,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"]
|===
Expand Down
5 changes: 5 additions & 0 deletions docs/modules/traits/pages/jolokia.adoc
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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**.

Expand Down
4 changes: 4 additions & 0 deletions pkg/apis/camel/v1/trait/jolokia.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
10 changes: 9 additions & 1 deletion pkg/trait/jolokia.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion pkg/trait/jolokia_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Loading