From 6147bdb9c181d279bd35711be7d600c3009fa7f0 Mon Sep 17 00:00:00 2001 From: Matous Jobanek Date: Fri, 14 Jun 2024 13:51:55 +0200 Subject: [PATCH] verify that certificates are not used in ToolchainClusters (#994) --- test/e2e/toolchaincluster_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/e2e/toolchaincluster_test.go b/test/e2e/toolchaincluster_test.go index 578f4ea55..068f7c716 100644 --- a/test/e2e/toolchaincluster_test.go +++ b/test/e2e/toolchaincluster_test.go @@ -61,6 +61,7 @@ func verifyToolchainCluster(t *testing.T, await *wait.Awaitility, otherAwait *wa secretRef(secretCopy.Name), owner(current.Labels["ownerClusterName"]), namespace(current.Labels["namespace"]), + disableTLS(current.Spec.DisabledTLSValidations), capacityExhausted, // make sure this cluster cannot be used in other e2e tests ) @@ -107,6 +108,7 @@ func verifyToolchainCluster(t *testing.T, await *wait.Awaitility, otherAwait *wa secretRef(secretCopy.Name), owner(current.Labels["ownerClusterName"]), namespace(current.Labels["namespace"]), + disableTLS(current.Spec.DisabledTLSValidations), capacityExhausted, // make sure this cluster cannot be used in other e2e tests ) @@ -215,3 +217,10 @@ func caBundle(bundle string) clusterOption { c.Spec.CABundle = bundle } } + +// disableTLS sets the DisabledTLSValidations field +func disableTLS(validations []toolchainv1alpha1.TLSValidation) clusterOption { + return func(c *toolchainv1alpha1.ToolchainCluster) { + c.Spec.DisabledTLSValidations = validations + } +}