From 707d2864f85f2df26425b38468400f6459f0c510 Mon Sep 17 00:00:00 2001 From: Reto Lehmann Date: Wed, 18 Oct 2023 09:48:54 +0200 Subject: [PATCH] Test istio with system-internal-tls enabled (#14494) * Test istio with system-internal-tls enabled * Rename test and fix lint warnings --- .github/workflows/kind-e2e.yaml | 6 ++++++ .../systeminternaltls/system_internal_tls_test.go | 15 ++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/workflows/kind-e2e.yaml b/.github/workflows/kind-e2e.yaml index 18bac8d37bbf..7f59f0eb3d0b 100644 --- a/.github/workflows/kind-e2e.yaml +++ b/.github/workflows/kind-e2e.yaml @@ -95,6 +95,7 @@ jobs: - kourier - kourier-tls - istio + - istio-tls - istio-ambient - contour # Disabled due to consistent failures @@ -118,6 +119,11 @@ jobs: - ingress: istio namespace-resources: virtualservices + - ingress: istio-tls + ingress-class: istio + namespace-resources: virtualservices + enable-tls: 1 + - ingress: istio-ambient namespace-resources: virtualservices ingress-class: istio diff --git a/test/e2e/systeminternaltls/system_internal_tls_test.go b/test/e2e/systeminternaltls/system_internal_tls_test.go index e7f23e383ed1..5012e0cd223a 100644 --- a/test/e2e/systeminternaltls/system_internal_tls_test.go +++ b/test/e2e/systeminternaltls/system_internal_tls_test.go @@ -38,14 +38,15 @@ import ( v1test "knative.dev/serving/test/v1" ) -// TestInternalEncrytion tests the TLS connections between system components. -func TestInternalEncryption(t *testing.T) { +// TestSystemInternalTLS tests the TLS connections between system components. +func TestSystemInternalTLS(t *testing.T) { if !test.ServingFlags.EnableAlphaFeatures { t.Skip("Alpha features not enabled") } - if !(strings.Contains(test.ServingFlags.IngressClass, "kourier")) { - t.Skip("Skip this test for non-kourier ingress.") + if !(strings.Contains(test.ServingFlags.IngressClass, "kourier") || + strings.Contains(test.ServingFlags.IngressClass, "istio")) { + t.Skip("Skip this test for non-kourier or non-istio ingress.") } t.Parallel() @@ -126,7 +127,7 @@ func scanPodLogs(req *rest.Request, matcher func(string) bool) (matchCount int, podLogs, err := req.Stream(context.Background()) if err != nil { - err = fmt.Errorf("Failed to stream activator logs: %w", err) + err = fmt.Errorf("failed to stream activator logs: %w", err) return } @@ -134,7 +135,7 @@ func scanPodLogs(req *rest.Request, matcher func(string) bool) (matchCount int, _, err = io.Copy(buf, podLogs) podLogs.Close() if err != nil { - err = fmt.Errorf("Failed to read activator logs from buffer: %w", err) + err = fmt.Errorf("failed to read activator logs from buffer: %w", err) return } @@ -146,7 +147,7 @@ func scanPodLogs(req *rest.Request, matcher func(string) bool) (matchCount int, } if err = scanner.Err(); err != nil { - err = fmt.Errorf("Failed scanning activator logs: %w", err) + err = fmt.Errorf("failed scanning activator logs: %w", err) return }