Documentation
¶
Index ¶
- Constants
- Variables
- func AddContentLibraryRefToAnnotation(to client.Object, ref *imgregv1a1.NameAndKindRef) error
- func AddToManager(ctx *pkgctx.ControllerManagerContext, mgr manager.Manager, obj client.Object) error
- func AddToManagerV1A2(ctx *pkgctx.ControllerManagerContext, mgr manager.Manager, obj client.Object) error
- func AddV1A2ContentLibraryRefToAnnotation(to client.Object, ref *common.LocalObjectRef) error
- func DummyClusterContentLibraryItem(name string) *imgregv1a1.ClusterContentLibraryItem
- func DummyContentLibraryItem(name, namespace string) *imgregv1a1.ContentLibraryItem
- func DummyV1A2ClusterContentLibraryItem(name string) *imgregv1.ClusterContentLibraryItem
- func DummyV1A2ContentLibraryItem(name, namespace string) *imgregv1.ContentLibraryItem
- func FilterServicesTypeLabels(labels map[string]string) map[string]string
- func GetAppropriateFinalizers(obj client.Object) (string, string)
- func GetImageFieldNameFromItem(itemName string) (string, error)
- func IsItemReady(itemConditions imgregv1a1.Conditions) bool
- func IsV1A2ItemReady(itemConditions []metav1.Condition) bool
- type Reconciler
- func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ ctrl.Result, reterr error)
- func (r *Reconciler) ReconcileDelete(ctx context.Context, logger logr.Logger, obj client.Object, vmiName string) error
- func (r *Reconciler) ReconcileNormal(ctx context.Context, logger logr.Logger, cliObj client.Object, ...) error
- type ReconcilerV1A2
- func (r *ReconcilerV1A2) Reconcile(ctx context.Context, req ctrl.Request) (_ ctrl.Result, reterr error)
- func (r *ReconcilerV1A2) ReconcileDelete(ctx context.Context, logger logr.Logger, obj client.Object, vmiName string) error
- func (r *ReconcilerV1A2) ReconcileNormal(ctx context.Context, logger logr.Logger, cliObj client.Object, ...) error
Constants ¶
const ( ItemFieldNamePrefix = "clitem" ImageFieldNamePrefix = "vmi" ClusterContentLibraryKind = "ClusterContentLibrary" ClusterContentLibraryItemKind = "ClusterContentLibraryItem" ContentLibraryKind = "ContentLibrary" ContentLibraryItemKind = "ContentLibraryItem" CLItemFinalizer = "vmoperator.vmware.com/contentlibraryitem" DeprecatedCLItemFinalizer = "contentlibraryitem.vmoperator.vmware.com" CCLItemFinalizer = "clustercontentlibraryitem.vmoperator.vmware.com" DeprecatedCCLItemFinalizer = "vmoperator.vmware.com/clustercontentlibraryitem" // TKGServiceTypeLabelKeyPrefix is a label prefix used to identify // labels that contain information about the type of service provided // by a ClusterContentLibrary. // This label prefix is replaced by MultipleCLServiceTypeLabelKeyPrefix // when Features.TKGMultipleCL is enabled. TKGServiceTypeLabelKeyPrefix = "type.services.vmware.com/" // MultipleCLServiceTypeLabelKeyPrefix is a label prefix used to identify // labels that contain information about the type of service provided // by a ClusterContentLibrary. // This label prefix is used only when Features.TKGMultipleCL is enabled, // otherwise TKGServiceTypeLabelKeyPrefix is used. MultipleCLServiceTypeLabelKeyPrefix = "services.supervisor.vmware.com/" )
const ContentLibraryServiceTypeLabelKey = "type.services.vmware.com/tkg"
ContentLibraryServiceTypeLabelKey is used to differentiate a TKG resource from a VM service resource.
Variables ¶
var SkipNameValidation *bool
SkipNameValidation is used for testing to allow multiple controllers with the same name since Controller-Runtime has a global singleton registry to prevent controllers with the same name, even if attached to different managers.
Functions ¶
func AddContentLibraryRefToAnnotation ¶ added in v1.9.0
func AddContentLibraryRefToAnnotation(to client.Object, ref *imgregv1a1.NameAndKindRef) error
AddContentLibraryRefToAnnotation adds the conversion annotation with the content library ref value populated.
func AddToManager ¶ added in v1.10.0
func AddToManagerV1A2 ¶ added in v1.10.0
func AddV1A2ContentLibraryRefToAnnotation ¶ added in v1.10.0
func AddV1A2ContentLibraryRefToAnnotation(to client.Object, ref *common.LocalObjectRef) error
AddV1A2ContentLibraryRefToAnnotation adds the conversion annotation with the content library ref value populated.
func DummyClusterContentLibraryItem ¶
func DummyClusterContentLibraryItem(name string) *imgregv1a1.ClusterContentLibraryItem
func DummyContentLibraryItem ¶
func DummyContentLibraryItem(name, namespace string) *imgregv1a1.ContentLibraryItem
func DummyV1A2ClusterContentLibraryItem ¶ added in v1.10.0
func DummyV1A2ClusterContentLibraryItem(name string) *imgregv1.ClusterContentLibraryItem
func DummyV1A2ContentLibraryItem ¶ added in v1.10.0
func DummyV1A2ContentLibraryItem(name, namespace string) *imgregv1.ContentLibraryItem
func FilterServicesTypeLabels ¶ added in v1.9.0
func GetAppropriateFinalizers ¶ added in v1.10.0
GetAppropriateFinalizers returns the finalizers for this type of object.
func GetImageFieldNameFromItem ¶
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 IsItemReady ¶ added in v1.8.2
func IsItemReady(itemConditions imgregv1a1.Conditions) bool
IsItemReady returns if the given item conditions contain a Ready condition with status True.
func IsV1A2ItemReady ¶ added in v1.10.0
IsV1A2ItemReady returns if the given item conditions contain a Ready condition with status True.
Types ¶
type Reconciler ¶ added in v1.10.0
type Reconciler struct {
client.Client
Context context.Context
Logger logr.Logger
Recorder record.Recorder
VMProvider providers.VirtualMachineProviderInterface
Metrics *metrics.ContentLibraryItemMetrics
Kind string
}
Reconciler reconciles an IaaS Image Registry Service's ContentLibraryItem object by creating/updating the corresponding VM-Service's VirtualMachineImage resource.
func NewReconciler ¶ added in v1.10.0
func (*Reconciler) ReconcileDelete ¶ added in v1.10.0
func (r *Reconciler) ReconcileDelete( ctx context.Context, logger logr.Logger, obj client.Object, vmiName string) error
ReconcileDelete reconciles a deletion for a ContentLibraryItem resource.
func (*Reconciler) ReconcileNormal ¶ added in v1.10.0
func (r *Reconciler) ReconcileNormal( ctx context.Context, logger logr.Logger, cliObj client.Object, cliSpec *imgregv1a1.ContentLibraryItemSpec, cliStatus *imgregv1a1.ContentLibraryItemStatus, vmiName string) error
ReconcileNormal reconciles a ContentLibraryItem resource by creating or updating the corresponding VirtualMachineImage resource.
type ReconcilerV1A2 ¶ added in v1.10.0
type ReconcilerV1A2 struct {
client.Client
Context context.Context
Logger logr.Logger
Recorder record.Recorder
VMProvider providers.VirtualMachineProviderInterface
Metrics *metrics.ContentLibraryItemMetrics
Kind string
}
ReconcilerV1A2 reconciles an IaaS Image Registry Service's ContentLibraryItem object by creating/updating the corresponding VM-Service's VirtualMachineImage resource.
func NewReconcilerV1A2 ¶ added in v1.10.0
func (*ReconcilerV1A2) ReconcileDelete ¶ added in v1.10.0
func (r *ReconcilerV1A2) ReconcileDelete( ctx context.Context, logger logr.Logger, obj client.Object, vmiName string) error
ReconcileDelete reconciles a deletion for a ContentLibraryItem resource.
func (*ReconcilerV1A2) ReconcileNormal ¶ added in v1.10.0
func (r *ReconcilerV1A2) ReconcileNormal( ctx context.Context, logger logr.Logger, cliObj client.Object, cliSpec *imgregv1.ContentLibraryItemSpec, cliStatus *imgregv1.ContentLibraryItemStatus, vmiName string) error
ReconcileNormal reconciles a ContentLibraryItem resource by creating or updating the corresponding VirtualMachineImage resource.