source

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2020 License: Apache-2.0, MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AnnotDnsnames annotation is shared with dns controller manager
	AnnotDnsnames = "dns.gardener.cloud/dnsnames"
	// AnnotDNSClass is the annotation for the dns class
	AnnotDNSClass = "dns.gardener.cloud/class"
	// AnnotClass is the annotation for the cert class
	AnnotClass = "cert.gardener.cloud/class"
	// AnnotForwardOwnerRefs is the annotation for the forward owner references
	AnnotForwardOwnerRefs = "cert.gardener.cloud/forward-owner-refs"
	// AnnotSecretname is the annotation for the secret name
	AnnotSecretname = "cert.gardener.cloud/secretname"
	// AnnotIssuer is the annotation for the issuer name
	AnnotIssuer = "cert.gardener.cloud/issuer"

	// OptClass is the cert-class command line option
	OptClass = "cert-class"
	// OptTargetclass is the target-cert-class command line option
	OptTargetclass = "cert-target-class"
	// OptNamespace is the namespace command line option
	OptNamespace = "target-namespace"
	// OptNameprefix is the target-name-prefix command line option
	OptNameprefix = "target-name-prefix"

	// DefaultClass is the default cert-class
	DefaultClass = "gardencert"
)

Variables

This section is empty.

Functions

func CertSourceController

func CertSourceController(source CertSourceType, reconcilerType controller.ReconcilerType) controller.Configuration

CertSourceController creates a CertSource controller.

func DomainsString

func DomainsString(domains []string) string

DomainsString creates a comma separated string.

func MasterResourcesType

func MasterResourcesType(kind schema.GroupKind) reconcilers.Resources

MasterResourcesType creates the master resource type interfaces function.

func SlaveReconcilerType

func SlaveReconcilerType(c controller.Interface) (reconcile.Interface, error)

SlaveReconcilerType creates a slaveReconciler.

func SrcReconciler added in v0.2.10

func SrcReconciler(sourceType CertSourceType, rtype controller.ReconcilerType) controller.ReconcilerType

SrcReconciler create a source reconciler.

Types

type CertCurrentState

type CertCurrentState struct {
	CertStates map[string]*CertState
}

CertCurrentState contains the current state.

func (*CertCurrentState) ContainsSecretName

func (s *CertCurrentState) ContainsSecretName(name string) bool

ContainsSecretName returns true if name is in map.

type CertFeedback

type CertFeedback interface {
	Succeeded()
	Pending(info *CertInfo, msg string)
	Ready(info *CertInfo, msg string)
	Failed(info *CertInfo, err error)
}

CertFeedback is an interface for reporting certificate status.

func NewEventFeedback

func NewEventFeedback(logger logger.LogContext, obj resources.Object, events map[string]string) CertFeedback

NewEventFeedback creates a new EventFeedback

type CertInfo

type CertInfo struct {
	SecretName string
	Domains    []string
	IssuerName *string
}

CertInfo contains basic certificate data.

func (CertInfo) DomainsString

func (info CertInfo) DomainsString() string

DomainsString returns all domains as comma separated string (common name and DNS names)

type CertSource

type CertSource interface {
	Start()
	Setup()

	GetCertsInfo(logger logger.LogContext, obj resources.Object, current *CertCurrentState) (*CertsInfo, error)

	Delete(logger logger.LogContext, obj resources.Object) reconcile.Status
	Deleted(logger logger.LogContext, key resources.ClusterObjectKey)
}

CertSource is...

type CertSourceCreator

type CertSourceCreator func(controller.Interface) (CertSource, error)

CertSourceCreator is type for creator.

type CertSourceType

type CertSourceType interface {
	Name() string
	GroupKind() schema.GroupKind
	Create(controller.Interface) (CertSource, error)
}

CertSourceType provides basic functionalilty.

func NewCertSourceTypeForCreator

func NewCertSourceTypeForCreator(name string, kind schema.GroupKind, handler CertSourceCreator) CertSourceType

NewCertSourceTypeForCreator creates CertSourceType for creator.

func NewCertSourceTypeForExtractor

func NewCertSourceTypeForExtractor(name string, kind schema.GroupKind, handler CertTargetExtractor) CertSourceType

NewCertSourceTypeForExtractor creates CertSourceType for extractor.

type CertState

type CertState struct {
	// Spec is original spec from CR.
	Spec api.CertificateSpec
	// State is the state string.
	State string
	// Message is the optional status or error message.
	Message *string
	// CreationTimestamp contains the creation timestamp of the certificate.
	CreationTimestamp metav1.Time
}

CertState contains internal certificate state.

type CertTargetExtractor

type CertTargetExtractor func(logger logger.LogContext, obj resources.Object, current *CertCurrentState) (string, error)

CertTargetExtractor is type for extractor.

type CertsInfo

type CertsInfo struct {
	Certs    map[string]CertInfo
	Feedback CertFeedback
}

CertsInfo contains a map of CertInfo.

type DefaultCertSource

type DefaultCertSource struct {
	Events map[resources.ClusterObjectKey]map[string]string
	// contains filtered or unexported fields
}

DefaultCertSource is the standard CertSource implementation.

func NewDefaultCertSource

func NewDefaultCertSource(handler CertTargetExtractor, _ schema.GroupKind) DefaultCertSource

NewDefaultCertSource creates a DefaultCertSource

func (*DefaultCertSource) Delete

Delete deleted a object.

func (*DefaultCertSource) Deleted

Deleted performs cleanup.

func (*DefaultCertSource) GetCertsInfo

func (s *DefaultCertSource) GetCertsInfo(logger logger.LogContext, obj resources.Object, current *CertCurrentState) (*CertsInfo, error)

GetCertsInfo fills a CertsInfo for an object.

func (*DefaultCertSource) GetEvents

GetEvents returns the events for a cluster object key.

func (*DefaultCertSource) NewCertsInfo

func (s *DefaultCertSource) NewCertsInfo(logger logger.LogContext, obj resources.Object) *CertsInfo

NewCertsInfo creates a CertsInfo

func (*DefaultCertSource) Setup

func (s *DefaultCertSource) Setup()

Setup is the setup method.

func (*DefaultCertSource) Start

func (s *DefaultCertSource) Start()

Start is the start method.

type EventFeedback

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

EventFeedback is struct to store events

func (*EventFeedback) Failed

func (f *EventFeedback) Failed(info *CertInfo, err error)

Failed adds a failed event.

func (*EventFeedback) Pending

func (f *EventFeedback) Pending(info *CertInfo, msg string)

Pending adds a pending event.

func (*EventFeedback) Ready

func (f *EventFeedback) Ready(info *CertInfo, msg string)

Ready adds a ready event

func (*EventFeedback) Succeeded

func (f *EventFeedback) Succeeded()

Succeeded addas a succeeded event.

Jump to

Keyboard shortcuts

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