multitenancycontroller

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2020 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Mutex sync.Mutex
View Source
var TenancyQueue = make(chan TenancyExample)

Functions

func Add

func Add(mgr manager.Manager) error

* * USER ACTION REQUIRED: This is a scaffold file intended for the user to modify with their own Controller * business logic. Delete these comments after modifying this file.*

and Start it when the Manager is Started.

func CheckMultiTenancyController

func CheckMultiTenancyController(c client.Client, reqLogger logr.Logger) (*v1alpha1.Controller, error)

func LoopSchedule

func LoopSchedule(tenancyScheduler TenancyScheduler, tenancyWatcher TenancyWatcher)

FIFO work queue

Types

type KubeObject

type KubeObject struct {
	Kubeapi Kubeapi
	Object  runtime.Object
}

type Kubeapi

type Kubeapi struct {
	ApiVersion string
	Kind       string
	Name       string
	Namespace  string
}

func (*Kubeapi) CreateUnstructured

func (k *Kubeapi) CreateUnstructured() *unstructured.Unstructured

type NamespacedChart

type NamespacedChart struct {
	Namespace   string
	ChartName   string
	ReleaseName string
}

type ReconcileMultiTenancyController

type ReconcileMultiTenancyController struct {
	// TODO: Clarify the split client
	// This client, initialized using mgr.Client() above, is a split client
	// that reads objects from the cache and writes to the apiserver
	Client client.Client
	Scheme *runtime.Scheme
	Config *rest.Config
}

ReconcileMultiTenancyController reconciles a MultiTenancyController object

func (*ReconcileMultiTenancyController) Reconcile

TODO(user): Modify this Reconcile function to implement your Controller logic. This example creates Note: The Controller will requeue the Request to be processed again if the returned error is non-nil or Result.Requeue is true, otherwise upon completion it will remove the work from the queue.

type TenancyExample

type TenancyExample struct {
	Reconcile            *ReconcileMultiTenancyController
	TenancyOperator      TenancyOperator
	NamespacedChart      NamespacedChart
	NamespacedController types.NamespacedName
	Namespaces           []string
	Settings             map[string]string
	StateSettings        map[string]string
}

type TenancyOperator

type TenancyOperator string
const (
	UPDATE TenancyOperator = "update"
	CREATE TenancyOperator = "create"
	DELETE TenancyOperator = "delete"
	INIT   TenancyOperator = "init"
)

func (TenancyOperator) ToString

func (t TenancyOperator) ToString() string

type TenancyScheduler

type TenancyScheduler interface {
	CreateSingleTenancyByConfigure(t *TenancyExample) (objs []KubeObject, err error)
	UpdateSingleTenancyByConfigure(t *TenancyExample) (objs []KubeObject, err error)
	DeleteSingleTenancyByConfigure(t *TenancyExample) (objs []KubeObject, err error)
}

type TenancyWatcher

type TenancyWatcher interface {
	InitTenancyWatcher(t *TenancyExample)
	CreateTenancyPodStatusAndReplicationControllerStatus(objs []KubeObject, t *TenancyExample)
	DeleteTenancyPodStatusAndReplicationControllerStatus(objs []KubeObject, t *TenancyExample)
	CreateTenancyNamespacesIfNeed(t *TenancyExample)
	DeleteTenancyNamespacesIfNeed(t *TenancyExample)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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