Documentation ¶
Index ¶
Constants ¶
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 *vmopv1alpha1.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 ¶
func NewReconciler ¶
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