package issuing
import (
"context"
acmapi "gitbucket.jerxie.com/yangyangxie/AnthosCertManager/pkg/apis/anthoscertmanager/v1"
controllerpkg "gitbucket.jerxie.com/yangyangxie/AnthosCertManager/pkg/controller"
"gitbucket.jerxie.com/yangyangxie/AnthosCertManager/pkg/controller/certificates/issuing/internal"
"github.com/go-logr/logr"
"k8s.io/client-go/informers"
"k8s.io/client-go/kubernetes"
corelisters "k8s.io/client-go/listers/core/v1"
"k8s.io/client-go/tools/cache"
"k8s.io/client-go/util/workqueue"
"k8s.io/utils/clock"
)
const (
ControllerName = "certificates-issuing"
)
// This controller observes the state of the certificate's 'Issuing' condition,
// which will then copy the signed certificates and private key to the target
// Secret resource.
type controller struct {
secretLister corelisters.SecretLister
clock clock.Clock
client kubernetes.Interface
// secretsUpdateData is used by the SecretTemplate controller for
// re-reconciling Secrets where the SecretTemplate is not up to date with a
// Certificate's secret.
secretsUpdateData func(context.Context, *acmapi.Certificate, internal.SecretData) error
}
func NewController(
log logr.Logger,
kubeClient kubernetes.Interface,
factory informers.SharedInformerFactory,
clock clock.Clock,
certificateControllerOptions controllerpkg.CertificateOptions,
fieldManager string,
) (*controller, workqueue.RateLimitingInterface, []cache.InformerSynced) {
// // create a queue used to queue up items to be processed
// queue := workqueue.NewNamedRateLimitingQueue(workqueue.NewItemExponentialFailureRateLimiter(time.Second, time.Second*30), ControllerName)
// // obtain references to all the informers used by this controller
// certificateInforomer := acmFa
return nil, nil, nil
}