Documentation
¶
Index ¶
- Constants
- type APIHealth
- type ComponentHealth
- type Config
- type EventFilter
- func (ef *EventFilter) Create(e event.CreateEvent) bool
- func (ef *EventFilter) Delete(e event.DeleteEvent) bool
- func (ef *EventFilter) Generic(e event.GenericEvent) bool
- func (ef *EventFilter) HarborClassAnnotationMatch(meta metav1.Object) bool
- func (ef *EventFilter) IsOwned(meta metav1.Object, ro runtime.Object) bool
- func (ef *EventFilter) Update(e event.UpdateEvent) bool
- type Reconciler
- func (r *Reconciler) Apply(ctx context.Context, harbor *goharborv1alpha1.Harbor) error
- func (r *Reconciler) ApplyComponent(ctx context.Context, harbor *goharborv1alpha1.Harbor, ...) error
- func (r *Reconciler) ApplyMutationFunc(ctx context.Context, harbor *goharborv1alpha1.Harbor, ...) func() error
- func (r *Reconciler) ApplyResource(ctx context.Context, harbor *goharborv1alpha1.Harbor, ...) (components.Resource, error)
- func (r *Reconciler) ApplyResources(ctx context.Context, harbor *goharborv1alpha1.Harbor, ...) error
- func (r *Reconciler) Create(ctx context.Context, harbor *goharborv1alpha1.Harbor) error
- func (r *Reconciler) CreateComponent(ctx context.Context, harbor *goharborv1alpha1.Harbor, ...) error
- func (r *Reconciler) CreateResource(ctx context.Context, harbor *goharborv1alpha1.Harbor, ...) error
- func (r *Reconciler) CreateResources(ctx context.Context, harbor *goharborv1alpha1.Harbor, ...) error
- func (r *Reconciler) DeleteComponent(ctx context.Context, harbor *goharborv1alpha1.Harbor, componentName string) error
- func (r *Reconciler) DeleteResourceCollection(ctx context.Context, harbor *goharborv1alpha1.Harbor, componentName string, ...) error
- func (r *Reconciler) GetCondition(ctx context.Context, harbor *goharborv1alpha1.Harbor, ...) goharborv1alpha1.HarborCondition
- func (r *Reconciler) GetConditionStatus(ctx context.Context, harbor *goharborv1alpha1.Harbor, ...) corev1.ConditionStatus
- func (r *Reconciler) GetEventFilter() *EventFilter
- func (r *Reconciler) GetHealth(ctx context.Context, harbor *goharborv1alpha1.Harbor) (*APIHealth, error)
- func (r *Reconciler) GetName() string
- func (r *Reconciler) GetVersion() string
- func (r *Reconciler) MutateAnnotations(ctx context.Context, resource metav1.Object)
- func (r *Reconciler) MutateLabels(ctx context.Context, resource metav1.Object)
- func (r *Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error)
- func (r *Reconciler) SetupWithManager(mgr ctrl.Manager) error
- func (r *Reconciler) UpdateAppliedStatus(ctx context.Context, result *ctrl.Result, harbor *goharborv1alpha1.Harbor) error
- func (r *Reconciler) UpdateCondition(ctx context.Context, harbor *goharborv1alpha1.Harbor, ...) error
- func (r *Reconciler) UpdateReadyStatus(ctx context.Context, result *ctrl.Result, harbor *goharborv1alpha1.Harbor) error
- func (r *Reconciler) UpdateStatus(ctx context.Context, result *ctrl.Result, harbor *goharborv1alpha1.Harbor) error
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 (*APIHealth) IsComponentHealthy ¶
type ComponentHealth ¶
type EventFilter ¶
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) 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 (*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) GetCondition ¶
func (r *Reconciler) GetCondition(ctx context.Context, harbor *goharborv1alpha1.Harbor, conditionType goharborv1alpha1.HarborConditionType) goharborv1alpha1.HarborCondition
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) 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
Source Files
¶
Click to show internal directories.
Click to hide internal directories.