Documentation ¶
Overview ¶
* This file is part of the KubeVirt project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Copyright 2024 Red Hat, Inc. *
Index ¶
- Constants
- func AddInstancetypeNameAnnotations(vm *virtv1.VirtualMachine, target metav1.Object)
- func AddPreferenceNameAnnotations(vm *virtv1.VirtualMachine, target metav1.Object)
- func ApplyDevicePreferences(preferenceSpec *instancetypev1beta1.VirtualMachinePreferenceSpec, ...)
- func CompareRevisions(revisionA, revisionB *appsv1.ControllerRevision) (bool, error)
- func CreateControllerRevision(vm *virtv1.VirtualMachine, object runtime.Object) (*appsv1.ControllerRevision, error)
- func GenerateRevisionNamePatch(instancetypeRevision, preferenceRevision *appsv1.ControllerRevision) ([]byte, error)
- func GetPreferredTopology(preferenceSpec *instancetypev1beta1.VirtualMachinePreferenceSpec) instancetypev1beta1.PreferredCPUTopology
- func GetRevisionName(vmName, resourceName, resourceVersion string, resourceUID types.UID, ...) string
- func GetSpreadOptions(preferenceSpec *instancetypev1beta1.VirtualMachinePreferenceSpec) (uint32, instancetypev1beta1.SpreadAcross)
- func IsObjectLatestVersion(cr *appsv1.ControllerRevision) bool
- func IsPreferredTopologySupported(topology instancetypev1beta1.PreferredCPUTopology) bool
- func NewIgnoreableInferenceError(err error) error
- type Conflicts
- type IgnoreableInferenceError
- type InstancetypeMethods
- func (m *InstancetypeMethods) ApplyToVM(vm *virtv1.VirtualMachine) error
- func (m *InstancetypeMethods) ApplyToVmi(field *k8sfield.Path, ...) Conflicts
- func (m *InstancetypeMethods) CheckPreferenceRequirements(instancetypeSpec *instancetypev1beta1.VirtualMachineInstancetypeSpec, ...) (Conflicts, error)
- func (m *InstancetypeMethods) FindInstancetypeSpec(vm *virtv1.VirtualMachine) (*instancetypev1beta1.VirtualMachineInstancetypeSpec, error)
- func (m *InstancetypeMethods) FindPreferenceSpec(vm *virtv1.VirtualMachine) (*instancetypev1beta1.VirtualMachinePreferenceSpec, error)
- func (m *InstancetypeMethods) InferDefaultInstancetype(vm *virtv1.VirtualMachine) error
- func (m *InstancetypeMethods) InferDefaultPreference(vm *virtv1.VirtualMachine) error
- func (m *InstancetypeMethods) StoreControllerRevisions(vm *virtv1.VirtualMachine) error
- func (m *InstancetypeMethods) Upgrade(vm *virtv1.VirtualMachine) error
- type Methods
- type Upgrader
Constants ¶
View Source
const ( VMFieldConflictErrorFmt = "VM field %s conflicts with selected instance type" InsufficientInstanceTypeCPUResourcesErrorFmt = "insufficient CPU resources of %d vCPU provided by instance type, preference requires %d vCPU" InsufficientVMCPUResourcesErrorFmt = "insufficient CPU resources of %d vCPU provided by VirtualMachine, preference requires %d vCPU provided as %s" InsufficientInstanceTypeMemoryResourcesErrorFmt = "insufficient Memory resources of %s provided by instance type, preference requires %s" InsufficientVMMemoryResourcesErrorFmt = "insufficient Memory resources of %s provided by VirtualMachine, preference requires %s" NoVMCPUResourcesDefinedErrorFmt = "no CPU resources provided by VirtualMachine, preference requires %d vCPU" )
Variables ¶
This section is empty.
Functions ¶
func AddInstancetypeNameAnnotations ¶
func AddInstancetypeNameAnnotations(vm *virtv1.VirtualMachine, target metav1.Object)
func AddPreferenceNameAnnotations ¶
func AddPreferenceNameAnnotations(vm *virtv1.VirtualMachine, target metav1.Object)
func ApplyDevicePreferences ¶ added in v0.57.0
func ApplyDevicePreferences(preferenceSpec *instancetypev1beta1.VirtualMachinePreferenceSpec, vmiSpec *virtv1.VirtualMachineInstanceSpec)
func CompareRevisions ¶ added in v0.59.0
func CompareRevisions(revisionA, revisionB *appsv1.ControllerRevision) (bool, error)
func CreateControllerRevision ¶ added in v0.58.0
func CreateControllerRevision(vm *virtv1.VirtualMachine, object runtime.Object) (*appsv1.ControllerRevision, error)
func GenerateRevisionNamePatch ¶
func GenerateRevisionNamePatch(instancetypeRevision, preferenceRevision *appsv1.ControllerRevision) ([]byte, error)
func GetPreferredTopology ¶ added in v1.1.0
func GetPreferredTopology(preferenceSpec *instancetypev1beta1.VirtualMachinePreferenceSpec) instancetypev1beta1.PreferredCPUTopology
func GetRevisionName ¶
func GetSpreadOptions ¶ added in v1.3.0
func GetSpreadOptions(preferenceSpec *instancetypev1beta1.VirtualMachinePreferenceSpec) (uint32, instancetypev1beta1.SpreadAcross)
func IsObjectLatestVersion ¶ added in v1.3.0
func IsObjectLatestVersion(cr *appsv1.ControllerRevision) bool
func IsPreferredTopologySupported ¶
func IsPreferredTopologySupported(topology instancetypev1beta1.PreferredCPUTopology) bool
func NewIgnoreableInferenceError ¶ added in v1.1.0
Types ¶
type IgnoreableInferenceError ¶ added in v1.1.0
type IgnoreableInferenceError struct {
// contains filtered or unexported fields
}
func (*IgnoreableInferenceError) Error ¶ added in v1.1.0
func (e *IgnoreableInferenceError) Error() string
func (*IgnoreableInferenceError) Unwrap ¶ added in v1.1.0
func (e *IgnoreableInferenceError) Unwrap() error
type InstancetypeMethods ¶ added in v1.0.0
type InstancetypeMethods struct { InstancetypeStore cache.Store ClusterInstancetypeStore cache.Store PreferenceStore cache.Store ClusterPreferenceStore cache.Store ControllerRevisionStore cache.Store Clientset kubecli.KubevirtClient }
func (*InstancetypeMethods) ApplyToVM ¶ added in v1.3.0
func (m *InstancetypeMethods) ApplyToVM(vm *virtv1.VirtualMachine) error
func (*InstancetypeMethods) ApplyToVmi ¶ added in v1.0.0
func (m *InstancetypeMethods) ApplyToVmi(field *k8sfield.Path, instancetypeSpec *instancetypev1beta1.VirtualMachineInstancetypeSpec, preferenceSpec *instancetypev1beta1.VirtualMachinePreferenceSpec, vmiSpec *virtv1.VirtualMachineInstanceSpec, vmiMetadata *metav1.ObjectMeta) Conflicts
func (*InstancetypeMethods) CheckPreferenceRequirements ¶ added in v1.0.0
func (m *InstancetypeMethods) CheckPreferenceRequirements(instancetypeSpec *instancetypev1beta1.VirtualMachineInstancetypeSpec, preferenceSpec *instancetypev1beta1.VirtualMachinePreferenceSpec, vmiSpec *virtv1.VirtualMachineInstanceSpec) (Conflicts, error)
func (*InstancetypeMethods) FindInstancetypeSpec ¶ added in v1.0.0
func (m *InstancetypeMethods) FindInstancetypeSpec(vm *virtv1.VirtualMachine) (*instancetypev1beta1.VirtualMachineInstancetypeSpec, error)
func (*InstancetypeMethods) FindPreferenceSpec ¶ added in v1.0.0
func (m *InstancetypeMethods) FindPreferenceSpec(vm *virtv1.VirtualMachine) (*instancetypev1beta1.VirtualMachinePreferenceSpec, error)
func (*InstancetypeMethods) InferDefaultInstancetype ¶ added in v1.0.0
func (m *InstancetypeMethods) InferDefaultInstancetype(vm *virtv1.VirtualMachine) error
func (*InstancetypeMethods) InferDefaultPreference ¶ added in v1.0.0
func (m *InstancetypeMethods) InferDefaultPreference(vm *virtv1.VirtualMachine) error
func (*InstancetypeMethods) StoreControllerRevisions ¶ added in v1.0.0
func (m *InstancetypeMethods) StoreControllerRevisions(vm *virtv1.VirtualMachine) error
func (*InstancetypeMethods) Upgrade ¶ added in v1.3.0
func (m *InstancetypeMethods) Upgrade(vm *virtv1.VirtualMachine) error
type Methods ¶
type Methods interface { Upgrader FindInstancetypeSpec(vm *virtv1.VirtualMachine) (*instancetypev1beta1.VirtualMachineInstancetypeSpec, error) ApplyToVmi(field *k8sfield.Path, instancetypespec *instancetypev1beta1.VirtualMachineInstancetypeSpec, preferenceSpec *instancetypev1beta1.VirtualMachinePreferenceSpec, vmiSpec *virtv1.VirtualMachineInstanceSpec, vmiMetadata *metav1.ObjectMeta) Conflicts FindPreferenceSpec(vm *virtv1.VirtualMachine) (*instancetypev1beta1.VirtualMachinePreferenceSpec, error) StoreControllerRevisions(vm *virtv1.VirtualMachine) error InferDefaultInstancetype(vm *virtv1.VirtualMachine) error InferDefaultPreference(vm *virtv1.VirtualMachine) error CheckPreferenceRequirements(instancetypeSpec *instancetypev1beta1.VirtualMachineInstancetypeSpec, preferenceSpec *instancetypev1beta1.VirtualMachinePreferenceSpec, vmiSpec *virtv1.VirtualMachineInstanceSpec) (Conflicts, error) ApplyToVM(vm *virtv1.VirtualMachine) error }
type Upgrader ¶ added in v1.3.0
type Upgrader interface {
Upgrade(vm *virtv1.VirtualMachine) error
}
Click to show internal directories.
Click to hide internal directories.