Documentation ¶
Index ¶
Constants ¶
const ( DatabasePropertyName string = "database" StoragePropertyName string = "storage" CachePropertyName string = "cache" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CRStatus ¶
type CRStatus struct { Condition goharborv1.HarborClusterCondition `json:"condition"` Properties Properties `json:"properties"` }
func New ¶
func New(conditionType goharborv1.HarborClusterConditionType) *CRStatus
New returns new CRStatus.
func (*CRStatus) WithMessage ¶
WithMessage returns CRStatus with Condition message.
func (*CRStatus) WithProperties ¶
func (cs *CRStatus) WithProperties(properties Properties) *CRStatus
WithProperties returns CRStatus with Properties.
func (*CRStatus) WithReason ¶
WithReason returns CRStatus with Condition reason.
func (*CRStatus) WithStatus ¶
func (cs *CRStatus) WithStatus(status corev1.ConditionStatus) *CRStatus
WithStatus returns CRStatus with Condition status.
type CRStatusCollection ¶
type CRStatusCollection struct {
// contains filtered or unexported fields
}
CRStatusCollection is designed for collecting CRStatus of each dependant components.
func NewCRStatusCollection ¶
func NewCRStatusCollection() *CRStatusCollection
NewCRStatusCollection returns a new collection.
func (*CRStatusCollection) Get ¶
func (c *CRStatusCollection) Get(component goharborv1.Component) (*CRStatus, bool)
Get item from collection.
func (*CRStatusCollection) Set ¶
func (c *CRStatusCollection) Set(component goharborv1.Component, status *CRStatus)
Set item to collection.
type Controller ¶
type Controller interface { // Apply the changes to the cluster including: // - create new if the designed resource is not existing // - update the resource if the related spec has been changed // - scale the resources if the replica is changed // // Equal to the previous method "Reconcile()" of lcm Controller Apply(ctx context.Context, harborcluster *goharborv1.HarborCluster, options ...Option) (*CRStatus, error) // Delete the related resources if the resource configuration is removed from the spec. // As we support connecting to the external or incluster provisioned dependent services, // the dependent service may switch from incluster to external mode and then the incluster // services may need to be unloaded. Delete(ctx context.Context, harborcluster *goharborv1.HarborCluster) (*CRStatus, error) // Upgrade the specified resource to the given version. Upgrade(ctx context.Context, harborcluster *goharborv1.HarborCluster) (*CRStatus, error) }
Controller is designed to handle the lifecycle of the related incluster deployed services like psql, redis and minio.
type Option ¶
type Option func(options *Options)
Option func for lcm.
func WithDependencies ¶
func WithDependencies(dependencies *CRStatusCollection) Option
WithDependencies option.
type Properties ¶
type Properties []*Property
func (*Properties) Add ¶
func (ps *Properties) Add(name string, value interface{})
Add append a new property to properties.
func (*Properties) Get ¶
func (ps *Properties) Get(name string) *Property
Get retrieves properties according to the given name.
func (*Properties) Update ¶
func (ps *Properties) Update(name string, value interface{})
Update updates properties according to the given arguments.