context

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ControllerManagerContext

type ControllerManagerContext struct {
	context.Context

	// Namespace is the namespace in which the resource is located responsible
	// for running the controller manager.
	Namespace string

	// Name is the name of the controller manager.
	Name string

	// ServiceAccountName is the name of the pod's service account.
	ServiceAccountName string

	// LeaderElectionID is the information used to identify the object
	// responsible for synchronizing leader election.
	LeaderElectionID string

	// LeaderElectionNamespace is the namespace in which the LeaderElection
	// object is located.
	LeaderElectionNamespace string

	// WatchNamespace is the namespace the controllers watch for changes. If
	// no value is specified then all namespaces are watched.
	WatchNamespace string

	// Logger is the controller manager's logger.
	Logger logr.Logger

	// Recorder is used to record events.
	Recorder record.Recorder

	// Scheme is the controller manager's API scheme.
	Scheme *runtime.Scheme

	// MaxConcurrentReconciles is the maximum number of reconcile requests this
	// controller will receive concurrently.
	MaxConcurrentReconciles int

	// WebhookServiceNamespace is the namespace in which the webhook service
	// is located.
	WebhookServiceNamespace string

	// WebhookServiceName is the name of the webhook service.
	WebhookServiceName string

	// WebhookSecretNamespace is the namespace in which the webhook secret
	// is located.
	WebhookSecretNamespace string

	// WebhookSecretName is the name of the webhook secret.
	WebhookSecretName string

	// ContainerNode should be true if we're running guest cluster nodes in containers.
	ContainerNode bool

	// SyncPeriod determines the minimum frequency at which watched resources are
	// reconciled. A lower period will correct entropy more quickly, but reduce
	// responsiveness to change if there are many watched resources.
	SyncPeriod time.Duration

	// VMProvider is the controller manager's VM Provider
	VMProvider vmprovider.VirtualMachineProviderInterface
}

ControllerManagerContext is the context of the controller that owns the controllers.

func (*ControllerManagerContext) String

func (c *ControllerManagerContext) String() string

String returns ControllerManagerName.

type Key

type Key uint

Key is used to store/retrieve information in/from a VM Operator context.

const (
	// MaxDeployThreadsContextKey is the context key that stores the maximum
	// number of threads allowed used to deploy a VM.
	MaxDeployThreadsContextKey Key = iota
)

type VirtualMachineClassContext

type VirtualMachineClassContext struct {
	context.Context
	Logger  logr.Logger
	VMClass *vmopv1.VirtualMachineClass
}

VirtualMachineClassContext is the context used for VirtualMachineClassControllers.

func (*VirtualMachineClassContext) String

func (v *VirtualMachineClassContext) String() string

type VirtualMachineContext

type VirtualMachineContext struct {
	context.Context
	Logger logr.Logger
	VM     *vmopv1.VirtualMachine
}

VirtualMachineContext is the context used for VirtualMachineControllers.

func (*VirtualMachineContext) String

func (v *VirtualMachineContext) String() string

type VirtualMachinePublishRequestContext

type VirtualMachinePublishRequestContext struct {
	context.Context
	Logger           logr.Logger
	VMPublishRequest *vmopv1.VirtualMachinePublishRequest
	VM               *vmopv1.VirtualMachine
	ContentLibrary   *imgregv1a1.ContentLibrary
}

VirtualMachinePublishRequestContext is the context used for VirtualMachinePublishRequestControllers.

func (*VirtualMachinePublishRequestContext) String

type VirtualMachineServiceContext

type VirtualMachineServiceContext struct {
	context.Context
	Logger    logr.Logger
	VMService *vmopv1.VirtualMachineService
}

VirtualMachineServiceContext is the context used for VirtualMachineServiceController.

func (*VirtualMachineServiceContext) String

type VirtualMachineSetResourcePolicyContext

type VirtualMachineSetResourcePolicyContext struct {
	context.Context
	Logger         logr.Logger
	ResourcePolicy *vmopv1alpha1.VirtualMachineSetResourcePolicy
}

VirtualMachineSetResourcePolicyContext is the context used for VirtualMachineControllers.

func (*VirtualMachineSetResourcePolicyContext) String

type VolumeContext

type VolumeContext struct {
	context.Context
	Logger                    logr.Logger
	VM                        *vmopv1.VirtualMachine
	InstanceStorageFSSEnabled bool
}

VolumeContext is the context used for VolumeController.

func (*VolumeContext) String

func (v *VolumeContext) String() string

type WebConsoleRequestContext

type WebConsoleRequestContext struct {
	context.Context
	Logger            logr.Logger
	WebConsoleRequest *vmopv1.WebConsoleRequest
	VM                *vmopv1.VirtualMachine
}

WebConsoleRequestContext is the context used for WebConsoleRequestControllers.

func (*WebConsoleRequestContext) String

func (v *WebConsoleRequestContext) String() string

type WebhookContext

type WebhookContext struct {
	context.Context

	// Name is the name of the webhook.
	Name string

	// Namespace is the namespace the webhook is running in.
	Namespace string

	// ServiceAccountName is the service account name of the pod.
	ServiceAccountName string

	// Logger is the webhook's logger.
	Logger logr.Logger

	// Recorder is used to record events.
	Recorder record.Recorder
}

WebhookContext is the context of a webhook.

func (*WebhookContext) String

func (c *WebhookContext) String() string

String returns WebhookName.

type WebhookRequestContext

type WebhookRequestContext struct {
	// WebhookContext is the context of the webhook that spawned this request context.
	*WebhookContext

	// Obj is the resource associated with the webhook request.
	Obj *unstructured.Unstructured

	// OldObj is set only for Update requests.
	OldObj *unstructured.Unstructured

	// Operation is the operation.
	Op admissionv1.Operation

	// IsPrivilegedAccount is if this request is from a privileged account (currently
	// that's either kube-admin or the pod's system account).
	IsPrivilegedAccount bool

	// UserInfo is the user information associated with the webhook request.
	UserInfo authv1.UserInfo

	// Logger is the logger associated with the webhook request.
	Logger logr.Logger
}

WebhookRequestContext is a Go context used with a webhook request.

func (*WebhookRequestContext) String

func (c *WebhookRequestContext) String() string

String returns Obj.GroupVersionKind Obj.Namespace/Obj.Name.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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