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

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

commit 99679d761b5f179a8b4a21e1d5c14e02e107d7ff
Author: Gaelle Fournier <gaelle.fournier.w...@gmail.com>
AuthorDate: Wed Jun 5 15:59:06 2024 +0200

    test(e2e): Add check on env vars for pod
---
 e2e/advanced/maven_http_proxy_test.go | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/e2e/advanced/maven_http_proxy_test.go 
b/e2e/advanced/maven_http_proxy_test.go
index 965118f62..551934a93 100644
--- a/e2e/advanced/maven_http_proxy_test.go
+++ b/e2e/advanced/maven_http_proxy_test.go
@@ -37,6 +37,7 @@ import (
        "time"
 
        "github.com/apache/camel-k/v2/pkg/util"
+       "github.com/apache/camel-k/v2/pkg/util/envvar"
        "github.com/apache/camel-k/v2/pkg/util/kubernetes"
        "github.com/apache/camel-k/v2/pkg/util/olm"
 
@@ -187,6 +188,22 @@ func TestMavenProxy(t *testing.T) {
 
                g.Eventually(PlatformPhase(t, ctx, ns), 
TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
 
+               // Check that operator pod has env_vars
+               g.Eventually(OperatorPodHas(t, ctx, ns, func(op *corev1.Pod) 
bool {
+                       if envVar := envvar.Get(op.Spec.Containers[0].Env, 
"HTTP_PROXY"); envVar != nil {
+                               return envVar.Value == fmt.Sprintf("http://%s";, 
hostname)
+                       }
+                       return false
+
+               }), TestTimeoutShort).Should(BeTrue())
+               g.Eventually(OperatorPodHas(t, ctx, ns, func(op *corev1.Pod) 
bool {
+                       if envVar := envvar.Get(op.Spec.Containers[0].Env, 
"NO_PROXY"); envVar != nil {
+                               return envVar.Value == strings.Join(noProxy, 
",")
+                       }
+                       return false
+
+               }), TestTimeoutShort).Should(BeTrue())
+
                // Run the Integration
                name := RandomizedSuffixName("java")
                g.Expect(KamelRunWithID(t, ctx, operatorID, ns, 
"files/Java.java", "--name", name).Execute()).To(Succeed())

Reply via email to