check that issuer is not nil before reading its field values on cleanup

Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
This commit is contained in:
Tim Ramlot 2023-05-06 21:36:53 +02:00
parent 50ac858898
commit e9c4cd9f3f
No known key found for this signature in database
GPG Key ID: 47428728E0C2878D
2 changed files with 6 additions and 2 deletions

View File

@ -69,7 +69,9 @@ var _ = TPPDescribe("Certificate with a properly configured Issuer", func() {
AfterEach(func() {
By("Cleaning up")
f.CertManagerClientSet.CertmanagerV1().Issuers(f.Namespace.Name).Delete(context.TODO(), issuer.Name, metav1.DeleteOptions{})
if issuer != nil {
f.CertManagerClientSet.CertmanagerV1().Issuers(f.Namespace.Name).Delete(context.TODO(), issuer.Name, metav1.DeleteOptions{})
}
})
It("should obtain a signed certificate for a single domain", func() {

View File

@ -46,7 +46,9 @@ var _ = TPPDescribe("properly configured Venafi TPP Issuer", func() {
AfterEach(func() {
By("Cleaning up")
f.CertManagerClientSet.CertmanagerV1().Issuers(f.Namespace.Name).Delete(context.TODO(), issuer.Name, metav1.DeleteOptions{})
if issuer != nil {
f.CertManagerClientSet.CertmanagerV1().Issuers(f.Namespace.Name).Delete(context.TODO(), issuer.Name, metav1.DeleteOptions{})
}
})
It("should set Ready=True accordingly", func() {