Skip to content

Commit

Permalink
test(e2e): template support for rawitems
Browse files Browse the repository at this point in the history
  • Loading branch information
prometherion committed Feb 16, 2023
1 parent 8e7078a commit 0187845
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions e2e/tenantresource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ var _ = Describe("Creating a TenantResource object", func() {
Name: "raw-secret-1",
},
Type: corev1.SecretTypeOpaque,
Data: map[string][]byte{
"{{ tenant.name }}": []byte("Cg=="),
"{{ namespace }}": []byte("Cg=="),
},
},
},
},
Expand All @@ -118,6 +122,10 @@ var _ = Describe("Creating a TenantResource object", func() {
Name: "raw-secret-2",
},
Type: corev1.SecretTypeOpaque,
Data: map[string][]byte{
"{{ tenant.name }}": []byte("Cg=="),
"{{ namespace }}": []byte("Cg=="),
},
},
},
},
Expand All @@ -132,6 +140,10 @@ var _ = Describe("Creating a TenantResource object", func() {
Name: "raw-secret-3",
},
Type: corev1.SecretTypeOpaque,
Data: map[string][]byte{
"{{ tenant.name }}": []byte("Cg=="),
"{{ namespace }}": []byte("Cg=="),
},
},
},
},
Expand Down Expand Up @@ -220,6 +232,16 @@ var _ = Describe("Creating a TenantResource object", func() {
return secrets.Items
}, defaultTimeoutInterval, defaultPollInterval).Should(HaveLen(4))
})

By(fmt.Sprintf("ensuring raw items are templated in %s Namespace", ns), func() {
for _, name := range []string{"raw-secret-1", "raw-secret-2", "raw-secret-3"} {
secret := corev1.Secret{}
Expect(k8sClient.Get(context.TODO(), types.NamespacedName{Name: name, Namespace: ns}, &secret)).ToNot(HaveOccurred())

Expect(secret.Data).To(HaveKey(solar.Name))
Expect(secret.Data).To(HaveKey(ns))
}
})
}

By("using a Namespace selector", func() {
Expand Down

0 comments on commit 0187845

Please sign in to comment.