forked from knative/serving
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[release-v1.15] Add missing changes from knative#702 (knative#871)
* Add missing changes from openshift-knative#702 * Fix e2e-tls tests
- Loading branch information
Showing
5 changed files
with
145 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
diff --git a/test/e2e/systeminternaltls/system_internal_tls_test.go b/test/e2e/systeminternaltls/system_internal_tls_test.go | ||
--- a/test/e2e/systeminternaltls/system_internal_tls_test.go (revision 9d0fa738d33402b893659610ddf4d4635cfa61f4) | ||
+++ b/test/e2e/systeminternaltls/system_internal_tls_test.go (revision 4f646561395fb011368360e35365f8664383cdc5) | ||
@@ -113,6 +113,7 @@ | ||
|
||
// TestTLSCertificateRotation tests certificate rotation and automatic reloading of certs. | ||
func TestTLSCertificateRotation(t *testing.T) { | ||
+ | ||
if !test.ServingFlags.EnableAlphaFeatures { | ||
t.Skip("Alpha features not enabled") | ||
} | ||
@@ -162,6 +163,7 @@ | ||
|
||
t.Log("Creating ConfigMap with old and new CA certs") | ||
systemNS := os.Getenv(system.NamespaceEnvKey) | ||
+ ingressNS := os.Getenv(test.GatewayNamespaceOverride) | ||
|
||
// Create ConfigMap with networking.knative.dev/trust-bundle label in required namespaces | ||
cm := &corev1.ConfigMap{ | ||
@@ -179,7 +181,15 @@ | ||
_, err = clients.KubeClient.CoreV1().ConfigMaps(systemNS). | ||
Create(context.Background(), cm, v1.CreateOptions{}) | ||
if err != nil { | ||
- t.Fatal("Failed to create configmap:", err) | ||
+ t.Fatal("Failed to create configmap in "+systemNS, err) | ||
+ } | ||
+ | ||
+ if ingressNS != "" && systemNS != ingressNS { | ||
+ _, err = clients.KubeClient.CoreV1().ConfigMaps(ingressNS). | ||
+ Create(context.Background(), cm, v1.CreateOptions{}) | ||
+ if err != nil { | ||
+ t.Fatal("Failed to create configmap in "+ingressNS, err) | ||
+ } | ||
} | ||
|
||
// Clean up on test failure or interrupt | ||
@@ -187,7 +197,14 @@ | ||
test.TearDown(clients, &names) | ||
if err := clients.KubeClient.CoreV1().ConfigMaps(systemNS). | ||
Delete(context.Background(), cm.Name, v1.DeleteOptions{}); err != nil && !errors.IsNotFound(err) { | ||
- t.Fatal("Failed to delete configmap:", err) | ||
+ t.Fatal("Failed to delete configmap in "+systemNS, err) | ||
+ } | ||
+ | ||
+ if ingressNS != "" && systemNS != ingressNS { | ||
+ if err := clients.KubeClient.CoreV1().ConfigMaps(ingressNS). | ||
+ Delete(context.Background(), cm.Name, v1.DeleteOptions{}); err != nil && !errors.IsNotFound(err) { | ||
+ t.Fatal("Failed to delete configmap in "+ingressNS, err) | ||
+ } | ||
} | ||
}) | ||
|
||
@@ -218,6 +235,14 @@ | ||
if err := clients.KubeClient.CoreV1().Secrets(systemNS).Delete(context.Background(), config.ServingRoutingCertName, v1.DeleteOptions{}); err != nil { | ||
t.Fatalf("Failed to delete secret %s in system namespace: %v", config.ServingRoutingCertName, err) | ||
} | ||
+ | ||
+ if ingressNS != "" && systemNS != ingressNS { | ||
+ t.Log("Deleting secret in ingress namespace") | ||
+ if err := clients.KubeClient.CoreV1().Secrets(ingressNS).Delete(context.Background(), config.ServingRoutingCertName, v1.DeleteOptions{}); err != nil { | ||
+ t.Fatalf("Failed to delete secret %s in ingress namespace: %v", config.ServingRoutingCertName, err) | ||
+ } | ||
+ } | ||
+ | ||
checkEndpointState(t, clients, url) | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters