func New(ctx *controller.Context, issuer v1alpha1.GenericIssuer) (issuer.Interface, error) {
	if issuer.GetSpec().ACME == nil {
		return nil, fmt.Errorf("acme config may not be empty")
	}

	if issuer.GetSpec().ACME.Server == "" ||
		issuer.GetSpec().ACME.PrivateKey.Name == "" ||
		issuer.GetSpec().ACME.Email == "" {
		return nil, fmt.Errorf("acme server, private key and email are required fields")
	}

	secretsLister := ctx.KubeSharedInformerFactory.Core().V1().Secrets().Lister()
	podsLister := ctx.KubeSharedInformerFactory.Core().V1().Pods().Lister()
	servicesLister := ctx.KubeSharedInformerFactory.Core().V1().Services().Lister()
	ingressLister := ctx.KubeSharedInformerFactory.Extensions().V1beta1().Ingresses().Lister()

	a := &Acme{
		Context: ctx,
		helper:  acme.NewHelper(secretsLister, ctx.ClusterResourceNamespace),
		issuer:  issuer,

		secretsLister:  secretsLister,
		podsLister:     podsLister,
		servicesLister: servicesLister,
		ingressLister:  ingressLister,

		dnsSolver:  dns.NewSolver(ctx),
		httpSolver: http.NewSolver(ctx),
	}
	return a, nil
}
// New returns a new ACME issuer interface for the given issuer.
New returns a new ACME issuer interface for the given issuer.
// New returns a new ACME issuer interface for the given issuer .
func New(ctx *controller.Context, issuer v1alpha1.GenericIssuer) (issuer.Interface, error) {
	if issuer.GetSpec().ACME == nil {
		return nil, fmt.Errorf("acme config may not be empty")
	}
	if issuer.GetSpec().ACME.Server == "" ||
		issuer.GetSpec().ACME.PrivateKey.Name == "" ||
		issuer.GetSpec().ACME.Email == "" {
		return nil, fmt.Errorf("acme server, private key and email are required fields")
	}
	secretsLister := ctx.KubeSharedInformerFactory.Core().V1().Secrets().Lister()
	podsLister := ctx.KubeSharedInformerFactory.Core().V1().Pods().Lister()
	servicesLister := ctx.KubeSharedInformerFactory.Core().V1().Services().Lister()
	ingressLister := ctx.KubeSharedInformerFactory.Extensions().V1beta1().Ingresses().Lister()
	a := &Acme{
		Context: ctx,
		helper:  acme.NewHelper(secretsLister, ctx.ClusterResourceNamespace),
		issuer:  issuer,
		secretsLister:  secretsLister,
		podsLister:     podsLister,
		servicesLister: servicesLister,
		ingressLister:  ingressLister,
		dnsSolver:  dns.NewSolver(ctx),
		httpSolver: http.NewSolver(ctx),
	}
	return a, nil
}
func New ( ctx * controller . Context , issuer v1alpha1 . GenericIssuer ) ( issuer . Interface , error ) { if issuer . GetSpec ( ) . ACME == nil { return nil , fmt . Errorf ( " " ) } if issuer . GetSpec ( ) . ACME . Server == " " || issuer . GetSpec ( ) . ACME . PrivateKey . Name == " " || issuer . GetSpec ( ) . ACME . Email == " " { return nil , fmt . Errorf ( " " ) } secretsLister := ctx . KubeSharedInformerFactory . Core ( ) . V1 ( ) . Secrets ( ) . Lister ( ) podsLister := ctx . KubeSharedInformerFactory . Core ( ) . V1 ( ) . Pods ( ) . Lister ( ) servicesLister := ctx . KubeSharedInformerFactory . Core ( ) . V1 ( ) . Services ( ) . Lister ( ) ingressLister := ctx . KubeSharedInformerFactory . Extensions ( ) . V1beta1 ( ) . Ingresses ( ) . Lister ( ) a := & Acme { Context : ctx , helper : acme . NewHelper ( secretsLister , ctx . ClusterResourceNamespace ) , issuer : issuer , secretsLister : secretsLister , podsLister : podsLister , servicesLister : servicesLister , ingressLister : ingressLister , dnsSolver : dns . NewSolver ( ctx ) , httpSolver : http . NewSolver ( ctx ) , } return a , nil }
New returns a new ACME issuer interface for the given issuer.
New returns a new ACME issuer interface for the given issuer .