Skip to content

Commit

Permalink
fix(e2e): Set NO_PROXY to wildcard for the environment trait tests
Browse files Browse the repository at this point in the history
  • Loading branch information
astefanutti committed Feb 21, 2022
1 parent b02991e commit 274c81f
Showing 1 changed file with 1 addition and 21 deletions.
22 changes: 1 addition & 21 deletions e2e/common/traits/environment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ package traits

import (
"fmt"
"os"
"strings"
"testing"

Expand All @@ -41,26 +40,7 @@ func TestEnvironmentTrait(t *testing.T) {
WithNewTestNamespace(t, func(ns string) {
// HTTP proxy configuration
httpProxy := "http://proxy"
noProxy := []string{
".cluster.local",
".svc",
"localhost",
".apache.org",
}

// Retrieve the Kubernetes Service ClusterIPs to populate the NO_PROXY environment variable
svc := Service("default", "kubernetes")()
Expect(svc).NotTo(BeNil())

noProxy = append(noProxy, svc.Spec.ClusterIPs...)

// Retrieve the internal container registry to populate the NO_PROXY environment variable
if registry, ok := os.LookupEnv("KAMEL_INSTALL_REGISTRY"); ok {
domain := RegistryRegexp.FindString(registry)
Expect(domain).NotTo(BeNil())
domain = strings.Split(domain, ":")[0]
noProxy = append(noProxy, domain)
}
noProxy := []string{"*"}

// Install Camel K with the HTTP proxy environment variable
Expect(Kamel("install", "-n", ns,
Expand Down

0 comments on commit 274c81f

Please sign in to comment.