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

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

commit da858f3ea9dfef9727beb58445abc4cab95c9536
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 200670b..57d442a 100644
--- a/pkg/trait/jvm.go
+++ b/pkg/trait/jvm.go
@@ -181,7 +181,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 {
@@ -200,7 +200,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