contentsource

package
v1.8.4 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

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 GetVMImageName

func GetVMImageName(img vmopv1.VirtualMachineImage) string

GetVMImageName returns the display name of the image defined in the template. Note that this is different from the name of the VirtualMachineImage Kubernetes object.

func IsImageOwnedByContentLibrary

func IsImageOwnedByContentLibrary(img vmopv1.VirtualMachineImage, clUUID string) bool

IsImageOwnedByContentLibrary checks whether a VirtualMachineImage is owned by a content library with given UUID.

Types

type Reconciler

type Reconciler struct {
	client.Client
	Logger     logr.Logger
	Recorder   record.Recorder
	VMProvider vmprovider.VirtualMachineProviderInterface
	CSMetrics  *metrics.ContentSourceMetrics
}

Reconciler reconciles a ContentSource object.

func NewReconciler

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

func (*Reconciler) CreateImage

func (r *Reconciler) CreateImage(ctx goctx.Context, image vmopv1.VirtualMachineImage) error

CreateImage creates thr VirtualMachineImage. If a VirtualMachineImage with the same name alreay exists, use GenerateName to give this image a new name.

func (*Reconciler) DeleteImage

func (r *Reconciler) DeleteImage(ctx goctx.Context, image vmopv1.VirtualMachineImage) error

DeleteImage deletes a VirtualMachineImage. Ignore the NotFound error.

func (*Reconciler) ProcessItemFromContentLibrary

func (r *Reconciler) ProcessItemFromContentLibrary(ctx goctx.Context,
	logger logr.Logger,
	clProvider *vmopv1.ContentLibraryProvider,
	itemID string, currentCLImages map[string]vmopv1.VirtualMachineImage) (reterr error)

func (*Reconciler) Reconcile

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

func (*Reconciler) ReconcileDelete

func (r *Reconciler) ReconcileDelete(ctx goctx.Context, contentSource *vmopv1.ContentSource) error

ReconcileDelete reconciles a content source delete. We use a finalizer here to clean up any state if needed.

func (*Reconciler) ReconcileDeleteProviderRef

func (r *Reconciler) ReconcileDeleteProviderRef(ctx goctx.Context, contentSource *vmopv1.ContentSource) error

ReconcileDeleteProviderRef reconciles a delete for a provider reference. Currently, no op.

func (*Reconciler) ReconcileNormal

func (r *Reconciler) ReconcileNormal(ctx goctx.Context, contentSource *vmopv1.ContentSource) error

ReconcileNormal reconciles a content source. Calls into the provider to reconcile the content provider.

func (*Reconciler) ReconcileProviderRef

func (r *Reconciler) ReconcileProviderRef(ctx goctx.Context,
	contentSource *vmopv1.ContentSource) (*vmopv1.ContentLibraryProvider, error)

ReconcileProviderRef reconciles a ContentSource's provider reference. Verifies that the content provider pointed by the provider ref exists on the infrastructure.

func (*Reconciler) SyncImagesFromContentProvider

func (r *Reconciler) SyncImagesFromContentProvider(
	ctx goctx.Context, clProvider *vmopv1.ContentLibraryProvider) error

SyncImagesFromContentProvider fetches the VM images from a given content provider. Also sets the owner ref in the images.

func (*Reconciler) UpdateImage

func (r *Reconciler) UpdateImage(ctx goctx.Context, currentImage, expectedImage vmopv1.VirtualMachineImage) error

UpdateImage checks a VirtualMachineImage non-status and status resource and update it if needed.

Jump to

Keyboard shortcuts

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