Documentation ¶
Index ¶
- Constants
- func AddToManager(ctx *context.ControllerManagerContext, mgr manager.Manager) error
- func CNSAttachmentNameForVolume(vmName string, volumeName string) string
- func FilterVolumesA2(vm *v1alpha2.VirtualMachine) []v1alpha2.VirtualMachineVolume
- func IsConfiguredA2(vm *v1alpha2.VirtualMachine) bool
- type Reconciler
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 ¶
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.
func FilterVolumesA2 ¶
func FilterVolumesA2(vm *v1alpha2.VirtualMachine) []v1alpha2.VirtualMachineVolume
func IsConfiguredA2 ¶
func IsConfiguredA2(vm *v1alpha2.VirtualMachine) bool
Types ¶
type Reconciler ¶
type Reconciler struct { client.Client VMProvider vmprovider.VirtualMachineProviderInterfaceA2 // contains filtered or unexported fields }
func NewReconciler ¶
func NewReconciler( client client.Client, logger logr.Logger, recorder record.Recorder, vmProvider vmprovider.VirtualMachineProviderInterfaceA2) *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.VolumeContextA2) error
func (*Reconciler) ReconcileNormal ¶
func (r *Reconciler) ReconcileNormal(ctx *context.VolumeContextA2) error