csr

package
v0.8.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 26, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package csr contains the logic required to generate, create and approve Certificate Signing Requests (CSR) for the Virtual Kubelet instances.

Index

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

func NewKeyAndRequest(commonName string) (keyBytes, csrBytes []byte, err error)

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

func (r Watcher) RetrieveCertificate(ctx context.Context, csrName string) ([]byte, error)

RetrieveCertificate registers the appropriate handlers and waits for the certificate retrieval.

func (Watcher) Start

func (r Watcher) Start(ctx context.Context)

Start starts the CSR watcher.

func (Watcher) UnregisterHandler

func (r Watcher) UnregisterHandler()

UnregisterHandler un-registers the handler executed once a CSR change is detected.

func (Watcher) UnregisterHandlerForName

func (r Watcher) UnregisterHandlerForName(name string)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL