Skip to content

Commit

Permalink
chore(jolokia): upgrade to Jolokia 1.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
tadayosi committed Oct 1, 2021
1 parent 64a410c commit a3f97be
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 16 deletions.
4 changes: 2 additions & 2 deletions pkg/trait/jolokia.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func (t *jolokiaTrait) Apply(e *Environment) (err error) {
}

// TODO: We may want to make the Jolokia version configurable
util.StringSliceUniqueAdd(&e.Integration.Status.Dependencies, "mvn:org.jolokia:jolokia-jvm:jar:1.7.0")
util.StringSliceUniqueAdd(&e.Integration.Status.Dependencies, "mvn:org.jolokia:jolokia-jvm:jar:1.7.1")

return nil
}
Expand Down Expand Up @@ -153,7 +153,7 @@ func (t *jolokiaTrait) Apply(e *Environment) (err error) {
optionValues[i] = k + "=" + options[k]
}

container.Args = append(container.Args, "-javaagent:dependencies/lib/main/org.jolokia.jolokia-jvm-1.7.0.jar="+strings.Join(optionValues, ","))
container.Args = append(container.Args, "-javaagent:dependencies/lib/main/org.jolokia.jolokia-jvm-1.7.1.jar="+strings.Join(optionValues, ","))

containerPort := corev1.ContainerPort{
Name: "jolokia",
Expand Down
6 changes: 3 additions & 3 deletions pkg/trait/jolokia_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func TestApplyJolokiaTraitNominalShouldSucceed(t *testing.T) {
assert.NotNil(t, container)

assert.Equal(t, container.Args, []string{
"-javaagent:dependencies/lib/main/org.jolokia.jolokia-jvm-1.7.0.jar=discoveryEnabled=false,host=*,port=8778",
"-javaagent:dependencies/lib/main/org.jolokia.jolokia-jvm-1.7.1.jar=discoveryEnabled=false,host=*,port=8778",
})

assert.Len(t, container.Ports, 1)
Expand All @@ -77,7 +77,7 @@ func TestApplyJolokiaTraitForOpenShiftProfileShouldSucceed(t *testing.T) {
assert.NotNil(t, container)

assert.Equal(t, container.Args, []string{
"-javaagent:dependencies/lib/main/org.jolokia.jolokia-jvm-1.7.0.jar=caCert=/var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt," +
"-javaagent:dependencies/lib/main/org.jolokia.jolokia-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",
Expand Down Expand Up @@ -127,7 +127,7 @@ func TestApplyJolokiaTraitWithOptionShouldOverrideDefault(t *testing.T) {
container := environment.Resources.GetContainerByName(defaultContainerName)

assert.Equal(t, container.Args, []string{
"-javaagent:dependencies/lib/main/org.jolokia.jolokia-jvm-1.7.0.jar=caCert=.cacert,clientPrincipal=cn:any," +
"-javaagent:dependencies/lib/main/org.jolokia.jolokia-jvm-1.7.1.jar=caCert=.cacert,clientPrincipal=cn:any," +
"discoveryEnabled=true,extendedClientCheck=false,host=explicit-host,port=8778,protocol=http," +
"useSslClientAuthentication=false",
})
Expand Down
11 changes: 0 additions & 11 deletions pkg/util/camel/camel_dependencies.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,6 @@ func ManageIntegrationDependencies(
gav := strings.TrimPrefix(d, "mvn:")

project.AddEncodedDependencyGAV(gav)
// TODO hack for tools.jar dependency issue in jolokia-jvm
// this block should be removed once the jolokia-jvm pom issue
// is resolved
// https://github.com/rhuss/jolokia/issues/473
if strings.Contains(gav, "org.jolokia:jolokia-jvm") {
me := maven.Exclusion{
GroupID: "com.sun",
ArtifactID: "tools",
}
project.AddEncodedDependencyExclusion(gav, me)
}
default:
if dep := jitpack.ToDependency(d); dep != nil {
project.AddDependency(*dep)
Expand Down

0 comments on commit a3f97be

Please sign in to comment.