Documentation ¶
Overview ¶
Package csr contains the logic required to generate, create and approve Certificate Signing Requests (CSR) for the Virtual Kubelet instances.
Index ¶
- func Approve(clientSet k8s.Interface, csr *certv1.CertificateSigningRequest, ...) error
- func ApproverHandler(clientset k8s.Interface, reason, message string, ...) func(*certv1.CertificateSigningRequest)
- func IsApproved(csr *certv1.CertificateSigningRequest) bool
- func NewKeyAndRequest(commonName string) (keyBytes, csrBytes []byte, err error)
- type Watcher
- func (r Watcher) RegisterHandler(handler WatcherHandlerFunc)
- func (r Watcher) RegisterHandlerForName(name string, handler WatcherHandlerFunc)
- func (r Watcher) RetrieveCertificate(ctx context.Context, csrName string) ([]byte, error)
- func (r Watcher) Start(ctx context.Context)
- func (r Watcher) UnregisterHandler()
- func (r Watcher) UnregisterHandlerForName(name string)
- type WatcherHandlerFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Approve ¶
func Approve(clientSet k8s.Interface, csr *certv1.CertificateSigningRequest, reason, message string) error
Approve approves the provided CertificateSigningRequest.
func ApproverHandler ¶
func ApproverHandler(clientset k8s.Interface, reason, message string, filter func(csr *certv1.CertificateSigningRequest) bool) func(*certv1.CertificateSigningRequest)
ApproverHandler returns an handler to approve CSRs.
func IsApproved ¶
func IsApproved(csr *certv1.CertificateSigningRequest) bool
IsApproved returns whether the given CSR is approved (i.e. has a valid certificate).
func NewKeyAndRequest ¶ added in v0.6.0
NewKeyAndRequest returns a new private key, and the corresponding CSR for the given subject.
Types ¶
type Watcher ¶
type Watcher struct {
// contains filtered or unexported fields
}
Watcher wraps the logic to be notified once a CSR change is detected.
func NewWatcher ¶
func NewWatcher(clientset k8s.Interface, resync time.Duration, labelSelector labels.Selector, fieldSelector fields.Selector) Watcher
NewWatcher initializes a new CSR watcher for the given label selector and field selector.
func (Watcher) RegisterHandler ¶
func (r Watcher) RegisterHandler(handler WatcherHandlerFunc)
RegisterHandler registers a new handler executed once a CSR change is detected.
func (Watcher) RegisterHandlerForName ¶
func (r Watcher) RegisterHandlerForName(name string, handler WatcherHandlerFunc)
RegisterHandlerForName registers a new handler executed once a new CSR change with the given name is detected.
func (Watcher) RetrieveCertificate ¶
RetrieveCertificate registers the appropriate handlers and waits for the certificate retrieval.
func (Watcher) UnregisterHandler ¶
func (r Watcher) UnregisterHandler()
UnregisterHandler un-registers the handler executed once a CSR change is detected.
func (Watcher) UnregisterHandlerForName ¶
UnregisterHandlerForName un-registers the handler executed once a CSR change with the given name is detected.
type WatcherHandlerFunc ¶
type WatcherHandlerFunc func(*certv1.CertificateSigningRequest)
WatcherHandlerFunc represents a the function type executed once an approved CSR is observesd by the informer.