-
Notifications
You must be signed in to change notification settings - Fork 336
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(e2e): disable meshmtls test with delegated gateway (#12108)
I noticed a flake and began investigating. I discovered the TLS version and cipher are not configured for the delegated gateway. Since the `MeshTLS` policy is a `from` policy and the delegated gateway has no inbound listener, the policy cannot be matched to any listener. The test passed because the request was sent before the configuration was fully delivered. Excluded the test and added `MustPassRepeatedly(5)` to ensure better validation once the issue is resolved. <!-- Is there a MADR? An Issue? A related PR? --> xref: #12107 <!-- > Changelog: skip --> <!-- Uncomment the above section to explicitly set a [`> Changelog:` entry here](https://github.com/kumahq/kuma/blob/master/CONTRIBUTING.md#submitting-a-patch)? --> Signed-off-by: Lukasz Dziedziak <[email protected]>
- Loading branch information
1 parent
a9ebcbf
commit e76eb12
Showing
2 changed files
with
123 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
package delegated | ||
|
||
import ( | ||
"fmt" | ||
|
||
. "github.com/onsi/ginkgo/v2" | ||
. "github.com/onsi/gomega" | ||
|
||
"github.com/kumahq/kuma/pkg/plugins/policies/meshtls/api/v1alpha1" | ||
"github.com/kumahq/kuma/test/framework" | ||
"github.com/kumahq/kuma/test/framework/client" | ||
"github.com/kumahq/kuma/test/framework/envs/kubernetes" | ||
) | ||
|
||
func MeshTLS(config *Config) func() { | ||
GinkgoHelper() | ||
|
||
return func() { | ||
meshTls := fmt.Sprintf(` | ||
apiVersion: kuma.io/v1alpha1 | ||
kind: MeshTLS | ||
metadata: | ||
name: meshtls-delegated | ||
namespace: %s | ||
labels: | ||
kuma.io/mesh: %s | ||
spec: | ||
targetRef: | ||
kind: Mesh | ||
from: | ||
- targetRef: | ||
kind: Mesh | ||
default: | ||
tlsVersion: | ||
min: TLS13 | ||
max: TLS13`, config.CpNamespace, config.Mesh) | ||
|
||
framework.AfterEachFailure(func() { | ||
framework.DebugKube(kubernetes.Cluster, config.Mesh, config.Namespace, config.ObservabilityDeploymentName) | ||
}) | ||
|
||
framework.E2EAfterEach(func() { | ||
Expect(framework.DeleteMeshResources( | ||
kubernetes.Cluster, | ||
config.Mesh, | ||
v1alpha1.MeshTLSResourceTypeDescriptor, | ||
)).To(Succeed()) | ||
}) | ||
|
||
XIt("should not break communication once switched to TLS 1.3", func() { | ||
// check that communication to test-server works | ||
Eventually(func(g Gomega) { | ||
_, err := client.CollectEchoResponse( | ||
kubernetes.Cluster, | ||
"demo-client", | ||
fmt.Sprintf("http://%s/test-server", config.KicIP), | ||
client.FromKubernetesPod(config.NamespaceOutsideMesh, "demo-client"), | ||
) | ||
g.Expect(err).ToNot(HaveOccurred()) | ||
}, "30s", "1s", MustPassRepeatedly(5)).Should(Succeed()) | ||
|
||
// change TLS version to 1.3 | ||
Expect(framework.YamlK8s(meshTls)(kubernetes.Cluster)).To(Succeed()) | ||
|
||
// check that communication to test-server works | ||
Eventually(func(g Gomega) { | ||
_, err := client.CollectEchoResponse( | ||
kubernetes.Cluster, | ||
"demo-client", | ||
fmt.Sprintf("http://%s/test-server", config.KicIP), | ||
client.FromKubernetesPod(config.NamespaceOutsideMesh, "demo-client"), | ||
) | ||
g.Expect(err).ToNot(HaveOccurred()) | ||
}, "30s", "1s", MustPassRepeatedly(5)).Should(Succeed()) | ||
}) | ||
} | ||
} |