harbor

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2020 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HealthyStatus   = "healthy"
	UnhealthyStatus = "unhealthy"
)
View Source
const (
	DefaultRequeueWait = 2 * time.Second
)
View Source
const (
	HarborHealthEndpoint = "/api/health"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type APIHealth

type APIHealth struct {
	Status     string            `json:"status"`
	Components []ComponentHealth `json:"components"`
}

func (*APIHealth) GetUnhealthyComponents

func (h *APIHealth) GetUnhealthyComponents() []string

func (*APIHealth) IsComponentHealthy

func (h *APIHealth) IsComponentHealthy(name string) (bool, error)

func (*APIHealth) IsHealthy

func (h *APIHealth) IsHealthy() bool

type ComponentHealth

type ComponentHealth struct {
	Name   string `json:"name"`
	Status string `json:"status"`
	Error  string `json:"error,omitempty"`
}

type Config

type Config struct {
	ClassName            string
	ConcurrentReconciles int
	WatchChildren        bool
}

type EventFilter

type EventFilter struct {
	ClassName string
	Scheme    *runtime.Scheme
}

func (*EventFilter) Create

func (ef *EventFilter) Create(e event.CreateEvent) bool

Create returns true if the Create event should be processed

func (*EventFilter) Delete

func (ef *EventFilter) Delete(e event.DeleteEvent) bool

Delete returns true if the Delete event should be processed

func (*EventFilter) Generic

func (ef *EventFilter) Generic(e event.GenericEvent) bool

Generic returns true if the Generic event should be processed

func (*EventFilter) HarborClassAnnotationMatch

func (ef *EventFilter) HarborClassAnnotationMatch(meta metav1.Object) bool

func (*EventFilter) IsOwned

func (ef *EventFilter) IsOwned(meta metav1.Object, ro runtime.Object) bool

func (*EventFilter) Update

func (ef *EventFilter) Update(e event.UpdateEvent) bool

Update returns true if the Update event should be processed

type Reconciler

type Reconciler struct {
	client.Client

	Name    string
	Version string

	Log    logr.Logger
	Scheme *runtime.Scheme

	RestConfig *rest.Config

	Config Config
}

Reconciler reconciles a Harbor object

func New

func New(ctx context.Context, name, version string, config *Config) (*Reconciler, error)

func (*Reconciler) Apply

func (r *Reconciler) Apply(ctx context.Context, harbor *goharborv1alpha1.Harbor) error

func (*Reconciler) ApplyComponent

func (r *Reconciler) ApplyComponent(ctx context.Context, harbor *goharborv1alpha1.Harbor, component *components.ComponentRunner) error

func (*Reconciler) ApplyMutationFunc

func (r *Reconciler) ApplyMutationFunc(ctx context.Context, harbor *goharborv1alpha1.Harbor, resource components.Resource, result metav1.Object, mutate controllerutil.MutateFn) func() error

func (*Reconciler) ApplyResource

func (r *Reconciler) ApplyResource(ctx context.Context, harbor *goharborv1alpha1.Harbor, resource components.Resource, objectFactory components.ResourceFactory, objectMutation components.ResourceMutationGetter) (components.Resource, error)

func (*Reconciler) ApplyResources

func (r *Reconciler) ApplyResources(ctx context.Context, harbor *goharborv1alpha1.Harbor, resources []components.Resource, objectFactory func() components.Resource, objectMutation func(components.Resource, components.Resource) controllerutil.MutateFn) error

func (*Reconciler) Create

func (r *Reconciler) Create(ctx context.Context, harbor *goharborv1alpha1.Harbor) error

func (*Reconciler) CreateComponent

func (r *Reconciler) CreateComponent(ctx context.Context, harbor *goharborv1alpha1.Harbor, component *components.ComponentRunner) error

func (*Reconciler) CreateResource

func (r *Reconciler) CreateResource(ctx context.Context, harbor *goharborv1alpha1.Harbor, resource components.Resource) error

func (*Reconciler) CreateResources

func (r *Reconciler) CreateResources(ctx context.Context, harbor *goharborv1alpha1.Harbor, resources []components.Resource) error

func (*Reconciler) DeleteComponent

func (r *Reconciler) DeleteComponent(ctx context.Context, harbor *goharborv1alpha1.Harbor, componentName string) error

func (*Reconciler) DeleteResourceCollection

func (r *Reconciler) DeleteResourceCollection(ctx context.Context, harbor *goharborv1alpha1.Harbor, componentName string, gvk schema.GroupVersionKind) error

func (*Reconciler) GetConditionStatus

func (r *Reconciler) GetConditionStatus(ctx context.Context, harbor *goharborv1alpha1.Harbor, conditionType goharborv1alpha1.HarborConditionType) corev1.ConditionStatus

func (*Reconciler) GetEventFilter

func (r *Reconciler) GetEventFilter() *EventFilter

func (*Reconciler) GetHealth

func (r *Reconciler) GetHealth(ctx context.Context, harbor *goharborv1alpha1.Harbor) (*APIHealth, error)

func (*Reconciler) GetName

func (r *Reconciler) GetName() string

func (*Reconciler) GetVersion

func (r *Reconciler) GetVersion() string

func (*Reconciler) MutateAnnotations

func (r *Reconciler) MutateAnnotations(ctx context.Context, resource metav1.Object)

func (*Reconciler) MutateLabels

func (r *Reconciler) MutateLabels(ctx context.Context, resource metav1.Object)

func (*Reconciler) Reconcile

func (r *Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error)

func (*Reconciler) SetupWithManager

func (r *Reconciler) SetupWithManager(mgr ctrl.Manager) error

func (*Reconciler) UpdateAppliedStatus

func (r *Reconciler) UpdateAppliedStatus(ctx context.Context, result *ctrl.Result, harbor *goharborv1alpha1.Harbor) error

func (*Reconciler) UpdateCondition

func (r *Reconciler) UpdateCondition(ctx context.Context, harbor *goharborv1alpha1.Harbor, conditionType goharborv1alpha1.HarborConditionType, status corev1.ConditionStatus, reasons ...string) error

func (*Reconciler) UpdateReadyStatus

func (r *Reconciler) UpdateReadyStatus(ctx context.Context, result *ctrl.Result, harbor *goharborv1alpha1.Harbor) error

func (*Reconciler) UpdateStatus

func (r *Reconciler) UpdateStatus(ctx context.Context, result *ctrl.Result, harbor *goharborv1alpha1.Harbor) error

UpdateStatus applies current in-memory statuses to the remote resource https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/#status-subresource

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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