utils

package
v1.8.3 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: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ItemFieldNamePrefix           = "clitem"
	ImageFieldNamePrefix          = "vmi"
	ClusterContentLibraryKind     = "ClusterContentLibrary"
	ClusterContentLibraryItemKind = "ClusterContentLibraryItem"
	ContentLibraryKind            = "ContentLibrary"
	ContentLibraryItemKind        = "ContentLibraryItem"

	ContentLibraryItemVmopFinalizer        = "contentlibraryitem.vmoperator.vmware.com"
	ClusterContentLibraryItemVmopFinalizer = "clustercontentlibraryitem.vmoperator.vmware.com"
)
View Source
const ContentLibraryServiceTypeLabelKey = "type.services.vmware.com/tkg"

ContentLibraryServiceTypeLabelKey is used to differentiate a TKG resource from a VM service resource.

Variables

This section is empty.

Functions

func DummyClusterContentLibraryItem

func DummyClusterContentLibraryItem(name string) *imgregv1a1.ClusterContentLibraryItem

func DummyContentLibraryItem

func DummyContentLibraryItem(name, namespace string) *imgregv1a1.ContentLibraryItem

func GetImageFieldNameFromItem

func GetImageFieldNameFromItem(itemName string) (string, error)

GetImageFieldNameFromItem returns the Image field name in format of "vmi-<uuid>" by using the same identifier from the given Item name in "clitem-<uuid>".

func GetServiceTypeLabels

func GetServiceTypeLabels(labels map[string]string) map[string]string

func GetTestVMINameFrom

func GetTestVMINameFrom(clItemName string) string

func GetVMImageSpecStatus

func GetVMImageSpecStatus(ctx context.Context, ctrlClient client.Client, imageName, namespace string) (
	spec *vmopv1.VirtualMachineImageSpec, status *vmopv1.VirtualMachineImageStatus, err error)

GetVMImageSpecStatus returns the VirtualMachineImage Spec and Status fields in an image-registry service enabled cluster. It first tries to get the namespace scope VM Image; if not found, it looks up the cluster scope VM Image.

func IsItemReady

func IsItemReady(itemConditions imgregv1a1.Conditions) bool

IsItemReady returns if the given item conditions contain a Ready condition with status True.

func PopulateRuntimeFieldsTo

func PopulateRuntimeFieldsTo(vmi, appliedVMI crtlclient.Object)

Types

This section is empty.

Jump to

Keyboard shortcuts

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