This is an automated email from the ASF dual-hosted git repository. astefanutti pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit daedb24ac4cfe71c9631dc628e7a451884d8aef8 Author: Antonin Stefanutti <anto...@stefanutti.fr> AuthorDate: Thu Jan 23 09:29:33 2020 +0100 chore(trait): Move JVM related configuration to the JVM trait --- pkg/trait/container.go | 7 +++---- pkg/trait/jvm.go | 7 ++++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pkg/trait/container.go b/pkg/trait/container.go index 02dd117..fb5d4c6 100644 --- a/pkg/trait/container.go +++ b/pkg/trait/container.go @@ -101,10 +101,9 @@ func (t *containerTrait) Configure(e *Environment) (bool, error) { func (t *containerTrait) Apply(e *Environment) error { container := corev1.Container{ - Name: t.Name, - Image: e.Integration.Status.Image, - Env: make([]corev1.EnvVar, 0), - Command: []string{"java"}, + Name: t.Name, + Image: e.Integration.Status.Image, + Env: make([]corev1.EnvVar, 0), } // combine Environment of integration with platform, kit, integration diff --git a/pkg/trait/jvm.go b/pkg/trait/jvm.go index b143683..c09e46d 100644 --- a/pkg/trait/jvm.go +++ b/pkg/trait/jvm.go @@ -100,6 +100,10 @@ func (t *jvmTrait) Apply(e *Environment) error { container := e.getIntegrationContainer() if container != nil { + // Set the container command and working directory + container.Command = []string{"java"} + container.WorkingDir = "/deployments" + // Add mounted resources to the class path for _, m := range container.VolumeMounts { classpath.Add(m.MountPath) @@ -117,9 +121,6 @@ func (t *jvmTrait) Apply(e *Environment) error { } else { container.Args = append(container.Args, defaultMainClass) } - - // Set the container working directory - container.WorkingDir = "/deployments" } return nil