From b76480e51c06249a33c6b0103e40eed3bb642fcd Mon Sep 17 00:00:00 2001 From: Pasquale Congiusti Date: Mon, 15 Jan 2024 17:02:32 +0100 Subject: [PATCH] fix(jib): inherit maven options --- e2e/commonwithcustominstall/platform_traits_test.go | 3 +++ pkg/util/maven/maven_command.go | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/e2e/commonwithcustominstall/platform_traits_test.go b/e2e/commonwithcustominstall/platform_traits_test.go index 7e0d5380b7..839cf5a964 100644 --- a/e2e/commonwithcustominstall/platform_traits_test.go +++ b/e2e/commonwithcustominstall/platform_traits_test.go @@ -41,12 +41,15 @@ func TestTraitOnIntegrationPlatform(t *testing.T) { Expect(KamelInstallWithID(operatorID, ns).Execute()).To(Succeed()) containerTestName := "testname" + + Eventually(PlatformPhase(ns), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady)) ip := Platform(ns)() ip.Spec.Traits = v1.Traits{Logging: &trait.LoggingTrait{Level: "DEBUG"}, Container: &trait.ContainerTrait{Name: containerTestName}} if err := TestClient().Update(TestContext, ip); err != nil { t.Fatal("Can't create IntegrationPlatform", err) } + Eventually(PlatformPhase(ns), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady)) name := RandomizedSuffixName("java") t.Run("Run integration with platform traits", func(t *testing.T) { diff --git a/pkg/util/maven/maven_command.go b/pkg/util/maven/maven_command.go index 5c01a36fd5..f9429e6e69 100644 --- a/pkg/util/maven/maven_command.go +++ b/pkg/util/maven/maven_command.go @@ -143,7 +143,7 @@ func (c *Command) Do(ctx context.Context) error { Log.WithValues("MAVEN_OPTS", mavenOptions).Infof("executing: %s", strings.Join(cmd.Args, " ")) // generate maven file - if err := generateMavenContext(c.context.Path, args); err != nil { + if err := generateMavenContext(c.context.Path, args, mavenOptions); err != nil { return err } @@ -286,7 +286,7 @@ func ParseGAV(gav string) (Dependency, error) { } // Create a MAVEN_CONTEXT file containing all arguments for a maven command. -func generateMavenContext(path string, args []string) error { +func generateMavenContext(path string, args []string, options string) error { // TODO refactor maven code to avoid creating a file to pass command args commandArgs := make([]string, 0) for _, arg := range args { @@ -295,5 +295,5 @@ func generateMavenContext(path string, args []string) error { } } - return util.WriteToFile(filepath.Join(path, "MAVEN_CONTEXT"), strings.Join(commandArgs, " ")) + return util.WriteToFile(filepath.Join(path, "MAVEN_CONTEXT"), strings.Join(commandArgs, " ")+" "+options) }