controllers

package
v0.2.10 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2020 License: MPL-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetKindFromObject added in v0.2.6

func GetKindFromObject(scheme *runtime.Scheme, obj runtime.Object) (string, error)

For a given go object, return the corresponding Kind. A wrapper for scheme.ObjectKinds, which returns all possible GVKs for a go object, but the wrapper returns only the Kind, checking only that at least one GVK exists. (The Kind should be the same for all GVKs). TODO: could just use reflect.TypeOf instead...

func IsSynchronising added in v0.2.9

func IsSynchronising(obj metav1.Object) bool

IsSynchronising indicates whether obj is in process of synchronisation between client and pod, or not.

Types

type PodBuilder added in v0.2.6

type PodBuilder struct {
	// contains filtered or unexported fields
}

func NewPodBuilder added in v0.2.6

func NewPodBuilder(namespace, name, image string) *PodBuilder

func (*PodBuilder) AddBackendConfig added in v0.2.6

func (pb *PodBuilder) AddBackendConfig(workspacename string) *PodBuilder

func (*PodBuilder) AddCache added in v0.2.6

func (pb *PodBuilder) AddCache(pvcname string) *PodBuilder

func (*PodBuilder) AddCredentials added in v0.2.6

func (pb *PodBuilder) AddCredentials(secretname string) *PodBuilder

Mount secret into a volume and set GOOGLE_APPLICATION_CREDENTIALS to the hardcoded google credentials file (whether it exists or not). Also expose the secret data via environment variables.

func (*PodBuilder) AddRunnerContainer added in v0.2.6

func (pb *PodBuilder) AddRunnerContainer(args []string) *PodBuilder

func (*PodBuilder) AddWorkspace added in v0.2.6

func (pb *PodBuilder) AddWorkspace() *PodBuilder

func (*PodBuilder) Build added in v0.2.6

func (pb *PodBuilder) Build(init bool) *corev1.Pod

Finalize building of pod. `init` toggles whether the runner is an init or 'normal' container. If true, then it is run as an init container, followed by a normal container that simply idles i.e. sleeps for infinity, and restarts upon error. This is for the purpose of running the workspace pod.

func (*PodBuilder) EnableDebug added in v0.2.6

func (pb *PodBuilder) EnableDebug(debug bool) *PodBuilder

func (*PodBuilder) HasServiceAccount added in v0.2.6

func (pb *PodBuilder) HasServiceAccount(serviceaccountname string) *PodBuilder

func (*PodBuilder) MountTarball added in v0.2.6

func (pb *PodBuilder) MountTarball(configmapname, configmapkey string) *PodBuilder

func (*PodBuilder) SetLabels added in v0.2.9

func (pb *PodBuilder) SetLabels(name, workspace, command, component string) *PodBuilder

func (*PodBuilder) WaitForClient added in v0.2.6

func (pb *PodBuilder) WaitForClient(kind, name, namespace, timeout string) *PodBuilder

type RunReconciler added in v0.2.10

type RunReconciler struct {
	client.Client
	Scheme *runtime.Scheme
	Log    logr.Logger
	Image  string
}

func NewRunReconciler added in v0.2.10

func NewRunReconciler(c client.Client, image string) *RunReconciler

func (*RunReconciler) Reconcile added in v0.2.10

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

func (*RunReconciler) SetupWithManager added in v0.2.10

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

type WorkspaceReconciler

type WorkspaceReconciler struct {
	client.Client
	Scheme *runtime.Scheme
	Log    logr.Logger
	Image  string
}

func NewWorkspaceReconciler added in v0.2.6

func NewWorkspaceReconciler(cl client.Client, image string) *WorkspaceReconciler

func (*WorkspaceReconciler) Reconcile

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

Reconcile reads that state of the cluster for a Workspace object and makes changes based on the state read and what is in the Workspace.Spec 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.

func (*WorkspaceReconciler) SetupWithManager

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

Jump to

Keyboard shortcuts

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