controller

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2019 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultDependentResourceNameFor

func DefaultDependentResourceNameFor(owner Resource) string

func DeploymentName

func DeploymentName(c *Component) string

func DeploymentNameFor

func DeploymentNameFor(c *Component, mode halkyon.DeploymentMode) string

func GetObjectName

func GetObjectName(object runtime.Object) string

func NewRole

func NewRole() role

func NewRoleBinding

func NewRoleBinding() roleBinding

func PVCName

func PVCName(c *Component) string

func PostgresName

func PostgresName(owner Resource) string

func RegisterNewReconciler

func RegisterNewReconciler(factory GenericReconciler, mgr manager.Manager) error

func RoleBindingName

func RoleBindingName(owner Resource) string

func RoleName

func RoleName(owner Resource) string

func ServiceAccountName

func ServiceAccountName(owner Resource) string

func TaskName

func TaskName(owner Resource) string

Types

type BaseGenericReconciler

type BaseGenericReconciler struct {
	ReconcilerHelper
	// contains filtered or unexported fields
}

func NewBaseGenericReconciler

func NewBaseGenericReconciler(primaryResourceType Resource, mgr manager.Manager) *BaseGenericReconciler

func (*BaseGenericReconciler) AddDependentResource

func (b *BaseGenericReconciler) AddDependentResource(resource DependentResource)

func (*BaseGenericReconciler) CreateIfNeeded

func (b *BaseGenericReconciler) CreateIfNeeded(owner Resource, resourceType runtime.Object) error

func (*BaseGenericReconciler) CreateOrUpdate

func (b *BaseGenericReconciler) CreateOrUpdate(object Resource) error

func (*BaseGenericReconciler) Delete

func (b *BaseGenericReconciler) Delete(object Resource) error

func (*BaseGenericReconciler) Fetch

func (b *BaseGenericReconciler) Fetch(into Resource) (Resource, error)

func (*BaseGenericReconciler) GetDependentResourceFor

func (b *BaseGenericReconciler) GetDependentResourceFor(owner Resource, resourceType runtime.Object) (DependentResource, error)

func (*BaseGenericReconciler) Helper

func (*BaseGenericReconciler) IsDependentResourceReady

func (b *BaseGenericReconciler) IsDependentResourceReady(resource Resource) (depOrTypeName string, ready bool)

func (*BaseGenericReconciler) IsTargetClusterRunningOpenShift

func (b *BaseGenericReconciler) IsTargetClusterRunningOpenShift() bool

func (*BaseGenericReconciler) MustGetDependentResourceFor

func (b *BaseGenericReconciler) MustGetDependentResourceFor(owner Resource, resourceType runtime.Object) (resource DependentResource)

func (*BaseGenericReconciler) OpenShiftVersion

func (b *BaseGenericReconciler) OpenShiftVersion() int

func (*BaseGenericReconciler) PrimaryResourceType

func (b *BaseGenericReconciler) PrimaryResourceType() Resource

func (*BaseGenericReconciler) Reconcile

func (b *BaseGenericReconciler) Reconcile(request reconcile.Request) (reconcile.Result, error)

func (*BaseGenericReconciler) SetReconcilerFactory

func (b *BaseGenericReconciler) SetReconcilerFactory(factory ReconcilerFactory)

func (*BaseGenericReconciler) WatchedSecondaryResourceTypes

func (b *BaseGenericReconciler) WatchedSecondaryResourceTypes() []runtime.Object

type Capability

type Capability struct {
	*halkyon.Capability
	// contains filtered or unexported fields
}

func NewCapability

func NewCapability(capability ...*halkyon.Capability) *Capability

func (*Capability) Clone

func (in *Capability) Clone() Resource

func (*Capability) GetAPIObject

func (in *Capability) GetAPIObject() runtime.Object

func (*Capability) GetStatusAsString

func (in *Capability) GetStatusAsString() string

func (*Capability) IsValid

func (in *Capability) IsValid() bool

func (*Capability) NeedsRequeue

func (in *Capability) NeedsRequeue() bool

func (*Capability) SetAPIObject

func (in *Capability) SetAPIObject(object runtime.Object)

func (*Capability) SetErrorStatus

func (in *Capability) SetErrorStatus(err error) bool

func (*Capability) SetInitialStatus

func (in *Capability) SetInitialStatus(msg string) bool

func (*Capability) SetNeedsRequeue

func (in *Capability) SetNeedsRequeue(requeue bool)

func (*Capability) SetSuccessStatus

func (in *Capability) SetSuccessStatus(dependentName, msg string) bool

func (*Capability) ShouldDelete

func (in *Capability) ShouldDelete() bool

type Component

type Component struct {
	*halkyon.Component
	// contains filtered or unexported fields
}

func NewComponent

func NewComponent(component ...*halkyon.Component) *Component

func (*Component) Clone

func (in *Component) Clone() Resource

func (*Component) GetAPIObject

func (in *Component) GetAPIObject() runtime.Object

func (*Component) GetStatusAsString

func (in *Component) GetStatusAsString() string

func (*Component) IsValid

func (in *Component) IsValid() bool

func (*Component) NeedsRequeue

func (in *Component) NeedsRequeue() bool

func (*Component) SetAPIObject

func (in *Component) SetAPIObject(object runtime.Object)

func (*Component) SetErrorStatus

func (in *Component) SetErrorStatus(err error) bool

func (*Component) SetInitialStatus

func (in *Component) SetInitialStatus(msg string) bool

func (*Component) SetNeedsRequeue

func (in *Component) SetNeedsRequeue(requeue bool)

func (*Component) SetSuccessStatus

func (in *Component) SetSuccessStatus(dependentName, msg string) bool

func (*Component) ShouldDelete

func (in *Component) ShouldDelete() bool

type DependentResource

type DependentResource interface {
	Name() string
	Fetch(helper ReconcilerHelper) (runtime.Object, error)
	Build() (runtime.Object, error)
	Update(toUpdate runtime.Object) (bool, error)
	NewInstanceWith(owner Resource) DependentResource
	Owner() Resource
	Prototype() runtime.Object
	ShouldWatch() bool
	CanBeCreatedOrUpdated() bool
	ShouldBeOwned() bool
}

type DependentResourceHelper

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

func NewDependentResource

func NewDependentResource(primaryResourceType runtime.Object, owner Resource) *DependentResourceHelper

func (DependentResourceHelper) CanBeCreatedOrUpdated

func (res DependentResourceHelper) CanBeCreatedOrUpdated() bool

func (DependentResourceHelper) Fetch

func (DependentResourceHelper) Name

func (res DependentResourceHelper) Name() string

func (DependentResourceHelper) Owner

func (res DependentResourceHelper) Owner() Resource

func (DependentResourceHelper) Prototype

func (res DependentResourceHelper) Prototype() runtime.Object

func (*DependentResourceHelper) SetDelegate

func (res *DependentResourceHelper) SetDelegate(delegate DependentResource)

func (DependentResourceHelper) ShouldBeOwned

func (res DependentResourceHelper) ShouldBeOwned() bool

func (DependentResourceHelper) ShouldWatch

func (res DependentResourceHelper) ShouldWatch() bool

type GenericReconciler

type GenericReconciler interface {
	ReconcilerFactory
	reconcile.Reconciler
}
type Link struct {
	*halkyon.Link
	// contains filtered or unexported fields
}
func NewLink(link ...*halkyon.Link) *Link

func (*Link) Clone

func (in *Link) Clone() Resource

func (*Link) GetAPIObject

func (in *Link) GetAPIObject() runtime.Object

func (*Link) GetStatusAsString

func (in *Link) GetStatusAsString() string

func (*Link) IsValid

func (in *Link) IsValid() bool

func (*Link) NeedsRequeue

func (in *Link) NeedsRequeue() bool

func (*Link) SetAPIObject

func (in *Link) SetAPIObject(object runtime.Object)

func (*Link) SetErrorStatus

func (in *Link) SetErrorStatus(err error) bool

func (*Link) SetInitialStatus

func (in *Link) SetInitialStatus(msg string) bool

func (*Link) SetNeedsRequeue

func (in *Link) SetNeedsRequeue(requeue bool)

func (*Link) SetSuccessStatus

func (in *Link) SetSuccessStatus(dependentName, msg string) bool

func (*Link) ShouldDelete

func (in *Link) ShouldDelete() bool

type ReconcilerFactory

type ReconcilerFactory interface {
	PrimaryResourceType() Resource
	WatchedSecondaryResourceTypes() []runtime.Object
	Delete(object Resource) error
	CreateOrUpdate(object Resource) error
	IsDependentResourceReady(resource Resource) (depOrTypeName string, ready bool)
	Helper() ReconcilerHelper
	GetDependentResourceFor(owner Resource, resourceType runtime.Object) (DependentResource, error)
	AddDependentResource(resource DependentResource)
}

type ReconcilerHelper

type ReconcilerHelper struct {
	Client    client.Client
	Config    *rest.Config
	Scheme    *runtime.Scheme
	ReqLogger logr.Logger
}

func (ReconcilerHelper) Fetch

func (rh ReconcilerHelper) Fetch(name, namespace string, into runtime.Object) (runtime.Object, error)

type Resource

type Resource interface {
	v1.Object
	runtime.Object
	NeedsRequeue() bool
	SetNeedsRequeue(requeue bool)
	GetStatusAsString() string
	ShouldDelete() bool
	SetErrorStatus(err error) bool
	SetSuccessStatus(dependentName, msg string) bool
	SetInitialStatus(msg string) bool
	IsValid() bool
	Clone() Resource
	GetAPIObject() runtime.Object
	SetAPIObject(object runtime.Object)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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