manager

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetCertificatesFunc

type GetCertificatesFunc func(ctx context.Context, meta metadata.Metadata) (map[string][]byte, error)

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

A Manager will manage trusted CA certificates in a storage backend. It is responsible for: * Retrieving trusted CA certificates * Persisting the certs back to the storage backend

It also will trigger renewals of certificates when required.

func NewManager

func NewManager(opts Options) (*Manager, error)

NewManager constructs a new manager used to manage volumes containing certificate data. It will enumerate all volumes already persisted in the metadata store and resume managing them if any already exist.

func NewManagerOrDie

func NewManagerOrDie(opts Options) *Manager

func (*Manager) IsVolumeReady

func (m *Manager) IsVolumeReady(volumeID string) bool

func (*Manager) ManageVolume

func (m *Manager) ManageVolume(volumeID string) (managed bool)

ManageVolume will initiate management of data for the given volumeID. It will not wait for initial CA cert retrieval and instead rely on the update loop to retrieve the initial truested CA certificates. Callers can use `IsVolumeReady` to determine if a CA certificates have been successfully retrieved or not. Upon failure, it is the callers responsibility to call `UnmanageVolume`.

func (*Manager) ManageVolumeImmediate

func (m *Manager) ManageVolumeImmediate(
	ctx context.Context,
	volumeID string,
) (managed bool, err error)

ManageVolumeImmediate will register a volume for management and immediately attempt to retrieve the trusted CA certs. Upon failure, it is the caller's responsibility to explicitly call `UnmanageVolume`.

func (*Manager) Stop

func (m *Manager) Stop()

Stop will stop management of all managed volumes.

func (*Manager) UnmanageVolume

func (m *Manager) UnmanageVolume(volumeID string)

type Options

type Options struct {
	// Used the read metadata from the storage backend
	MetadataReader storage.MetadataReader

	// Logger used to write log messages
	Log *logr.Logger

	// NodeID is a unique identifier for the node.
	NodeID string

	GetCertificates GetCertificatesFunc

	WriteCertificates WriteCertificatesFunc
}

Options used to construct a Manager.

type WriteCertificatesFunc

type WriteCertificatesFunc func(meta metadata.Metadata, cas map[string][]byte) error

Jump to

Keyboard shortcuts

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