...
1 package meta
2
3 import (
4 certmgr "github.com/cert-manager/cert-manager/pkg/apis/certmanager/v1"
5 certmeta "github.com/cert-manager/cert-manager/pkg/apis/meta/v1"
6 )
7
8
9
10 func IsIssuerCondition(conditions []certmgr.IssuerCondition, cType string, cStatus certmeta.ConditionStatus) (bool, string) {
11 reason := ""
12 for _, condition := range conditions {
13 if string(condition.Type) == cType {
14 return condition.Status == cStatus, condition.Reason
15 }
16 }
17 return false, reason
18 }
19
20
21
22 func IsCertificateCondition(conditions []certmgr.CertificateCondition, cType string, cStatus certmeta.ConditionStatus) (bool, string) {
23 reason := ""
24 for _, condition := range conditions {
25 if string(condition.Type) == cType {
26 return condition.Status == cStatus, condition.Reason
27 }
28 }
29 return false, reason
30 }
31
View as plain text