Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(jvm): Bind all interfaces to restore remote debugging with newer JDK versions #1500

Merged
merged 1 commit into from
Jun 5, 2020
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: 2 additions & 1 deletion deploy/traits.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/traits/pages/jvm.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions pkg/trait/jvm.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand All @@ -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,
}
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/trait/jvm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)
}

Expand Down