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 6bd188669 feat(trait): remove jolokia
6bd188669 is described below
commit 6bd188669f131e6a886cf69e5fecccc648b12130
Author: Pasquale Congiusti <[email protected]>
AuthorDate: Fri Aug 21 08:24:25 2026 +0200
feat(trait): remove jolokia
Closes #6764
---
docs/modules/ROOT/nav.adoc | 1 -
docs/modules/ROOT/partials/apis/camel-k-crds.adoc | 6 +-
docs/modules/traits/pages/jolokia.adoc | 96 ----------
e2e/common/traits/jolokia_test.go | 63 -------
helm/camel-k/crds/camel-k-crds.yaml | 32 ++--
pkg/apis/camel/v1/common_types.go | 24 ++-
pkg/apis/camel/v1/integration_types.go | 4 -
pkg/apis/camel/v1/trait/jolokia.go | 3 +
pkg/apis/camel/v1/zz_generated.deepcopy.go | 36 ++--
.../camel/applyconfiguration/camel/v1/traits.go | 100 +++++-----
.../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/jolokia.go | 204 ---------------------
pkg/trait/jolokia_test.go | 193 -------------------
pkg/trait/jvm.go | 2 +-
pkg/trait/trait_configure_test.go | 6 +-
pkg/trait/trait_register.go | 1 -
19 files changed, 122 insertions(+), 681 deletions(-)
diff --git a/docs/modules/ROOT/nav.adoc b/docs/modules/ROOT/nav.adoc
index 6e8a666f2..e938120ac 100644
--- a/docs/modules/ROOT/nav.adoc
+++ b/docs/modules/ROOT/nav.adoc
@@ -60,7 +60,6 @@
** xref:traits:ingress.adoc[Ingress]
** xref:traits:init-containers.adoc[Init Containers]
** xref:traits:istio.adoc[Istio]
-** xref:traits:jolokia.adoc[Jolokia]
** xref:traits:jvm.adoc[Jvm]
** xref:traits:kamelets.adoc[Kamelets]
** xref:traits:keda.adoc[Keda]
diff --git a/docs/modules/ROOT/partials/apis/camel-k-crds.adoc
b/docs/modules/ROOT/partials/apis/camel-k-crds.adoc
index 522453b51..91639092d 100644
--- a/docs/modules/ROOT/partials/apis/camel-k-crds.adoc
+++ b/docs/modules/ROOT/partials/apis/camel-k-crds.adoc
@@ -6142,7 +6142,7 @@ The configuration of Istio trait
The configuration of Jolokia trait.
-Deprecated: use jvm.agent instead.
+Deprecated: no longer in use.
|`jvm` +
*xref:#_camel_apache_org_v1_trait_JVMTrait[JVMTrait]*
@@ -6267,7 +6267,7 @@ The configuration of Quarkus trait
The configuration of Registry trait (support removed since version 2.5.0).
-Deprecated: use jvm trait or read documentation.
+Deprecated: no longer in use.
|`route` +
*xref:#_camel_apache_org_v1_trait_RouteTrait[RouteTrait]*
@@ -8070,6 +8070,8 @@ Deprecated: Use CACertificates instead. Path to a file
containing the truststore
* <<#_camel_apache_org_v1_Traits, Traits>>
+WARNING: This trait is no longer in use.
+
The Jolokia trait activates and configures the Jolokia Java agent.
This trait is useful to enable JMX access to Camel application.
Make sure you have the right privileges to perform such an action on the
cluster.
diff --git a/docs/modules/traits/pages/jolokia.adoc
b/docs/modules/traits/pages/jolokia.adoc
deleted file mode 100755
index 11a50594c..000000000
--- a/docs/modules/traits/pages/jolokia.adoc
+++ /dev/null
@@ -1,96 +0,0 @@
-= 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.
-This trait is useful to enable JMX access to Camel application.
-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**.
-
-// End of autogenerated code - DO NOT EDIT! (description)
-// Start of autogenerated code - DO NOT EDIT! (configuration)
-== Configuration
-
-Trait properties can be specified when running any integration with the CLI:
-[source,console]
-----
-$ kamel run --trait jolokia.[key]=[value] --trait jolokia.[key2]=[value2]
integration.yaml
-----
-The following configuration options are available:
-
-[cols="2m,1m,5a"]
-|===
-|Property | Type | Description
-
-| jolokia.enabled
-| bool
-| Can be used to enable or disable a trait. All traits share this common
property.
-
-| jolokia.CACert
-| string
-| The PEM encoded CA certification file path, used to verify client
certificates,
-applicable when `protocol` is `https` and `use-ssl-client-authentication` is
`true`
-(default `/var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt` for
OpenShift).
-
-| jolokia.clientPrincipal
-| []string
-| The principal(s) which must be given in a client certificate to allow access
to the Jolokia endpoint,
-applicable when `protocol` is `https` and `use-ssl-client-authentication` is
`true`
-(default `clientPrincipal=cn=system:master-proxy`,
`cn=hawtio-online.hawtio.svc` and `cn=fuse-console.fuse.svc` for OpenShift).
-
-| jolokia.discoveryEnabled
-| bool
-| Listen for multicast requests (default `false`)
-
-| jolokia.extendedClientCheck
-| bool
-| Mandate the client certificate contains a client flag in the extended key
usage section,
-applicable when `protocol` is `https` and `use-ssl-client-authentication` is
`true`
-(default `true` for OpenShift).
-
-| jolokia.host
-| string
-| The Host address to which the Jolokia agent should bind to. If `"\*"` or
`"0.0.0.0"` is given,
-the servers binds to every network interface (default `"*"`).
-
-| jolokia.password
-| string
-| The password used for authentication, applicable when the `user` option is
set.
-
-| jolokia.port
-| int32
-| The Jolokia endpoint port (default `8778`).
-
-| jolokia.protocol
-| string
-| The protocol to use, either `http` or `https` (default `https` for OpenShift)
-
-| jolokia.user
-| string
-| The user to be used for authentication
-
-| jolokia.useSSLClientAuthentication
-| bool
-| Whether client certificates should be used for authentication (default
`true` for OpenShift).
-
-| jolokia.options
-| []string
-| A list of additional Jolokia options as defined
-in https://jolokia.org/reference/html/agents.html#agent-jvm-config[JVM agent
configuration options]
-
-|===
-
-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`
-
-
-// End of autogenerated code - DO NOT EDIT! (configuration)
diff --git a/e2e/common/traits/jolokia_test.go
b/e2e/common/traits/jolokia_test.go
deleted file mode 100644
index b1a1510c0..000000000
--- a/e2e/common/traits/jolokia_test.go
+++ /dev/null
@@ -1,63 +0,0 @@
-//go:build integration
-// +build integration
-
-// To enable compilation of this file in Goland, go to "Settings -> Go ->
Vendoring & Build Tags -> Custom Tags" and add "integration"
-
-/*
-Licensed to the Apache Software Foundation (ASF) under one or more
-contributor license agreements. See the NOTICE file distributed with
-this work for additional information regarding copyright ownership.
-The ASF licenses this file to You under the Apache License, Version 2.0
-(the "License"); you may not use this file except in compliance with
-the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-package common
-
-import (
- "context"
- "fmt"
- "testing"
- "time"
-
- . "github.com/onsi/gomega"
-
- corev1 "k8s.io/api/core/v1"
-
- . "github.com/apache/camel-k/v2/e2e/support"
- v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
-)
-
-func TestJolokiaTrait(t *testing.T) {
- t.Parallel()
- WithNewTestNamespace(t, func(ctx context.Context, g *WithT, ns string) {
- t.Run("Run Java with Jolokia", func(t *testing.T) {
- name := RandomizedSuffixName("java")
- g.Expect(KamelRun(t, ctx, ns, "files/Java.java",
"--name", name,
- "-t", "jolokia.enabled=true",
- "-t",
"jolokia.use-ssl-client-authentication=false",
- "-t", "jolokia.protocol=http",
- "-t", "jolokia.extended-client-check=false",
- ).Execute()).To(Succeed())
- g.Eventually(IntegrationPodPhase(t, ctx, ns, name),
TestTimeoutLong).Should(Equal(corev1.PodRunning))
- g.Eventually(IntegrationConditionStatus(t, ctx, ns,
name, v1.IntegrationConditionReady),
TestTimeoutShort).Should(Equal(corev1.ConditionTrue))
- g.Eventually(IntegrationLogs(t, ctx, ns, name),
TestTimeoutShort).Should(ContainSubstring("Magicstring!"))
-
- pod := IntegrationPod(t, ctx, ns, name)
- response, err :=
TestClient(t).CoreV1().RESTClient().Get().
-
AbsPath(fmt.Sprintf("/api/v1/namespaces/%s/pods/%s/proxy/jolokia/", ns,
pod().Name)).
- Timeout(30 * time.Second).
- DoRaw(ctx)
- g.Expect(err).To(BeNil())
- g.Expect(response).To(ContainSubstring(`"status":200`))
- })
- })
-}
diff --git a/helm/camel-k/crds/camel-k-crds.yaml
b/helm/camel-k/crds/camel-k-crds.yaml
index bce4b9e72..6e5abf3fb 100644
--- a/helm/camel-k/crds/camel-k-crds.yaml
+++ b/helm/camel-k/crds/camel-k-crds.yaml
@@ -4764,7 +4764,7 @@ spec:
description: |-
The configuration of Jolokia trait.
- Deprecated: use jvm.agent instead.
+ Deprecated: no longer in use.
properties:
CACert:
description: |-
@@ -5595,7 +5595,7 @@ spec:
description: |-
The configuration of Registry trait (support removed
since version 2.5.0).
- Deprecated: use jvm trait or read documentation.
+ Deprecated: no longer in use.
properties:
configuration:
description: |-
@@ -7315,7 +7315,7 @@ spec:
description: |-
The configuration of Jolokia trait.
- Deprecated: use jvm.agent instead.
+ Deprecated: no longer in use.
properties:
CACert:
description: |-
@@ -8146,7 +8146,7 @@ spec:
description: |-
The configuration of Registry trait (support removed
since version 2.5.0).
- Deprecated: use jvm trait or read documentation.
+ Deprecated: no longer in use.
properties:
configuration:
description: |-
@@ -9760,7 +9760,7 @@ spec:
description: |-
The configuration of Jolokia trait.
- Deprecated: use jvm.agent instead.
+ Deprecated: no longer in use.
properties:
CACert:
description: |-
@@ -10591,7 +10591,7 @@ spec:
description: |-
The configuration of Registry trait (support removed
since version 2.5.0).
- Deprecated: use jvm trait or read documentation.
+ Deprecated: no longer in use.
properties:
configuration:
description: |-
@@ -12191,7 +12191,7 @@ spec:
description: |-
The configuration of Jolokia trait.
- Deprecated: use jvm.agent instead.
+ Deprecated: no longer in use.
properties:
CACert:
description: |-
@@ -13022,7 +13022,7 @@ spec:
description: |-
The configuration of Registry trait (support removed
since version 2.5.0).
- Deprecated: use jvm trait or read documentation.
+ Deprecated: no longer in use.
properties:
configuration:
description: |-
@@ -21484,7 +21484,7 @@ spec:
description: |-
The configuration of Jolokia trait.
- Deprecated: use jvm.agent instead.
+ Deprecated: no longer in use.
properties:
CACert:
description: |-
@@ -22315,7 +22315,7 @@ spec:
description: |-
The configuration of Registry trait (support removed
since version 2.5.0).
- Deprecated: use jvm trait or read documentation.
+ Deprecated: no longer in use.
properties:
configuration:
description: |-
@@ -23876,7 +23876,7 @@ spec:
description: |-
The configuration of Jolokia trait.
- Deprecated: use jvm.agent instead.
+ Deprecated: no longer in use.
properties:
CACert:
description: |-
@@ -24707,7 +24707,7 @@ spec:
description: |-
The configuration of Registry trait (support removed
since version 2.5.0).
- Deprecated: use jvm trait or read documentation.
+ Deprecated: no longer in use.
properties:
configuration:
description: |-
@@ -34533,7 +34533,7 @@ spec:
description: |-
The configuration of Jolokia trait.
- Deprecated: use jvm.agent instead.
+ Deprecated: no longer in use.
properties:
CACert:
description: |-
@@ -35368,7 +35368,7 @@ spec:
description: |-
The configuration of Registry trait (support removed
since version 2.5.0).
- Deprecated: use jvm trait or read documentation.
+ Deprecated: no longer in use.
properties:
configuration:
description: |-
@@ -36846,7 +36846,7 @@ spec:
description: |-
The configuration of Jolokia trait.
- Deprecated: use jvm.agent instead.
+ Deprecated: no longer in use.
properties:
CACert:
description: |-
@@ -37677,7 +37677,7 @@ spec:
description: |-
The configuration of Registry trait (support removed
since version 2.5.0).
- Deprecated: use jvm trait or read documentation.
+ Deprecated: no longer in use.
properties:
configuration:
description: |-
diff --git a/pkg/apis/camel/v1/common_types.go
b/pkg/apis/camel/v1/common_types.go
index 826a6099b..802919cf9 100644
--- a/pkg/apis/camel/v1/common_types.go
+++ b/pkg/apis/camel/v1/common_types.go
@@ -215,7 +215,7 @@ type Traits struct {
// The configuration of Error Handler trait.
//
// Deprecated: no longer in use.
- ErrorHandler *trait.ErrorHandlerTrait `json:"error-handler,omitempty"
property:"error-handler"`
+ DeprecatedErrorHandler *trait.ErrorHandlerTrait
`json:"error-handler,omitempty" property:"error-handler"`
// The configuration of Istio trait
Gateway *trait.GatewayTrait `json:"gateway,omitempty"
property:"gateway"`
// The configuration of GC trait
@@ -232,8 +232,8 @@ type Traits struct {
Istio *trait.IstioTrait `json:"istio,omitempty" property:"istio"`
// The configuration of Jolokia trait.
//
- // Deprecated: use jvm.agent instead.
- Jolokia *trait.JolokiaTrait `json:"jolokia,omitempty"
property:"jolokia"`
+ // Deprecated: no longer in use.
+ DeprecatedJolokia *trait.JolokiaTrait `json:"jolokia,omitempty"
property:"jolokia"`
// The configuration of JVM trait
JVM *trait.JVMTrait `json:"jvm,omitempty" property:"jvm"`
// The configuration of Kamelets trait
@@ -253,7 +253,7 @@ type Traits struct {
// The configuration of OpenAPI trait.
//
// Deprecated: no longer in use.
- OpenAPI *trait.OpenAPITrait `json:"openapi,omitempty"
property:"openapi"`
+ DeprecatedOpenAPI *trait.OpenAPITrait `json:"openapi,omitempty"
property:"openapi"`
// The configuration of Owner trait
Owner *trait.OwnerTrait `json:"owner,omitempty" property:"owner"`
// The configuration of PDB trait
@@ -272,8 +272,8 @@ type Traits struct {
Quarkus *trait.QuarkusTrait `json:"quarkus,omitempty"
property:"quarkus"`
// The configuration of Registry trait (support removed since version
2.5.0).
//
- // Deprecated: use jvm trait or read documentation.
- Registry *trait.RegistryTrait `json:"registry,omitempty"
property:"registry"`
+ // Deprecated: no longer in use.
+ DeprecatedRegistry *trait.RegistryTrait `json:"registry,omitempty"
property:"registry"`
// The configuration of Route trait.
//
// Deprecated: use ingress instead.
@@ -285,21 +285,21 @@ type Traits struct {
// The configuration of Service Binding trait.
//
// Deprecated: no longer in use.
- ServiceBinding *trait.ServiceBindingTrait
`json:"service-binding,omitempty" property:"service-binding"`
+ DeprecatedServiceBinding *trait.ServiceBindingTrait
`json:"service-binding,omitempty" property:"service-binding"`
// The configuration of Telemetry trait
Telemetry *trait.TelemetryTrait `json:"telemetry,omitempty"
property:"telemetry"`
// The configuration of Toleration trait
Toleration *trait.TolerationTrait `json:"toleration,omitempty"
property:"toleration"`
// Deprecated: no longer in use.
- Addons map[string]AddonTrait `json:"addons,omitempty"`
+ DeprecatedAddons map[string]AddonTrait `json:"addons,omitempty"`
// Deprecated: no longer in use.
- Strimzi *TraitSpec `json:"strimzi,omitempty" property:"strimzi"`
+ DeprecatedStrimzi *TraitSpec `json:"strimzi,omitempty"
property:"strimzi"`
// Deprecated: no longer in use.
- ThreeScale *TraitSpec `json:"3scale,omitempty" property:"3scale"`
+ DeprecatedThreeScale *TraitSpec `json:"3scale,omitempty"
property:"3scale"`
// Deprecated: no longer in use.
- Tracing *TraitSpec `json:"tracing,omitempty" property:"tracing"`
+ DeprecatedTracing *TraitSpec `json:"tracing,omitempty"
property:"tracing"`
}
// AddonTrait represents the configuration of an addon trait.
@@ -427,8 +427,6 @@ const (
CapabilityHashicorpVault = "hashicorp-vault"
// CapabilityHealth defines the health monitoring capability.
CapabilityHealth = "health"
- // CapabilityJolokia --.
- CapabilityJolokia = "jolokia"
// CapabilityKnative --.
CapabilityKnative = "knative"
// CapabilityMaster defines the master capability.
diff --git a/pkg/apis/camel/v1/integration_types.go
b/pkg/apis/camel/v1/integration_types.go
index b96e340cf..7fa214b88 100644
--- a/pkg/apis/camel/v1/integration_types.go
+++ b/pkg/apis/camel/v1/integration_types.go
@@ -212,8 +212,6 @@ const (
IntegrationConditionExposureAvailable IntegrationConditionType =
"ExposureAvailable"
// IntegrationConditionPrometheusAvailable --.
IntegrationConditionPrometheusAvailable IntegrationConditionType =
"PrometheusAvailable"
- // IntegrationConditionJolokiaAvailable --.
- IntegrationConditionJolokiaAvailable IntegrationConditionType =
"JolokiaAvailable"
// IntegrationConditionProbesAvailable --.
IntegrationConditionProbesAvailable IntegrationConditionType =
"ProbesAvailable"
// IntegrationConditionTraitInfo --.
@@ -253,8 +251,6 @@ const (
IntegrationConditionCronJobNotAvailableReason string =
"CronJobNotAvailableReason"
// IntegrationConditionPrometheusAvailableReason --.
IntegrationConditionPrometheusAvailableReason string =
"PrometheusAvailable"
- // IntegrationConditionJolokiaAvailableReason --.
- IntegrationConditionJolokiaAvailableReason string = "JolokiaAvailable"
// IntegrationConditionProbesAvailableReason --.
IntegrationConditionProbesAvailableReason string = "ProbesAvailable"
// IntegrationConditionMonitoringPodsAvailableReason used to specify
that the Pods generated are available for monitoring.
diff --git a/pkg/apis/camel/v1/trait/jolokia.go
b/pkg/apis/camel/v1/trait/jolokia.go
index 4a2ec8d7d..f1efa7fb6 100644
--- a/pkg/apis/camel/v1/trait/jolokia.go
+++ b/pkg/apis/camel/v1/trait/jolokia.go
@@ -17,6 +17,8 @@ limitations under the License.
package trait
+// WARNING: This trait is no longer in use.
+//
// The Jolokia trait activates and configures the Jolokia Java agent.
// This trait is useful to enable JMX access to Camel application.
// Make sure you have the right privileges to perform such an action on the
cluster.
@@ -28,6 +30,7 @@ package trait
//
// +camel-k:trait=jolokia.
// +camel-k:deprecated=2.8.0.
+// +camel-k:internal.
//
//nolint:godoclint
type JolokiaTrait struct {
diff --git a/pkg/apis/camel/v1/zz_generated.deepcopy.go
b/pkg/apis/camel/v1/zz_generated.deepcopy.go
index 778431077..f3c29f20b 100644
--- a/pkg/apis/camel/v1/zz_generated.deepcopy.go
+++ b/pkg/apis/camel/v1/zz_generated.deepcopy.go
@@ -3236,8 +3236,8 @@ func (in *Traits) DeepCopyInto(out *Traits) {
*out = new(trait.EnvironmentTrait)
(*in).DeepCopyInto(*out)
}
- if in.ErrorHandler != nil {
- in, out := &in.ErrorHandler, &out.ErrorHandler
+ if in.DeprecatedErrorHandler != nil {
+ in, out := &in.DeprecatedErrorHandler,
&out.DeprecatedErrorHandler
*out = new(trait.ErrorHandlerTrait)
(*in).DeepCopyInto(*out)
}
@@ -3276,8 +3276,8 @@ func (in *Traits) DeepCopyInto(out *Traits) {
*out = new(trait.IstioTrait)
(*in).DeepCopyInto(*out)
}
- if in.Jolokia != nil {
- in, out := &in.Jolokia, &out.Jolokia
+ if in.DeprecatedJolokia != nil {
+ in, out := &in.DeprecatedJolokia, &out.DeprecatedJolokia
*out = new(trait.JolokiaTrait)
(*in).DeepCopyInto(*out)
}
@@ -3321,8 +3321,8 @@ func (in *Traits) DeepCopyInto(out *Traits) {
*out = new(trait.MountTrait)
(*in).DeepCopyInto(*out)
}
- if in.OpenAPI != nil {
- in, out := &in.OpenAPI, &out.OpenAPI
+ if in.DeprecatedOpenAPI != nil {
+ in, out := &in.DeprecatedOpenAPI, &out.DeprecatedOpenAPI
*out = new(trait.OpenAPITrait)
(*in).DeepCopyInto(*out)
}
@@ -3361,8 +3361,8 @@ func (in *Traits) DeepCopyInto(out *Traits) {
*out = new(trait.QuarkusTrait)
(*in).DeepCopyInto(*out)
}
- if in.Registry != nil {
- in, out := &in.Registry, &out.Registry
+ if in.DeprecatedRegistry != nil {
+ in, out := &in.DeprecatedRegistry, &out.DeprecatedRegistry
*out = new(trait.RegistryTrait)
(*in).DeepCopyInto(*out)
}
@@ -3381,8 +3381,8 @@ func (in *Traits) DeepCopyInto(out *Traits) {
*out = new(trait.ServiceTrait)
(*in).DeepCopyInto(*out)
}
- if in.ServiceBinding != nil {
- in, out := &in.ServiceBinding, &out.ServiceBinding
+ if in.DeprecatedServiceBinding != nil {
+ in, out := &in.DeprecatedServiceBinding,
&out.DeprecatedServiceBinding
*out = new(trait.ServiceBindingTrait)
(*in).DeepCopyInto(*out)
}
@@ -3396,25 +3396,25 @@ func (in *Traits) DeepCopyInto(out *Traits) {
*out = new(trait.TolerationTrait)
(*in).DeepCopyInto(*out)
}
- if in.Addons != nil {
- in, out := &in.Addons, &out.Addons
+ if in.DeprecatedAddons != nil {
+ in, out := &in.DeprecatedAddons, &out.DeprecatedAddons
*out = make(map[string]AddonTrait, len(*in))
for key, val := range *in {
(*out)[key] = *val.DeepCopy()
}
}
- if in.Strimzi != nil {
- in, out := &in.Strimzi, &out.Strimzi
+ if in.DeprecatedStrimzi != nil {
+ in, out := &in.DeprecatedStrimzi, &out.DeprecatedStrimzi
*out = new(TraitSpec)
(*in).DeepCopyInto(*out)
}
- if in.ThreeScale != nil {
- in, out := &in.ThreeScale, &out.ThreeScale
+ if in.DeprecatedThreeScale != nil {
+ in, out := &in.DeprecatedThreeScale, &out.DeprecatedThreeScale
*out = new(TraitSpec)
(*in).DeepCopyInto(*out)
}
- if in.Tracing != nil {
- in, out := &in.Tracing, &out.Tracing
+ if in.DeprecatedTracing != nil {
+ in, out := &in.DeprecatedTracing, &out.DeprecatedTracing
*out = new(TraitSpec)
(*in).DeepCopyInto(*out)
}
diff --git a/pkg/client/camel/applyconfiguration/camel/v1/traits.go
b/pkg/client/camel/applyconfiguration/camel/v1/traits.go
index 7f5ca128a..626d8b5a2 100644
--- a/pkg/client/camel/applyconfiguration/camel/v1/traits.go
+++ b/pkg/client/camel/applyconfiguration/camel/v1/traits.go
@@ -49,7 +49,7 @@ type TraitsApplyConfiguration struct {
// The configuration of Error Handler trait.
//
// Deprecated: no longer in use.
- ErrorHandler *trait.ErrorHandlerTrait `json:"error-handler,omitempty"`
+ DeprecatedErrorHandler *trait.ErrorHandlerTrait
`json:"error-handler,omitempty"`
// The configuration of Istio trait
Gateway *trait.GatewayTrait `json:"gateway,omitempty"`
// The configuration of GC trait
@@ -66,8 +66,8 @@ type TraitsApplyConfiguration struct {
Istio *trait.IstioTrait `json:"istio,omitempty"`
// The configuration of Jolokia trait.
//
- // Deprecated: use jvm.agent instead.
- Jolokia *trait.JolokiaTrait `json:"jolokia,omitempty"`
+ // Deprecated: no longer in use.
+ DeprecatedJolokia *trait.JolokiaTrait `json:"jolokia,omitempty"`
// The configuration of JVM trait
JVM *trait.JVMTrait `json:"jvm,omitempty"`
// The configuration of Kamelets trait
@@ -87,7 +87,7 @@ type TraitsApplyConfiguration struct {
// The configuration of OpenAPI trait.
//
// Deprecated: no longer in use.
- OpenAPI *trait.OpenAPITrait `json:"openapi,omitempty"`
+ DeprecatedOpenAPI *trait.OpenAPITrait `json:"openapi,omitempty"`
// The configuration of Owner trait
Owner *trait.OwnerTrait `json:"owner,omitempty"`
// The configuration of PDB trait
@@ -106,8 +106,8 @@ type TraitsApplyConfiguration struct {
Quarkus *trait.QuarkusTrait `json:"quarkus,omitempty"`
// The configuration of Registry trait (support removed since version
2.5.0).
//
- // Deprecated: use jvm trait or read documentation.
- Registry *trait.RegistryTrait `json:"registry,omitempty"`
+ // Deprecated: no longer in use.
+ DeprecatedRegistry *trait.RegistryTrait `json:"registry,omitempty"`
// The configuration of Route trait.
//
// Deprecated: use ingress instead.
@@ -119,19 +119,19 @@ type TraitsApplyConfiguration struct {
// The configuration of Service Binding trait.
//
// Deprecated: no longer in use.
- ServiceBinding *trait.ServiceBindingTrait
`json:"service-binding,omitempty"`
+ DeprecatedServiceBinding *trait.ServiceBindingTrait
`json:"service-binding,omitempty"`
// The configuration of Telemetry trait
Telemetry *trait.TelemetryTrait `json:"telemetry,omitempty"`
// The configuration of Toleration trait
Toleration *trait.TolerationTrait `json:"toleration,omitempty"`
// Deprecated: no longer in use.
- Addons map[string]AddonTraitApplyConfiguration `json:"addons,omitempty"`
+ DeprecatedAddons map[string]AddonTraitApplyConfiguration
`json:"addons,omitempty"`
// Deprecated: no longer in use.
- Strimzi *TraitSpecApplyConfiguration `json:"strimzi,omitempty"`
+ DeprecatedStrimzi *TraitSpecApplyConfiguration
`json:"strimzi,omitempty"`
// Deprecated: no longer in use.
- ThreeScale *TraitSpecApplyConfiguration `json:"3scale,omitempty"`
+ DeprecatedThreeScale *TraitSpecApplyConfiguration
`json:"3scale,omitempty"`
// Deprecated: no longer in use.
- Tracing *TraitSpecApplyConfiguration `json:"tracing,omitempty"`
+ DeprecatedTracing *TraitSpecApplyConfiguration
`json:"tracing,omitempty"`
}
// TraitsApplyConfiguration constructs a declarative configuration of the
Traits type for use with
@@ -212,11 +212,11 @@ func (b *TraitsApplyConfiguration) WithEnvironment(value
trait.EnvironmentTrait)
return b
}
-// WithErrorHandler sets the ErrorHandler field in the declarative
configuration to the given value
+// WithDeprecatedErrorHandler sets the DeprecatedErrorHandler field in the
declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With"
function invocations.
-// If called multiple times, the ErrorHandler field is set to the value of the
last call.
-func (b *TraitsApplyConfiguration) WithErrorHandler(value
trait.ErrorHandlerTrait) *TraitsApplyConfiguration {
- b.ErrorHandler = &value
+// If called multiple times, the DeprecatedErrorHandler field is set to the
value of the last call.
+func (b *TraitsApplyConfiguration) WithDeprecatedErrorHandler(value
trait.ErrorHandlerTrait) *TraitsApplyConfiguration {
+ b.DeprecatedErrorHandler = &value
return b
}
@@ -276,11 +276,11 @@ func (b *TraitsApplyConfiguration) WithIstio(value
trait.IstioTrait) *TraitsAppl
return b
}
-// WithJolokia sets the Jolokia field in the declarative configuration to the
given value
+// WithDeprecatedJolokia sets the DeprecatedJolokia field in the declarative
configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With"
function invocations.
-// If called multiple times, the Jolokia field is set to the value of the last
call.
-func (b *TraitsApplyConfiguration) WithJolokia(value trait.JolokiaTrait)
*TraitsApplyConfiguration {
- b.Jolokia = &value
+// If called multiple times, the DeprecatedJolokia field is set to the value
of the last call.
+func (b *TraitsApplyConfiguration) WithDeprecatedJolokia(value
trait.JolokiaTrait) *TraitsApplyConfiguration {
+ b.DeprecatedJolokia = &value
return b
}
@@ -348,11 +348,11 @@ func (b *TraitsApplyConfiguration) WithMount(value
trait.MountTrait) *TraitsAppl
return b
}
-// WithOpenAPI sets the OpenAPI field in the declarative configuration to the
given value
+// WithDeprecatedOpenAPI sets the DeprecatedOpenAPI field in the declarative
configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With"
function invocations.
-// If called multiple times, the OpenAPI field is set to the value of the last
call.
-func (b *TraitsApplyConfiguration) WithOpenAPI(value trait.OpenAPITrait)
*TraitsApplyConfiguration {
- b.OpenAPI = &value
+// If called multiple times, the DeprecatedOpenAPI field is set to the value
of the last call.
+func (b *TraitsApplyConfiguration) WithDeprecatedOpenAPI(value
trait.OpenAPITrait) *TraitsApplyConfiguration {
+ b.DeprecatedOpenAPI = &value
return b
}
@@ -412,11 +412,11 @@ func (b *TraitsApplyConfiguration) WithQuarkus(value
trait.QuarkusTrait) *Traits
return b
}
-// WithRegistry sets the Registry field in the declarative configuration to
the given value
+// WithDeprecatedRegistry sets the DeprecatedRegistry field in the declarative
configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With"
function invocations.
-// If called multiple times, the Registry field is set to the value of the
last call.
-func (b *TraitsApplyConfiguration) WithRegistry(value trait.RegistryTrait)
*TraitsApplyConfiguration {
- b.Registry = &value
+// If called multiple times, the DeprecatedRegistry field is set to the value
of the last call.
+func (b *TraitsApplyConfiguration) WithDeprecatedRegistry(value
trait.RegistryTrait) *TraitsApplyConfiguration {
+ b.DeprecatedRegistry = &value
return b
}
@@ -444,11 +444,11 @@ func (b *TraitsApplyConfiguration) WithService(value
trait.ServiceTrait) *Traits
return b
}
-// WithServiceBinding sets the ServiceBinding field in the declarative
configuration to the given value
+// WithDeprecatedServiceBinding sets the DeprecatedServiceBinding field in the
declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With"
function invocations.
-// If called multiple times, the ServiceBinding field is set to the value of
the last call.
-func (b *TraitsApplyConfiguration) WithServiceBinding(value
trait.ServiceBindingTrait) *TraitsApplyConfiguration {
- b.ServiceBinding = &value
+// If called multiple times, the DeprecatedServiceBinding field is set to the
value of the last call.
+func (b *TraitsApplyConfiguration) WithDeprecatedServiceBinding(value
trait.ServiceBindingTrait) *TraitsApplyConfiguration {
+ b.DeprecatedServiceBinding = &value
return b
}
@@ -468,40 +468,40 @@ func (b *TraitsApplyConfiguration) WithToleration(value
trait.TolerationTrait) *
return b
}
-// WithAddons puts the entries into the Addons field in the declarative
configuration
+// WithDeprecatedAddons puts the entries into the DeprecatedAddons field in
the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With"
function invocations.
-// If called multiple times, the entries provided by each call will be put on
the Addons field,
-// overwriting an existing map entries in Addons field with the same key.
-func (b *TraitsApplyConfiguration) WithAddons(entries
map[string]AddonTraitApplyConfiguration) *TraitsApplyConfiguration {
- if b.Addons == nil && len(entries) > 0 {
- b.Addons = make(map[string]AddonTraitApplyConfiguration,
len(entries))
+// If called multiple times, the entries provided by each call will be put on
the DeprecatedAddons field,
+// overwriting an existing map entries in DeprecatedAddons field with the same
key.
+func (b *TraitsApplyConfiguration) WithDeprecatedAddons(entries
map[string]AddonTraitApplyConfiguration) *TraitsApplyConfiguration {
+ if b.DeprecatedAddons == nil && len(entries) > 0 {
+ b.DeprecatedAddons =
make(map[string]AddonTraitApplyConfiguration, len(entries))
}
for k, v := range entries {
- b.Addons[k] = v
+ b.DeprecatedAddons[k] = v
}
return b
}
-// WithStrimzi sets the Strimzi field in the declarative configuration to the
given value
+// WithDeprecatedStrimzi sets the DeprecatedStrimzi field in the declarative
configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With"
function invocations.
-// If called multiple times, the Strimzi field is set to the value of the last
call.
-func (b *TraitsApplyConfiguration) WithStrimzi(value
*TraitSpecApplyConfiguration) *TraitsApplyConfiguration {
- b.Strimzi = value
+// If called multiple times, the DeprecatedStrimzi field is set to the value
of the last call.
+func (b *TraitsApplyConfiguration) WithDeprecatedStrimzi(value
*TraitSpecApplyConfiguration) *TraitsApplyConfiguration {
+ b.DeprecatedStrimzi = value
return b
}
-// WithThreeScale sets the ThreeScale field in the declarative configuration
to the given value
+// WithDeprecatedThreeScale sets the DeprecatedThreeScale field in the
declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With"
function invocations.
-// If called multiple times, the ThreeScale field is set to the value of the
last call.
-func (b *TraitsApplyConfiguration) WithThreeScale(value
*TraitSpecApplyConfiguration) *TraitsApplyConfiguration {
- b.ThreeScale = value
+// If called multiple times, the DeprecatedThreeScale field is set to the
value of the last call.
+func (b *TraitsApplyConfiguration) WithDeprecatedThreeScale(value
*TraitSpecApplyConfiguration) *TraitsApplyConfiguration {
+ b.DeprecatedThreeScale = value
return b
}
-// WithTracing sets the Tracing field in the declarative configuration to the
given value
+// WithDeprecatedTracing sets the DeprecatedTracing field in the declarative
configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With"
function invocations.
-// If called multiple times, the Tracing field is set to the value of the last
call.
-func (b *TraitsApplyConfiguration) WithTracing(value
*TraitSpecApplyConfiguration) *TraitsApplyConfiguration {
- b.Tracing = value
+// If called multiple times, the DeprecatedTracing field is set to the value
of the last call.
+func (b *TraitsApplyConfiguration) WithDeprecatedTracing(value
*TraitSpecApplyConfiguration) *TraitsApplyConfiguration {
+ b.DeprecatedTracing = value
return b
}
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 ca126a6d5..84e898712 100644
--- a/pkg/resources/config/crd/bases/camel.apache.org_integrationplatforms.yaml
+++ b/pkg/resources/config/crd/bases/camel.apache.org_integrationplatforms.yaml
@@ -1458,7 +1458,7 @@ spec:
description: |-
The configuration of Jolokia trait.
- Deprecated: use jvm.agent instead.
+ Deprecated: no longer in use.
properties:
CACert:
description: |-
@@ -2289,7 +2289,7 @@ spec:
description: |-
The configuration of Registry trait (support removed
since version 2.5.0).
- Deprecated: use jvm trait or read documentation.
+ Deprecated: no longer in use.
properties:
configuration:
description: |-
@@ -4009,7 +4009,7 @@ spec:
description: |-
The configuration of Jolokia trait.
- Deprecated: use jvm.agent instead.
+ Deprecated: no longer in use.
properties:
CACert:
description: |-
@@ -4840,7 +4840,7 @@ spec:
description: |-
The configuration of Registry trait (support removed
since version 2.5.0).
- Deprecated: use jvm trait or read documentation.
+ Deprecated: no longer in use.
properties:
configuration:
description: |-
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 0d816df4c..24bd943c9 100644
--- a/pkg/resources/config/crd/bases/camel.apache.org_integrationprofiles.yaml
+++ b/pkg/resources/config/crd/bases/camel.apache.org_integrationprofiles.yaml
@@ -1316,7 +1316,7 @@ spec:
description: |-
The configuration of Jolokia trait.
- Deprecated: use jvm.agent instead.
+ Deprecated: no longer in use.
properties:
CACert:
description: |-
@@ -2147,7 +2147,7 @@ spec:
description: |-
The configuration of Registry trait (support removed
since version 2.5.0).
- Deprecated: use jvm trait or read documentation.
+ Deprecated: no longer in use.
properties:
configuration:
description: |-
@@ -3747,7 +3747,7 @@ spec:
description: |-
The configuration of Jolokia trait.
- Deprecated: use jvm.agent instead.
+ Deprecated: no longer in use.
properties:
CACert:
description: |-
@@ -4578,7 +4578,7 @@ spec:
description: |-
The configuration of Registry trait (support removed
since version 2.5.0).
- Deprecated: use jvm trait or read documentation.
+ Deprecated: no longer in use.
properties:
configuration:
description: |-
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 7c18bab71..d58e86cda 100644
--- a/pkg/resources/config/crd/bases/camel.apache.org_integrations.yaml
+++ b/pkg/resources/config/crd/bases/camel.apache.org_integrations.yaml
@@ -8167,7 +8167,7 @@ spec:
description: |-
The configuration of Jolokia trait.
- Deprecated: use jvm.agent instead.
+ Deprecated: no longer in use.
properties:
CACert:
description: |-
@@ -8998,7 +8998,7 @@ spec:
description: |-
The configuration of Registry trait (support removed
since version 2.5.0).
- Deprecated: use jvm trait or read documentation.
+ Deprecated: no longer in use.
properties:
configuration:
description: |-
@@ -10559,7 +10559,7 @@ spec:
description: |-
The configuration of Jolokia trait.
- Deprecated: use jvm.agent instead.
+ Deprecated: no longer in use.
properties:
CACert:
description: |-
@@ -11390,7 +11390,7 @@ spec:
description: |-
The configuration of Registry trait (support removed
since version 2.5.0).
- Deprecated: use jvm trait or read documentation.
+ Deprecated: no longer in use.
properties:
configuration:
description: |-
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 a94040859..8a6feaf8f 100644
--- a/pkg/resources/config/crd/bases/camel.apache.org_pipes.yaml
+++ b/pkg/resources/config/crd/bases/camel.apache.org_pipes.yaml
@@ -8223,7 +8223,7 @@ spec:
description: |-
The configuration of Jolokia trait.
- Deprecated: use jvm.agent instead.
+ Deprecated: no longer in use.
properties:
CACert:
description: |-
@@ -9058,7 +9058,7 @@ spec:
description: |-
The configuration of Registry trait (support removed
since version 2.5.0).
- Deprecated: use jvm trait or read documentation.
+ Deprecated: no longer in use.
properties:
configuration:
description: |-
@@ -10536,7 +10536,7 @@ spec:
description: |-
The configuration of Jolokia trait.
- Deprecated: use jvm.agent instead.
+ Deprecated: no longer in use.
properties:
CACert:
description: |-
@@ -11367,7 +11367,7 @@ spec:
description: |-
The configuration of Registry trait (support removed
since version 2.5.0).
- Deprecated: use jvm trait or read documentation.
+ Deprecated: no longer in use.
properties:
configuration:
description: |-
diff --git a/pkg/trait/jolokia.go b/pkg/trait/jolokia.go
deleted file mode 100644
index f77bfafaf..000000000
--- a/pkg/trait/jolokia.go
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one or more
-contributor license agreements. See the NOTICE file distributed with
-this work for additional information regarding copyright ownership.
-The ASF licenses this file to You under the Apache License, Version 2.0
-(the "License"); you may not use this file except in compliance with
-the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-package trait
-
-import (
- "fmt"
- "strconv"
- "strings"
-
- corev1 "k8s.io/api/core/v1"
- "k8s.io/utils/ptr"
-
- v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
- traitv1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1/trait"
- "github.com/apache/camel-k/v2/pkg/util"
-)
-
-const (
- jolokiaTraitID = "jolokia"
- jolokiaTraitOrder = 1800
-
- defaultJolokiaPort = 8778
- trueString = "true"
-)
-
-type jolokiaTrait struct {
- BaseTrait
- traitv1.JolokiaTrait `property:",squash"`
-}
-
-func newJolokiaTrait() Trait {
- return &jolokiaTrait{
- BaseTrait: NewBaseTrait(jolokiaTraitID, jolokiaTraitOrder),
- }
-}
-
-func (t *jolokiaTrait) Configure(e *Environment) (bool, *TraitCondition,
error) {
- if e.Integration == nil || !ptr.Deref(t.Enabled, false) {
- return false, 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 {
- if e.IntegrationInPhase(v1.IntegrationPhaseInitialization) {
- util.StringSliceUniqueAdd(&e.Integration.Status.Capabilities,
v1.CapabilityJolokia)
-
- return nil
- }
-
- container := e.GetIntegrationContainer()
- if container == nil {
- e.Integration.Status.SetCondition(
- v1.IntegrationConditionJolokiaAvailable,
- corev1.ConditionFalse,
- v1.IntegrationConditionContainerNotAvailableReason,
- "",
- )
-
- return nil
- }
-
- // Configure the Jolokia Java agent, first with the extra options
- options, err := keyValuePairArrayAsStringMap(t.Options)
- if err != nil {
- return err
- }
-
- t.setDefaultJolokiaOption(options, e.DetermineProfile())
- // Then add explicitly set trait configuration properties
- t.addToJolokiaOptions(options)
-
- // Options must be sorted so that the environment variable value is
consistent over iterations,
- // otherwise the value changes which results in triggering a new
deployment.
- optionValues := make([]string, len(options))
- for i, k := range util.SortedStringMapKeys(options) {
- optionValues[i] = k + "=" + options[k]
- }
-
- jolokiaFilepath := ""
- for _, ar := range e.IntegrationKit.Status.Artifacts {
- if strings.HasPrefix(ar.ID, "org.jolokia.jolokia-agent-jvm") ||
strings.HasPrefix(ar.ID, "org.jolokia.jolokia-jvm") {
- jolokiaFilepath = ar.Target
-
- break
- }
- }
- container.Args = append(container.Args,
"-javaagent:"+jolokiaFilepath+"="+strings.Join(optionValues, ","))
- container.Args = append(container.Args, "-cp", jolokiaFilepath)
-
- containerPort := corev1.ContainerPort{
- Name: "jolokia",
- ContainerPort: t.getPort(),
- Protocol: corev1.ProtocolTCP,
- }
-
- e.Integration.Status.SetCondition(
- v1.IntegrationConditionJolokiaAvailable,
- corev1.ConditionTrue,
- v1.IntegrationConditionJolokiaAvailableReason,
- fmt.Sprintf("%s(%s/%d)", container.Name, containerPort.Name,
containerPort.ContainerPort),
- )
-
- container.Ports = append(container.Ports, containerPort)
-
- return nil
-}
-
-func (t *jolokiaTrait) getPort() int32 {
- if t.Port == 0 {
- return defaultJolokiaPort
- }
-
- return t.Port
-}
-
-//nolint:staticcheck
-func (t *jolokiaTrait) setDefaultJolokiaOption(options map[string]string,
profile v1.TraitProfile) {
- // Do not override existing option
- if options["host"] == "" {
- options["host"] = "*"
- }
- if options["discoveryEnabled"] == "" {
- options["discoveryEnabled"] = "false"
- }
- //nolint:nestif
- if profile == v1.TraitProfileOpenShift {
- if options["protocol"] == "" {
- options["protocol"] = "https"
- }
- if options["caCert"] == "" {
- options["caCert"] =
"/var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt"
- }
- if options["extendedClientCheck"] == "" {
- options["extendedClientCheck"] = trueString
- }
- if options["useSslClientAuthentication"] == "" {
- options["useSslClientAuthentication"] = trueString
- }
- if options["clientPrincipal.1"] == "" {
- options["clientPrincipal.1"] = "cn=system:master-proxy"
- }
- if options["clientPrincipal.2"] == "" {
- options["clientPrincipal.2"] =
"cn=hawtio-online.hawtio.svc"
- }
- if options["clientPrincipal.3"] == "" {
- options["clientPrincipal.3"] =
"cn=fuse-console.fuse.svc"
- }
- }
-}
-
-func (t *jolokiaTrait) addToJolokiaOptions(options map[string]string) {
- if t.CaCert != nil {
- options["caCert"] = *t.CaCert
- }
- if t.ClientPrincipal != nil {
- for i, v := range t.ClientPrincipal {
- options[fmt.Sprintf("clientPrincipal.%v", i)] = v
- }
- }
- if t.ExtendedClientCheck != nil {
- options["extendedClientCheck"] =
strconv.FormatBool(*t.ExtendedClientCheck)
- }
- if t.Host != nil {
- options["host"] = *t.Host
- }
- if t.Password != nil {
- options["password"] = *t.Password
- }
- options["port"] = strconv.Itoa(int(t.getPort()))
- if t.Protocol != nil {
- options["protocol"] = *t.Protocol
- }
- if t.User != nil {
- options["user"] = *t.User
- }
- if t.UseSslClientAuthentication != nil {
- options["useSslClientAuthentication"] =
strconv.FormatBool(*t.UseSslClientAuthentication)
- }
-}
diff --git a/pkg/trait/jolokia_test.go b/pkg/trait/jolokia_test.go
deleted file mode 100644
index 0d3662b23..000000000
--- a/pkg/trait/jolokia_test.go
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one or more
-contributor license agreements. See the NOTICE file distributed with
-this work for additional information regarding copyright ownership.
-The ASF licenses this file to You under the Apache License, Version 2.0
-(the "License"); you may not use this file except in compliance with
-the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-package trait
-
-import (
- "testing"
-
- "github.com/stretchr/testify/assert"
- "github.com/stretchr/testify/require"
-
- appsv1 "k8s.io/api/apps/v1"
- corev1 "k8s.io/api/core/v1"
- "k8s.io/utils/ptr"
-
- v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
- "github.com/apache/camel-k/v2/pkg/util/kubernetes"
-)
-
-func TestConfigureJolokiaTraitInRunningPhaseDoesSucceed(t *testing.T) {
- trait, environment := createNominalJolokiaTest()
- environment.Integration.Status.Phase = v1.IntegrationPhaseRunning
-
- configured, condition, err := trait.Configure(environment)
-
- require.NoError(t, err)
- assert.True(t, configured)
- assert.NotNil(t, condition)
-}
-
-func TestApplyJolokiaTraitNominalShouldSucceed(t *testing.T) {
- trait, environment := createNominalJolokiaTest()
-
- err := trait.Apply(environment)
-
- require.NoError(t, err)
-
- container :=
environment.Resources.GetContainerByName(defaultContainerName)
- assert.NotNil(t, container)
-
- assert.Equal(t, []string{
-
"-javaagent:dependencies/lib/main/org.jolokia.jolokia-agent-jvm-1.7.1.jar=discoveryEnabled=false,host=*,port=8778",
- "-cp",
"dependencies/lib/main/org.jolokia.jolokia-agent-jvm-1.7.1.jar",
- },
- container.Args)
-
- assert.Len(t, container.Ports, 1)
- containerPort := container.Ports[0]
- assert.Equal(t, "jolokia", containerPort.Name)
- assert.Equal(t, int32(8778), containerPort.ContainerPort)
- assert.Equal(t, corev1.ProtocolTCP, containerPort.Protocol)
-
- assert.Len(t, environment.Integration.Status.Conditions, 1)
- condition := environment.Integration.Status.Conditions[0]
- assert.Equal(t, v1.IntegrationConditionJolokiaAvailable, condition.Type)
- assert.Equal(t, corev1.ConditionTrue, condition.Status)
-}
-
-func TestApplyJolokiaTraitForOpenShiftProfileShouldSucceed(t *testing.T) {
- trait, environment := createNominalJolokiaTest()
- //nolint:staticcheck
- environment.IntegrationKit.Spec.Profile = v1.TraitProfileOpenShift
-
- err := trait.Apply(environment)
-
- require.NoError(t, err)
-
- container :=
environment.Resources.GetContainerByName(defaultContainerName)
- assert.NotNil(t, container)
-
- assert.Equal(t, []string{
-
"-javaagent:dependencies/lib/main/org.jolokia.jolokia-agent-jvm-1.7.1.jar=caCert=/var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt,"
+
-
"clientPrincipal.1=cn=system:master-proxy,clientPrincipal.2=cn=hawtio-online.hawtio.svc,"
+
-
"clientPrincipal.3=cn=fuse-console.fuse.svc,discoveryEnabled=false,extendedClientCheck=true,"
+
-
"host=*,port=8778,protocol=https,useSslClientAuthentication=true",
- "-cp",
"dependencies/lib/main/org.jolokia.jolokia-agent-jvm-1.7.1.jar"},
- container.Args,
- )
-
- assert.Len(t, container.Ports, 1)
- containerPort := container.Ports[0]
- assert.Equal(t, "jolokia", containerPort.Name)
- assert.Equal(t, int32(8778), containerPort.ContainerPort)
- assert.Equal(t, corev1.ProtocolTCP, containerPort.Protocol)
-
- assert.Len(t, environment.Integration.Status.Conditions, 1)
- condition := environment.Integration.Status.Conditions[0]
- assert.Equal(t, v1.IntegrationConditionJolokiaAvailable, condition.Type)
- assert.Equal(t, corev1.ConditionTrue, condition.Status)
-}
-
-func TestApplyJolokiaTraitWithoutContainerShouldReportJolokiaUnavailable(t
*testing.T) {
- trait, environment := createNominalJolokiaTest()
- environment.Resources = kubernetes.NewCollection()
-
- err := trait.Apply(environment)
-
- require.NoError(t, err)
- assert.Len(t, environment.Integration.Status.Conditions, 1)
- condition := environment.Integration.Status.Conditions[0]
- assert.Equal(t, v1.IntegrationConditionJolokiaAvailable, condition.Type)
- assert.Equal(t, corev1.ConditionFalse, condition.Status)
-}
-
-func TestApplyJolokiaTraitWithOptionShouldOverrideDefault(t *testing.T) {
- trait, environment := createNominalJolokiaTest()
- trait.Options = []string{
- "host=explicit-host",
- "discoveryEnabled=true",
- "protocol=http",
- "caCert=.cacert",
- "extendedClientCheck=false",
- "clientPrincipal=cn:any",
- "useSslClientAuthentication=false",
- }
-
- err := trait.Apply(environment)
-
- require.NoError(t, err)
-
- container :=
environment.Resources.GetContainerByName(defaultContainerName)
-
- assert.Equal(t, container.Args, []string{
-
"-javaagent:dependencies/lib/main/org.jolokia.jolokia-agent-jvm-1.7.1.jar=caCert=.cacert,clientPrincipal=cn:any,"
+
-
"discoveryEnabled=true,extendedClientCheck=false,host=explicit-host,port=8778,protocol=http,"
+
- "useSslClientAuthentication=false",
- "-cp",
"dependencies/lib/main/org.jolokia.jolokia-agent-jvm-1.7.1.jar",
- })
-}
-
-func TestApplyJolokiaTraitWithUnparseableOptionShouldReturnError(t *testing.T)
{
- trait, environment := createNominalJolokiaTest()
- trait.Options = []string{"unparseable options"}
-
- err := trait.Apply(environment)
-
- require.Error(t, err)
-}
-
-func createNominalJolokiaTest() (*jolokiaTrait, *Environment) {
- trait, _ := newJolokiaTrait().(*jolokiaTrait)
- trait.Enabled = ptr.To(true)
-
- environment := &Environment{
- Catalog: NewCatalog(nil),
- Integration: &v1.Integration{
- Status: v1.IntegrationStatus{
- Phase: v1.IntegrationPhaseDeploying,
- },
- },
- IntegrationKit: &v1.IntegrationKit{
- Status: v1.IntegrationKitStatus{
- Artifacts: []v1.Artifact{
- {
- ID:
"org.jolokia.jolokia-agent-jvm-1.7.1.jar",
- Target:
"dependencies/lib/main/org.jolokia.jolokia-agent-jvm-1.7.1.jar",
- },
- },
- },
- },
- Resources: kubernetes.NewCollection(
- &appsv1.Deployment{
- Spec: appsv1.DeploymentSpec{
- Template: corev1.PodTemplateSpec{
- Spec: corev1.PodSpec{
- Containers:
[]corev1.Container{
- {
- Name:
defaultContainerName,
- },
- },
- },
- },
- },
- },
- ),
- }
-
- return trait, environment
-}
diff --git a/pkg/trait/jvm.go b/pkg/trait/jvm.go
index 9c281cc2e..91af3cef2 100644
--- a/pkg/trait/jvm.go
+++ b/pkg/trait/jvm.go
@@ -270,7 +270,7 @@ func (t *jvmTrait) enableDebug(e *Environment) string {
if meta.Labels == nil {
meta.Labels = make(map[string]string)
}
- meta.Labels["camel.apache.org/debug"] = trueString
+ meta.Labels["camel.apache.org/debug"] = "true"
})
t.DebugAddress = "*:5005"
diff --git a/pkg/trait/trait_configure_test.go
b/pkg/trait/trait_configure_test.go
index 0d41770e4..13ee4d896 100644
--- a/pkg/trait/trait_configure_test.go
+++ b/pkg/trait/trait_configure_test.go
@@ -129,7 +129,7 @@ func TestTraitListConfigurationFromAnnotations(t
*testing.T) {
Integration: &v1.Integration{
ObjectMeta: metav1.ObjectMeta{
Annotations: map[string]string{
- v1.TraitAnnotationPrefix +
"jolokia.options": `["opt1", "opt2"]`,
+ v1.TraitAnnotationPrefix +
"environment.vars": `["V1=a", "V2=b"]`,
v1.TraitAnnotationPrefix +
"camel.runtime-version": "1.2.3",
},
},
@@ -137,8 +137,8 @@ func TestTraitListConfigurationFromAnnotations(t
*testing.T) {
}
c := NewCatalog(nil)
require.NoError(t, c.Configure(&env))
- jt, _ := c.GetTrait("jolokia").(*jolokiaTrait)
- assert.Equal(t, []string{"opt1", "opt2"}, jt.Options)
+ et, _ := c.GetTrait("environment").(*environmentTrait)
+ assert.Equal(t, []string{"V1=a", "V2=b"}, et.Vars)
cml, _ := c.GetTrait("camel").(*camelTrait)
assert.Equal(t, "1.2.3", cml.RuntimeVersion)
}
diff --git a/pkg/trait/trait_register.go b/pkg/trait/trait_register.go
index e2a0c121b..e902996bd 100644
--- a/pkg/trait/trait_register.go
+++ b/pkg/trait/trait_register.go
@@ -38,7 +38,6 @@ func init() {
AddToTraits(NewInitTrait)
AddToTraits(newIngressTrait)
AddToTraits(newIstioTrait)
- AddToTraits(newJolokiaTrait)
AddToTraits(newJvmTrait)
AddToTraits(newKameletsTrait)
AddToTraits(newKedaTrait)