controllers

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 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...

Types

type CommandReconciler

type CommandReconciler struct {
	client.Client
	C            command.Interface
	Kind         string
	ResourceType string
	Scheme       *runtime.Scheme
	Log          logr.Logger
	RunnerImage  string
}

func (*CommandReconciler) Reconcile

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

func (*CommandReconciler) SetupWithManager

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

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) WaitForClient added in v0.2.6

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

type WorkspaceReconciler

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

func NewWorkspaceReconciler added in v0.2.6

func NewWorkspaceReconciler(cl client.Client) *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