|
|
@@ -368,17 +368,17 @@ var _ = Describe("ClusterExternalSecret controller", func() {
|
|
|
clusterExternalSecret: func(namespaces []v1.Namespace) esv1beta1.ClusterExternalSecret {
|
|
|
ces := defaultClusterExternalSecret()
|
|
|
ces.Spec.NamespaceSelector.MatchLabels = map[string]string{"kubernetes.io/metadata.name": namespaces[0].Name}
|
|
|
- return *ces
|
|
|
- },
|
|
|
- beforeCheck: func(ctx context.Context, namespaces []v1.Namespace, created esv1beta1.ClusterExternalSecret) {
|
|
|
+
|
|
|
es := &esv1beta1.ExternalSecret{
|
|
|
ObjectMeta: metav1.ObjectMeta{
|
|
|
- Name: created.Name,
|
|
|
+ Name: ces.Name,
|
|
|
Namespace: namespaces[0].Name,
|
|
|
},
|
|
|
}
|
|
|
- Expect(k8sClient.Create(ctx, es)).ShouldNot(HaveOccurred())
|
|
|
-
|
|
|
+ Expect(k8sClient.Create(context.Background(), es)).ShouldNot(HaveOccurred())
|
|
|
+ return *ces
|
|
|
+ },
|
|
|
+ beforeCheck: func(ctx context.Context, namespaces []v1.Namespace, created esv1beta1.ClusterExternalSecret) {
|
|
|
ces := esv1beta1.ClusterExternalSecret{}
|
|
|
Eventually(func(g Gomega) {
|
|
|
key := types.NamespacedName{Namespace: created.Namespace, Name: created.Name}
|
|
|
@@ -386,6 +386,12 @@ var _ = Describe("ClusterExternalSecret controller", func() {
|
|
|
g.Expect(len(ces.Status.FailedNamespaces)).Should(Equal(1))
|
|
|
}).WithTimeout(timeout).WithPolling(interval).Should(Succeed())
|
|
|
|
|
|
+ es := &esv1beta1.ExternalSecret{
|
|
|
+ ObjectMeta: metav1.ObjectMeta{
|
|
|
+ Name: ces.Name,
|
|
|
+ Namespace: namespaces[0].Name,
|
|
|
+ },
|
|
|
+ }
|
|
|
Expect(k8sClient.Delete(ctx, es)).ShouldNot(HaveOccurred())
|
|
|
},
|
|
|
expectedClusterExternalSecret: func(namespaces []v1.Namespace, created esv1beta1.ClusterExternalSecret) esv1beta1.ClusterExternalSecret {
|