controllers

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2022 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Overview

Package controllers contains App and Framework reconcilers to be used with controller-runtime.

Index

Constants

View Source
const (
	DeploymentProgressing = "Progressing"

	DefaultPodRunningTimeout = 10 * time.Minute
)
View Source
const (
	KetchNamespace = "ketch-system"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AppReconciler

type AppReconciler struct {
	client.Client
	Log            logr.Logger
	Scheme         *runtime.Scheme
	TemplateReader templates.Reader
	HelmFactoryFn  helmFactoryFn
	Now            timeNowFn
	Recorder       record.EventRecorder
	// Group stands for k8s group of Ketch App CRD.
	Group  string
	Config *rest.Config
	// CancelMap tracks cancelFunc functions for goroutines AppReconciler starts to watch deployment events.
	CancelMap *CancelMap
}

AppReconciler reconciles a App object.

func (*AppReconciler) Reconcile

func (r *AppReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*AppReconciler) SetupWithManager

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

type CancelMap added in v0.6.2

type CancelMap struct {
	sync.Mutex
	// contains filtered or unexported fields
}

CancelMap helps AppReconciler tracking goroutines. There are two use cases:

  1. AppReconciler starts a goroutine and forgets about it never trying to cancel it. cleanupFunc is responsible for calling cancel() and removing all resources associated with it.
  2. AppReconciler starts a new goroutine and cancels the previous one. cleanupFunc of the previous goroutine must not do any cleanup.

func NewCancelMap added in v0.6.2

func NewCancelMap() *CancelMap

type FrameworkReconciler

type FrameworkReconciler struct {
	client.Client
	Log    logr.Logger
	Scheme *runtime.Scheme
}

FrameworkReconciler reconciles a Framework object.

func (*FrameworkReconciler) Reconcile

func (r *FrameworkReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*FrameworkReconciler) SetupWithManager

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

type Helm

type Helm interface {
	UpdateChart(tv chart.TemplateValuer, config chart.ChartConfig, opts ...chart.InstallOption) (*release.Release, error)
	DeleteChart(appName string) error
}

Helm has methods to update/delete helm charts.

type JobReconcileReason

type JobReconcileReason struct {
	JobName string
}

JobReconcileReason contains information about job reconcile

func (*JobReconcileReason) String

func (r *JobReconcileReason) String() string

String is a Stringer interface implementation

type JobReconciler

type JobReconciler struct {
	client.Client
	Log    logr.Logger
	Scheme *runtime.Scheme

	HelmFactoryFn  helmFactoryFn
	Recorder       record.EventRecorder
	TemplateReader templates.Reader
}

JobReconciler reconciles a Job object

func (*JobReconciler) Reconcile

func (r *JobReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile fetches a Job by name and updates helm charts with differences

func (*JobReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

Jump to

Keyboard shortcuts

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