components

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2020 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

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 ComponentName(ctx context.Context) string

func ResourceName

func ResourceName(ctx context.Context) string

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 ComponentRun

type ComponentRun func(context.Context, *goharborv1alpha1.Harbor, []Resource) error

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 (o *Option) GetPriority() *int32

func (*Option) SetPriority

func (o *Option) SetPriority(priority *int32)

type OptionGetter

type OptionGetter interface {
	GetPriority() *int32
}

type OptionSetter

type OptionSetter interface {
	SetPriority(*int32)
}

type Resource

type Resource interface {
	metav1.Object
	runtime.Object
	schema.ObjectKind
}

type ResourceFactory

type ResourceFactory func() Resource

type ResourceMutationGetter

type ResourceMutationGetter func(Resource, Resource) controllerutil.MutateFn

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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