package predicate import ( "k8s.io/apimachinery/pkg/runtime" acmapi "gitbucket.jerxie.com/yangyangxie/AnthosCertManager/pkg/apis/anthoscertmanager/v1" ) // CertificateSecretName returns a predicate that used to filter Certificates // to only those with the given 'spec.secretName'. func CertificateSecretName(name string) Func { return func(obj runtime.Object) bool { crt := obj.(*acmapi.Certificate) return crt.Spec.SecretName == name } } // CertificateSecretName returns a predicate that used to filter Certificates // to only those with the given 'status.nextPrivateKeySecretName'. // It is not possible to select Certificates with a 'nil' secret name using // this predicate function. func CertificateNextPrivateKeySecretName(name string) Func { return func(obj runtime.Object) bool { crt := obj.(*acmapi.Certificate) if crt.Status.NextPrivateKeySecretName == nil { return false } return *crt.Status.NextPrivateKeySecretName == name } }