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 9eddad3efdd142bab870430ab0dd5022809ebc1c
Author: Antonin Stefanutti <anto...@stefanutti.fr>
AuthorDate: Fri Jan 17 16:27:28 2020 +0100

    chore(trait): Set integration container working directory
---
 pkg/trait/classpath.go | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/pkg/trait/classpath.go b/pkg/trait/classpath.go
index bbbe845..0405ee3 100644
--- a/pkg/trait/classpath.go
+++ b/pkg/trait/classpath.go
@@ -108,21 +108,26 @@ func (t *classpathTrait) Apply(e *Environment) error {
 
        container := e.Resources.GetContainerByName(containerName)
        if container != nil {
+               // Add mounted resources to the class path
                for _, m := range container.VolumeMounts {
                        classpath.Add(m.MountPath)
                }
                items := classpath.List()
-               // keep classpath sorted
+               // Keep class path sorted so that it's consistent over 
reconciliation cycles
                sort.Strings(items)
 
                container.Args = append(container.Args, "-cp", 
strings.Join(items, ":"))
 
+               // Add main Class or JAR
                quarkus := e.Catalog.GetTrait("quarkus").(*quarkusTrait)
                if quarkus.isEnabled() {
                        container.Args = append(container.Args, "-jar", 
"camel-k-integration-"+defaults.Version+"-runner.jar")
                } else {
                        container.Args = append(container.Args, 
defaultMainClass)
                }
+
+               // Set the container working directory
+               container.WorkingDir = "/deployments"
        }
 
        return nil

Reply via email to