volume

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2023 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AttributeFirstClassDiskUUID = "diskUUID"
)

Variables

This section is empty.

Functions

func AddToManager

func AddToManager(ctx *context.ControllerManagerContext, mgr manager.Manager) error

AddToManager adds this package's controller to the provided manager.

func CNSAttachmentNameForVolume

func CNSAttachmentNameForVolume(vm *vmopv1.VirtualMachine, volumeName string) string

CNSAttachmentNameForVolume returns the name of the CnsNodeVmAttachment based on the VM and Volume name. This matches the naming used in previous code but there are situations where we may get a collision between VMs and Volume names. I'm not sure if there is an absolute way to avoid that: the same situation can happen with the claimName. Ideally, we would use GenerateName, but we lack the back-linkage to match Volumes and CnsNodeVmAttachment up. The VM webhook validate that this result will be a valid k8s name.

Types

type Reconciler

type Reconciler struct {
	client.Client

	VMProvider vmprovider.VirtualMachineProviderInterface
	// contains filtered or unexported fields
}

func NewReconciler

func NewReconciler(
	client client.Client,
	logger logr.Logger,
	recorder record.Recorder,
	vmProvider vmprovider.VirtualMachineProviderInterface) *Reconciler

func (*Reconciler) Reconcile

func (r *Reconciler) Reconcile(ctx goctx.Context, request ctrl.Request) (_ ctrl.Result, reterr error)

Reconcile reconciles a VirtualMachine object and processes the volumes for attach/detach. Longer term, this should be folded back into the VirtualMachine controller, but exists as a separate controller to ensure volume attachments are processed promptly, since the VM controller can block for a long time, consuming all of the workers.

func (*Reconciler) ReconcileDelete

func (r *Reconciler) ReconcileDelete(_ *context.VolumeContext) error

func (*Reconciler) ReconcileNormal

func (r *Reconciler) ReconcileNormal(ctx *context.VolumeContext) error

Jump to

Keyboard shortcuts

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