controllers: test HelmRepository invalid URL

This commit is contained in:
Hidde Beydals 2020-04-17 12:26:42 +02:00
parent 8f09c453ab
commit 31656c2d62
1 changed files with 11 additions and 1 deletions

View File

@ -107,8 +107,18 @@ var _ = Describe("HelmRepositoryReconciler", func() {
updated := &sourcev1.HelmRepository{}
Expect(k8sClient.Get(context.Background(), key, updated)).Should(Succeed())
updated.Spec.Interval = metav1.Duration{Duration: 60 * time.Second}
updated.Spec.URL = "invalid#url?"
Expect(k8sClient.Update(context.Background(), updated)).Should(Succeed())
Eventually(func() bool {
_ = k8sClient.Get(context.Background(), key, updated)
for _, c := range updated.Status.Conditions {
if c.Reason == sourcev1.URLInvalidReason {
return true
}
}
return false
}, timeout, interval).Should(BeTrue())
Expect(updated.Status.Artifact).ToNot(BeNil())
By("Expecting to delete successfully")
got = &sourcev1.HelmRepository{}