This is an automated email from the ASF dual-hosted git repository.

astefanutti pushed a commit to branch release-1.7.x
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 9e4b4c751247c937da37c2658aaaf12bf5ed5667
Author: Antonin Stefanutti <[email protected]>
AuthorDate: Mon Jan 10 14:48:42 2022 +0100

    chore(jvm): Rely on default JVM HTTP proxy port numbers
---
 pkg/trait/jvm.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pkg/trait/jvm.go b/pkg/trait/jvm.go
index f697993..4b87f1b 100644
--- a/pkg/trait/jvm.go
+++ b/pkg/trait/jvm.go
@@ -180,7 +180,7 @@ func (t *jvmTrait) Apply(e *Environment) error {
                if !util.StringSliceContainsAnyOf(t.Options, "http.proxyHost") {
                        args = append(args, "-Dhttp.proxyHost="+u.Hostname())
                }
-               if !util.StringSliceContainsAnyOf(t.Options, "http.proxyPort") {
+               if port := u.Port(); !util.StringSliceContainsAnyOf(t.Options, 
"http.proxyPort") && port != "" {
                        args = append(args, "-Dhttp.proxyPort="+u.Port())
                }
                if user := u.User; !util.StringSliceContainsAnyOf(t.Options, 
"http.proxyUser") && user != nil {
@@ -199,7 +199,7 @@ func (t *jvmTrait) Apply(e *Environment) error {
                if !util.StringSliceContainsAnyOf(t.Options, "https.proxyHost") 
{
                        args = append(args, "-Dhttps.proxyHost="+u.Hostname())
                }
-               if !util.StringSliceContainsAnyOf(t.Options, "https.proxyPort") 
{
+               if port := u.Port(); !util.StringSliceContainsAnyOf(t.Options, 
"https.proxyPort") && port != "" {
                        args = append(args, "-Dhttps.proxyPort="+u.Port())
                }
                if user := u.User; !util.StringSliceContainsAnyOf(t.Options, 
"https.proxyUser") && user != nil {

Reply via email to