Documentation
¶
Index ¶
- Constants
- func ComponentName(ctx context.Context) string
- func ResourceName(ctx context.Context) string
- type Component
- type ComponentFactory
- type ComponentRun
- type ComponentRunner
- func (c *ComponentRunner) GetCertificates(ctx context.Context) []Resource
- func (c *ComponentRunner) GetConfigMaps(ctx context.Context) []Resource
- func (c *ComponentRunner) GetDeployments(ctx context.Context) []Resource
- func (c *ComponentRunner) GetIngresses(ctx context.Context) []Resource
- func (c *ComponentRunner) GetSecrets(ctx context.Context) []Resource
- func (c *ComponentRunner) GetServices(ctx context.Context) []Resource
- func (c *ComponentRunner) ParallelRun(ctx context.Context, harbor *goharborv1alpha1.Harbor, ...) error
- type Components
- type Option
- type OptionGetter
- type OptionSetter
- type Resource
- type ResourceFactory
- type ResourceMutationGetter
- type Run
Constants ¶
View Source
const ( RegistryPriority = 95 CorePriority = 90 JobServicePriority = 85 ChartMuseumPriority = 80 ClairPriority = 80 NotaryPriority = 80 PortalPriority = 75 )
View Source
const PriorityBase = 100
Variables ¶
This section is empty.
Functions ¶
func ComponentName ¶
func ResourceName ¶
Types ¶
type Component ¶
type Component interface {
GetConfigMaps(context.Context) []*corev1.ConfigMap
GetSecrets(context.Context) []*corev1.Secret
GetServices(context.Context) []*corev1.Service
GetCertificates(context.Context) []*certv1.Certificate
GetIngresses(context.Context) []*netv1.Ingress
GetDeployments(context.Context) []*appsv1.Deployment
}
type ComponentFactory ¶
type ComponentFactory func(context.Context, *goharborv1alpha1.Harbor, OptionGetter) (Component, error)
type ComponentRun ¶
type ComponentRunner ¶
type ComponentRunner struct {
Component
}
func (*ComponentRunner) GetCertificates ¶
func (c *ComponentRunner) GetCertificates(ctx context.Context) []Resource
func (*ComponentRunner) GetConfigMaps ¶
func (c *ComponentRunner) GetConfigMaps(ctx context.Context) []Resource
func (*ComponentRunner) GetDeployments ¶
func (c *ComponentRunner) GetDeployments(ctx context.Context) []Resource
func (*ComponentRunner) GetIngresses ¶
func (c *ComponentRunner) GetIngresses(ctx context.Context) []Resource
func (*ComponentRunner) GetSecrets ¶
func (c *ComponentRunner) GetSecrets(ctx context.Context) []Resource
func (*ComponentRunner) GetServices ¶
func (c *ComponentRunner) GetServices(ctx context.Context) []Resource
func (*ComponentRunner) ParallelRun ¶
func (c *ComponentRunner) ParallelRun(ctx context.Context, harbor *goharborv1alpha1.Harbor, servicesRun, configMapsRun, ingressesRun, secretsRun, certificatesRun, deploymentsRun ComponentRun, waitBeforeDeployments bool) error
ParallelRun run a function over all resources of a component. This is a wrapper which use errgroup. The main goal of this method is to centralize action over Resource and not forget any resources anywhere else in the code.
type Components ¶
type Components struct {
Core *ComponentRunner
JobService *ComponentRunner
Registry *ComponentRunner
Portal *ComponentRunner
ChartMuseum *ComponentRunner
Clair *ComponentRunner
Notary *ComponentRunner
}
func GetComponents ¶
func GetComponents(ctx context.Context, harbor *goharborv1alpha1.Harbor) (*Components, error)
func (*Components) ParallelRun ¶
func (r *Components) ParallelRun(ctx context.Context, harbor *goharborv1alpha1.Harbor, run Run) error
type Option ¶
type Option struct {
// contains filtered or unexported fields
}
func (*Option) GetPriority ¶
func (*Option) SetPriority ¶
type OptionGetter ¶
type OptionGetter interface {
GetPriority() *int32
}
type OptionSetter ¶
type OptionSetter interface {
SetPriority(*int32)
}
type ResourceFactory ¶
type ResourceFactory func() Resource
type ResourceMutationGetter ¶
type ResourceMutationGetter func(Resource, Resource) controllerutil.MutateFn
type Run ¶
type Run func(context.Context, *goharborv1alpha1.Harbor, *ComponentRunner) error
Click to show internal directories.
Click to hide internal directories.