From f4415dba84e9347876a8ea91c5dc7402a5e3e0dc Mon Sep 17 00:00:00 2001 From: Antonin Stefanutti Date: Fri, 5 Jun 2020 15:05:06 +0200 Subject: [PATCH] fix(jvm): Bind all interfaces to restore remote debugging with newer JDK versions --- deploy/traits.yaml | 3 ++- docs/modules/traits/pages/jvm.adoc | 2 +- pkg/trait/jvm.go | 7 +++---- pkg/trait/jvm_test.go | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/deploy/traits.yaml b/deploy/traits.yaml index 19d78b638e..847c167db0 100755 --- a/deploy/traits.yaml +++ b/deploy/traits.yaml @@ -415,7 +415,8 @@ traits: description: Suspends the target JVM immediately before the main class is loaded - name: debug-address type: string - description: Transport address at which to listen for the newly launched JVM + description: Transport address at which to listen for the newly launched JVM (default + `*:5005`) - name: options type: string description: A comma-separated list of JVM options diff --git a/docs/modules/traits/pages/jvm.adoc b/docs/modules/traits/pages/jvm.adoc index d395980472..bd94aacabf 100755 --- a/docs/modules/traits/pages/jvm.adoc +++ b/docs/modules/traits/pages/jvm.adoc @@ -36,7 +36,7 @@ The following configuration options are available: | jvm.debug-address | string -| Transport address at which to listen for the newly launched JVM +| Transport address at which to listen for the newly launched JVM (default `*:5005`) | jvm.options | string diff --git a/pkg/trait/jvm.go b/pkg/trait/jvm.go index e09c2c5e54..f7b4acbe76 100644 --- a/pkg/trait/jvm.go +++ b/pkg/trait/jvm.go @@ -44,7 +44,7 @@ type jvmTrait struct { Debug bool `property:"debug"` // Suspends the target JVM immediately before the main class is loaded DebugSuspend bool `property:"debug-suspend"` - // Transport address at which to listen for the newly launched JVM + // Transport address at which to listen for the newly launched JVM (default `*:5005`) DebugAddress string `property:"debug-address"` // A comma-separated list of JVM options Options *string `property:"options"` @@ -54,9 +54,8 @@ type jvmTrait struct { func newJvmTrait() Trait { return &jvmTrait{ - BaseTrait: NewBaseTrait("jvm", 2000), - // To be defaulted to "*:5005" when upgrading the default base image to JDK9+ - DebugAddress: "5005", + BaseTrait: NewBaseTrait("jvm", 2000), + DebugAddress: "*:5005", PrintCommand: true, } } diff --git a/pkg/trait/jvm_test.go b/pkg/trait/jvm_test.go index 9309384272..df97459fa2 100644 --- a/pkg/trait/jvm_test.go +++ b/pkg/trait/jvm_test.go @@ -174,7 +174,7 @@ func TestApplyJvmTraitWithDebugEnabled(t *testing.T) { assert.Nil(t, err) assert.Contains(t, d.Spec.Template.Spec.Containers[0].Args, - "-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005", + "-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:5005", ) }