1
0
Fork 0
mirror of https://github.com/external-secrets/external-secrets.git synced 2024-12-14 11:57:59 +00:00

improve test?

This commit is contained in:
Marc Ingram 2022-01-21 14:01:45 -07:00
parent e93a1716f5
commit 07415bdabf

View file

@ -336,7 +336,26 @@ var _ = Describe("ExternalSecret controller", func() {
}, client.FieldOwner(FakeManager))).To(Succeed())
tc.checkSecret = func(es *esv1alpha1.ExternalSecret, secret *v1.Secret) {
Expect(secret.ResourceVersion).To(Equal("295"))
oldResourceVersion := secret.ResourceVersion
cleanSecret := secret.DeepCopy()
Expect(k8sClient.Patch(context.Background(), secret, client.MergeFrom(cleanSecret))).To(Succeed())
newSecret := &v1.Secret{}
Eventually(func() bool {
secretLookupKey := types.NamespacedName{
Name: ExternalSecretTargetSecretName,
Namespace: ExternalSecretNamespace,
}
err := k8sClient.Get(context.Background(), secretLookupKey, newSecret)
if err != nil {
return false
}
return oldResourceVersion == newSecret.ResourceVersion
}, timeout, interval).Should(Equal(true))
}
}