package meta import ( certmgr "github.com/cert-manager/cert-manager/pkg/apis/certmanager/v1" certmeta "github.com/cert-manager/cert-manager/pkg/apis/meta/v1" ) // IsIssuerCondition generically determines if the provided conditions contains // a condition of the provided type with the provided status func IsIssuerCondition(conditions []certmgr.IssuerCondition, cType string, cStatus certmeta.ConditionStatus) (bool, string) { reason := "" for _, condition := range conditions { if string(condition.Type) == cType { return condition.Status == cStatus, condition.Reason } } return false, reason } // IsCertificateCondition generically determines if the provided conditions contains // a condition of the provided type with the provided status func IsCertificateCondition(conditions []certmgr.CertificateCondition, cType string, cStatus certmeta.ConditionStatus) (bool, string) { reason := "" for _, condition := range conditions { if string(condition.Type) == cType { return condition.Status == cStatus, condition.Reason } } return false, reason }