controllers: test HelmRepository missing secretRef
This commit is contained in:
parent
3c70c8d333
commit
8f09c453ab
|
|
@ -212,7 +212,7 @@ func (r *HelmRepositoryReconciler) shouldResetStatus(repository sourcev1.HelmRep
|
|||
}
|
||||
|
||||
// set initial status
|
||||
if len(repository.Status.Conditions) == 0 || resetStatus {
|
||||
if len(repository.Status.Conditions) == 0 {
|
||||
resetStatus = true
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -212,8 +212,23 @@ var _ = Describe("HelmRepositoryReconciler", func() {
|
|||
Eventually(func() bool {
|
||||
got := &sourcev1.HelmRepository{}
|
||||
_ = k8sClient.Get(context.Background(), key, got)
|
||||
return got.Status.Artifact != nil
|
||||
return got.Status.Artifact != nil &&
|
||||
storage.ArtifactExist(*got.Status.Artifact)
|
||||
}, timeout, interval).Should(BeTrue())
|
||||
|
||||
By("Expecting missing secret error")
|
||||
Expect(k8sClient.Delete(context.Background(), secret)).Should(Succeed())
|
||||
got := &sourcev1.HelmRepository{}
|
||||
Eventually(func() bool {
|
||||
_ = k8sClient.Get(context.Background(), key, got)
|
||||
for _, c := range got.Status.Conditions {
|
||||
if c.Reason == sourcev1.AuthenticationFailedReason {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}, timeout, interval).Should(BeTrue())
|
||||
Expect(got.Status.Artifact).ShouldNot(BeNil())
|
||||
})
|
||||
})
|
||||
|
||||
|
|
@ -294,7 +309,22 @@ var _ = Describe("HelmRepositoryReconciler", func() {
|
|||
Eventually(func() bool {
|
||||
got := &sourcev1.HelmRepository{}
|
||||
_ = k8sClient.Get(context.Background(), key, got)
|
||||
return got.Status.Artifact != nil
|
||||
return got.Status.Artifact != nil &&
|
||||
storage.ArtifactExist(*got.Status.Artifact)
|
||||
}, timeout, interval).Should(BeTrue())
|
||||
|
||||
By("Expecting missing secret error")
|
||||
Expect(k8sClient.Delete(context.Background(), secret)).Should(Succeed())
|
||||
got := &sourcev1.HelmRepository{}
|
||||
Eventually(func() bool {
|
||||
_ = k8sClient.Get(context.Background(), key, got)
|
||||
for _, c := range got.Status.Conditions {
|
||||
if c.Reason == sourcev1.AuthenticationFailedReason {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}, timeout, interval).Should(BeTrue())
|
||||
Expect(got.Status.Artifact).ShouldNot(BeNil())
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in New Issue