Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release-1.0] Add an e2e test for Ambient config in IstioCNI #617

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions tests/e2e/ambient/ambient_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ kind: IstioCNI
metadata:
name: default
spec:
values:
cni:
ambient:
dnsCapture: true
profile: ambient
version: %s
namespace: %s`
Expand All @@ -102,6 +106,21 @@ spec:
}).Should(Succeed(), "CNI DaemonSet Pods are not Available")
Success("CNI DaemonSet is deployed in the namespace and Running")
})

It("uses the configured values in the istio-cni-config config map", func(ctx SpecContext) {
cm := corev1.ConfigMap{}

Eventually(func() error {
if _, err := common.GetObject(ctx, cl, kube.Key("istio-cni-config", istioCniNamespace), &cm); err != nil {
return err
}

if val, ok := cm.Data["AMBIENT_DNS_CAPTURE"]; !ok || val != "true" {
return fmt.Errorf("expected AMBIENT_DNS_CAPTURE=true, got %q", val)
}
return nil
}).Should(Succeed(), "Expected 'AMBIENT_DNS_CAPTURE' to be set to 'true'")
})
})

When("the Istio CR is created with ambient profile", func() {
Expand Down