You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by as...@apache.org on 2022/01/19 08:40:34 UTC

[camel-k] 08/32: chore(e2e): Set NO_PROXY with the Kubernetes service cluster IPs

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 a6aa32b4191d646036394110535e3a76d671c394
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Fri Jan 7 12:48:08 2022 +0100

    chore(e2e): Set NO_PROXY with the Kubernetes service cluster IPs
---
 e2e/common/build/maven_http_proxy_test.go | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/e2e/common/build/maven_http_proxy_test.go b/e2e/common/build/maven_http_proxy_test.go
index 4386a9e..fed2646 100644
--- a/e2e/common/build/maven_http_proxy_test.go
+++ b/e2e/common/build/maven_http_proxy_test.go
@@ -31,6 +31,7 @@ import (
 	"fmt"
 	"math/big"
 	rand2 "math/rand"
+	"strings"
 	"testing"
 	"time"
 
@@ -294,14 +295,24 @@ ProxyVia Off
 			}),
 		))
 
+		svc := Service("default", "kubernetes")()
+		Expect(svc).NotTo(BeNil())
+
+		// It may be needed to populate the values from the cluster, machine and service network CIDRs
+		noProxy := []string{
+			".cluster.local",
+			".svc",
+			"localhost",
+		}
+		noProxy = append(noProxy, svc.Spec.ClusterIPs...)
+
 		// Install Camel K with the HTTP proxy
 		Expect(Kamel("install", "-n", ns,
 			"--operator-env-vars", fmt.Sprintf("HTTP_PROXY=http://%s", hostname),
 			// FIXME: TLS handshake issue
 			// "--operator-env-vars", fmt.Sprintf("HTTPS_PROXY=https://%s", hostname),
 			// "--maven-ca-secret", secret.Name+"/"+corev1.TLSCertKey,
-			// FIXME: use the cluster network CIDR
-			"--operator-env-vars", "NO_PROXY=.cluster.local,.svc,10.0.0.0/16,127.0.0.1,172.17.0.0/18,172.21.0.0/16",
+			"--operator-env-vars", "NO_PROXY="+strings.Join(noProxy, ","),
 		).Execute()).To(Succeed())
 
 		Eventually(PlatformPhase(ns), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))