Bump kubevirt dependencies to v1.9.0

Bump KubeVirt dependencies to v1.9.0 in go.mod, go.sum, and vendor/.
Disable ImageVolume in e2e KubeVirt setup on k8s 1.34 only.

Signed-off-by: Amir Alavi <amiralavi7@gmail.com>
This commit is contained in:
Amir Alavi
2026-08-10 09:32:41 -04:00
parent e08a32dfa8
commit 5c3469c3ff
44 changed files with 1927 additions and 236 deletions
+2 -2
View File
@@ -28,8 +28,8 @@ require (
k8s.io/klog/v2 v2.140.0
k8s.io/metrics v0.36.1
k8s.io/utils v0.0.0-20260507154919-ff6756f316d2
kubevirt.io/api v1.8.2
kubevirt.io/client-go v1.8.2
kubevirt.io/api v1.9.0
kubevirt.io/client-go v1.9.0
sigs.k8s.io/mdtoc v1.4.0
sigs.k8s.io/yaml v1.6.0
)
+4 -4
View File
@@ -692,10 +692,10 @@ k8s.io/utils v0.0.0-20211116205334-6203023598ed/go.mod h1:jPW/WVKK9YHAvNhRxK0md/
k8s.io/utils v0.0.0-20260210185600-b8788abfbbc2/go.mod h1:xDxuJ0whA3d0I4mf/C4ppKHxXynQ+fxnkmQH0vTHnuk=
k8s.io/utils v0.0.0-20260507154919-ff6756f316d2 h1:wU4tMEhLGgIbLvXQb1cfN+EcM0wf7zC6CPF+C79jroc=
k8s.io/utils v0.0.0-20260507154919-ff6756f316d2/go.mod h1:xDxuJ0whA3d0I4mf/C4ppKHxXynQ+fxnkmQH0vTHnuk=
kubevirt.io/api v1.8.2 h1:h8AACJlity2n8gRE6e9PgikLAwzmNz6gzVjT1kbsDZY=
kubevirt.io/api v1.8.2/go.mod h1:EUaPeD1GQK4IIEp8TVtk5dsFlYQGzFfcWi4CV4rs0rY=
kubevirt.io/client-go v1.8.2 h1:jKJe5j/M7GDfpqTreoBA+BVoyQPCPTbLpuGHHaBfjdk=
kubevirt.io/client-go v1.8.2/go.mod h1:eoH34Z/Wa1JuHeIezT/tcGDMa6zLLEf3FPRx5beJU3k=
kubevirt.io/api v1.9.0 h1:FWqx9yGk/GHUP5o4IthGXZ8FeAlgVNv2It48wD86UUo=
kubevirt.io/api v1.9.0/go.mod h1:tFKAVaJMm7bXCMLxOoUdAqBprKAXoCa0sp0gBmnfBgY=
kubevirt.io/client-go v1.9.0 h1:ksR37OV0Zft6g/9YPFEjevlkRpTvWuyVE44zj9xGuGQ=
kubevirt.io/client-go v1.9.0/go.mod h1:cgGTWTqnghJdyiGXx4y9KXAHholmF2BwodUKXuQa9Ns=
kubevirt.io/containerized-data-importer-api v1.64.0 h1:yBLY6qEogUp8F+XSJvabIkx9uEEDeToYDfRr0mbUxJc=
kubevirt.io/containerized-data-importer-api v1.64.0/go.mod h1:VGp35wxpLXU18b7cnEpmcThI3AjcZUSfg/Zfql44U4o=
kubevirt.io/controller-lifecycle-operator-sdk/api v0.2.4 h1:fZYvD3/Vnitfkx6IJxjLAk8ugnZQ7CXVYcRfkSKmuZY=
+1 -1
View File
@@ -77,7 +77,7 @@ func virtualMachineInstance(idx int, namespace string) *kvcorev1.VirtualMachineI
Name: "containerdisk",
VolumeSource: kvcorev1.VolumeSource{
ContainerDisk: &kvcorev1.ContainerDiskSource{
Image: "quay.io/kubevirt/cirros-container-disk-demo:v1.8.2",
Image: "quay.io/kubevirt/cirros-container-disk-demo:v1.9.0",
},
},
},
+9 -3
View File
@@ -27,7 +27,8 @@ KIND_VERSION=${KIND_VERSION:-v0.31.0}
SKIP_KUBECTL_INSTALL=${SKIP_KUBECTL_INSTALL:-}
SKIP_KIND_INSTALL=${SKIP_KIND_INSTALL:-}
SKIP_KUBEVIRT_INSTALL=${SKIP_KUBEVIRT_INSTALL:-}
KUBEVIRT_VERSION=${KUBEVIRT_VERSION:-v1.8.2}
KUBEVIRT_VERSION=${KUBEVIRT_VERSION:-v1.9.0}
K8S_VERSION=${KUBERNETES_VERSION:-}
# Build a descheduler image
IMAGE_TAG=v$(date +%Y%m%d)-$(git describe --tags)
@@ -39,7 +40,7 @@ echo "DESCHEDULER_IMAGE: ${DESCHEDULER_IMAGE}"
# This just runs e2e tests.
if [ -n "$KIND_E2E" ]; then
K8S_VERSION=${KUBERNETES_VERSION:-v1.36.1}
K8S_VERSION=${K8S_VERSION:-v1.36.1}
KIND_NODE_IMAGE=${KIND_NODE_IMAGE:-localhost/kindest/node:${K8S_VERSION}}
if [ -z "${SKIP_KUBECTL_INSTALL}" ]; then
curl -Lo kubectl https://dl.k8s.io/release/${K8S_VERSION}/bin/linux/amd64/kubectl && chmod +x kubectl && mv kubectl /usr/local/bin/
@@ -98,7 +99,12 @@ trap "collect_logs" ERR
if [ -z "${SKIP_KUBEVIRT_INSTALL}" ]; then
kubectl create -f https://github.com/kubevirt/kubevirt/releases/download/${KUBEVIRT_VERSION}/kubevirt-operator.yaml
kubectl create -f https://github.com/kubevirt/kubevirt/releases/download/${KUBEVIRT_VERSION}/kubevirt-cr.yaml
kubectl -n kubevirt patch kubevirt kubevirt --type=merge --patch '{"spec":{"configuration":{"developerConfiguration":{"useEmulation":true}}}}'
# TODO(1.37): drop this patch when the k8s 1.34 e2e lane is removed. ImageVolume needs k8s >= 1.35.
if [[ "${K8S_VERSION}" == v1.34* ]]; then
kubectl -n kubevirt patch kubevirt kubevirt --type=merge --patch '{"spec":{"configuration":{"developerConfiguration":{"useEmulation":true,"disabledFeatureGates":["ImageVolume"]}}}}'
else
kubectl -n kubevirt patch kubevirt kubevirt --type=merge --patch '{"spec":{"configuration":{"developerConfiguration":{"useEmulation":true}}}}'
fi
kubectl wait --timeout=300s --for=condition=Available -n kubevirt kv/kubevirt
fi
+7 -19
View File
@@ -26,6 +26,7 @@ package v1alpha1
import (
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
types "k8s.io/apimachinery/pkg/types"
)
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
@@ -124,24 +125,6 @@ func (in *BackupVolumeInfo) DeepCopy() *BackupVolumeInfo {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Condition) DeepCopyInto(out *Condition) {
*out = *in
in.LastProbeTime.DeepCopyInto(&out.LastProbeTime)
in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Condition.
func (in *Condition) DeepCopy() *Condition {
if in == nil {
return nil
}
out := new(Condition)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *VirtualMachineBackup) DeepCopyInto(out *VirtualMachineBackup) {
*out = *in
@@ -244,7 +227,7 @@ func (in *VirtualMachineBackupStatus) DeepCopyInto(out *VirtualMachineBackupStat
*out = *in
if in.Conditions != nil {
in, out := &in.Conditions, &out.Conditions
*out = make([]Condition, len(*in))
*out = make([]v1.Condition, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
@@ -264,6 +247,11 @@ func (in *VirtualMachineBackupStatus) DeepCopyInto(out *VirtualMachineBackupStat
*out = make([]BackupVolumeInfo, len(*in))
copy(*out, *in)
}
if in.ExportUID != nil {
in, out := &in.ExportUID, &out.ExportUID
*out = new(types.UID)
**out = **in
}
return
}
+45 -38
View File
@@ -22,6 +22,7 @@ package v1alpha1
import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
)
// BackupMode is the const type for the backup possible modes
@@ -205,14 +206,27 @@ type VirtualMachineBackupSpec struct {
TTLDuration *metav1.Duration `json:"ttlDuration,omitempty"`
}
// QuiesceStatus represents the outcome of a filesystem quiesce operation
type QuiesceStatus string
const (
// QuiesceSucceeded indicates the filesystem was successfully quiesced
QuiesceSucceeded QuiesceStatus = "Succeeded"
// QuiesceFailed indicates the filesystem quiesce failed
QuiesceFailed QuiesceStatus = "Failed"
// QuiesceSkipped indicates the filesystem quiesce was skipped
QuiesceSkipped QuiesceStatus = "Skipped"
)
// VirtualMachineBackupStatus is the status for a VirtualMachineBackup resource
type VirtualMachineBackupStatus struct {
// +optional
// Type indicates if the backup was full or incremental
Type BackupType `json:"type,omitempty"`
// +listType=map
// +listMapKey=type
// +optional
// +listType=atomic
Conditions []Condition `json:"conditions,omitempty"`
Conditions []metav1.Condition `json:"conditions,omitempty"`
// +optional
// CheckpointName the name of the checkpoint created for the current backup
CheckpointName *string `json:"checkpointName,omitempty"`
@@ -224,51 +238,44 @@ type VirtualMachineBackupStatus struct {
// +listType=atomic
// IncludedVolumes lists the volumes that were included in the backup
IncludedVolumes []BackupVolumeInfo `json:"includedVolumes,omitempty"`
// +optional
// ExportUID tracks the UID of the associated VMExport for pull-mode backups
// used to detect VMExport recreation and re-initiate the export handshake
ExportUID *types.UID `json:"exportUID,omitempty"`
}
// ConditionType is the const type for Conditions
type ConditionType string
const (
// ConditionDone indicates the backup was completed
ConditionDone ConditionType = "Done"
// ConditionComplete indicates the backup completed successfully
ConditionComplete ConditionType = "Complete"
// ConditionFailed indicates the backup has encountered a terminal failure
ConditionFailed ConditionType = "Failed"
// ConditionProgressing indicates the backup is in progress
ConditionProgressing ConditionType = "Progressing"
// ConditionInitializing indicates the backup is initializing
ConditionInitializing ConditionType = "Initializing"
// ConditionExportInitiated indicates the backup export has been initiated
ConditionExportInitiated ConditionType = "ExportInitiated"
// ConditionExportReady indicates the backup export is ready
ConditionExportReady ConditionType = "ExportReady"
// ConditionDeleting indicates the backup is deleteing
ConditionDeleting ConditionType = "Deleting"
// ConditionAborting indicates the backup is aborting
ConditionAborting ConditionType = "Aborting"
// ConditionQuiesced indicates whether the VM filesystem was quiesced (frozen) during backup
ConditionQuiesced ConditionType = "Quiesced"
)
// Condition defines conditions
type Condition struct {
Type ConditionType `json:"type"`
Status corev1.ConditionStatus `json:"status"`
// +optional
// +nullable
LastProbeTime metav1.Time `json:"lastProbeTime,omitempty"`
// +optional
// +nullable
LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
// +optional
Reason string `json:"reason,omitempty"`
// +optional
Message string `json:"message,omitempty"`
}
// Reason constants for ConditionProgressing, ConditionComplete, ConditionFailed, and ConditionQuiesced
const (
ReasonInitializing = "Initializing"
ReasonInitiated = "Initiated"
ReasonPreparingExport = "PreparingExport"
ReasonExportInitiated = "ExportInitiated"
ReasonExportReady = "ExportReady"
ReasonAborting = "Aborting"
ReasonCompleted = "Completed"
ReasonCompletedWithWarning = "CompletedWithWarning"
ReasonFailed = "Failed"
ReasonQuiesceSucceeded = "QuiesceSucceeded"
ReasonQuiesceFailed = "QuiesceFailed"
ReasonQuiesceSkipped = "QuiesceSkipped"
ReasonSourceLost = "SourceLost"
ReasonSourceUnhealthy = "SourceUnhealthy"
ReasonDeletedDuringInit = "DeletedDuringInit"
)
+2 -11
View File
@@ -83,19 +83,10 @@ func (VirtualMachineBackupStatus) SwaggerDoc() map[string]string {
return map[string]string{
"": "VirtualMachineBackupStatus is the status for a VirtualMachineBackup resource",
"type": "+optional\nType indicates if the backup was full or incremental",
"conditions": "+optional\n+listType=atomic",
"conditions": "+listType=map\n+listMapKey=type\n+optional",
"checkpointName": "+optional\nCheckpointName the name of the checkpoint created for the current backup",
"endpointCert": "+optional\nEndpointCert is the raw CACert that is to be used when connecting\nto an exported backup endpoint in pull mode.",
"includedVolumes": "+optional\n+listType=atomic\nIncludedVolumes lists the volumes that were included in the backup",
}
}
func (Condition) SwaggerDoc() map[string]string {
return map[string]string{
"": "Condition defines conditions",
"lastProbeTime": "+optional\n+nullable",
"lastTransitionTime": "+optional\n+nullable",
"reason": "+optional",
"message": "+optional",
"exportUID": "+optional\nExportUID tracks the UID of the associated VMExport for pull-mode backups\nused to detect VMExport recreation and re-initiate the export handshake",
}
}
+340 -16
View File
@@ -442,16 +442,6 @@ func (in *Chassis) DeepCopy() *Chassis {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ClaimRequest) DeepCopyInto(out *ClaimRequest) {
*out = *in
if in.ClaimName != nil {
in, out := &in.ClaimName, &out.ClaimName
*out = new(string)
**out = **in
}
if in.RequestName != nil {
in, out := &in.RequestName, &out.RequestName
*out = new(string)
**out = **in
}
return
}
@@ -688,6 +678,27 @@ func (in *ComponentConfig) DeepCopy() *ComponentConfig {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ConfidentialComputeConfiguration) DeepCopyInto(out *ConfidentialComputeConfiguration) {
*out = *in
if in.TDX != nil {
in, out := &in.TDX, &out.TDX
*out = new(TDXConfiguration)
(*in).DeepCopyInto(*out)
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfidentialComputeConfiguration.
func (in *ConfidentialComputeConfiguration) DeepCopy() *ConfidentialComputeConfiguration {
if in == nil {
return nil
}
out := new(ConfidentialComputeConfiguration)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ConfigDriveSSHPublicKeyAccessCredentialPropagation) DeepCopyInto(out *ConfigDriveSSHPublicKeyAccessCredentialPropagation) {
*out = *in
@@ -1643,6 +1654,32 @@ func (in *EvacuateCancelOptions) DeepCopy() *EvacuateCancelOptions {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ExperimentalMigrationOptions) DeepCopyInto(out *ExperimentalMigrationOptions) {
*out = *in
if in.StallDetector != nil {
in, out := &in.StallDetector, &out.StallDetector
*out = new(StallDetectorOptions)
(*in).DeepCopyInto(*out)
}
if in.Compression != nil {
in, out := &in.Compression, &out.Compression
*out = new(MigrationCompression)
**out = **in
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExperimentalMigrationOptions.
func (in *ExperimentalMigrationOptions) DeepCopy() *ExperimentalMigrationOptions {
if in == nil {
return nil
}
out := new(ExperimentalMigrationOptions)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *FeatureAPIC) DeepCopyInto(out *FeatureAPIC) {
*out = *in
@@ -2001,7 +2038,7 @@ func (in *GPU) DeepCopyInto(out *GPU) {
if in.ClaimRequest != nil {
in, out := &in.ClaimRequest, &out.ClaimRequest
*out = new(ClaimRequest)
(*in).DeepCopyInto(*out)
**out = **in
}
if in.VirtualGPUOptions != nil {
in, out := &in.VirtualGPUOptions, &out.VirtualGPUOptions
@@ -2132,7 +2169,7 @@ func (in *HostDevice) DeepCopyInto(out *HostDevice) {
if in.ClaimRequest != nil {
in, out := &in.ClaimRequest, &out.ClaimRequest
*out = new(ClaimRequest)
(*in).DeepCopyInto(*out)
**out = **in
}
return
}
@@ -2415,6 +2452,11 @@ func (in *Interface) DeepCopyInto(out *Interface) {
*out = make([]Port, len(*in))
copy(*out, *in)
}
if in.PortRanges != nil {
in, out := &in.PortRanges, &out.PortRanges
*out = make([]PortRange, len(*in))
copy(*out, *in)
}
if in.BootOrder != nil {
in, out := &in.BootOrder, &out.BootOrder
*out = new(uint)
@@ -2950,6 +2992,16 @@ func (in *KubeVirtConfiguration) DeepCopyInto(out *KubeVirtConfiguration) {
*out = new(ChangedBlockTrackingSelectors)
(*in).DeepCopyInto(*out)
}
if in.PersistentReservationConfiguration != nil {
in, out := &in.PersistentReservationConfiguration, &out.PersistentReservationConfiguration
*out = new(PersistentReservationConfiguration)
(*in).DeepCopyInto(*out)
}
if in.ConfidentialCompute != nil {
in, out := &in.ConfidentialCompute, &out.ConfidentialCompute
*out = new(ConfidentialComputeConfiguration)
(*in).DeepCopyInto(*out)
}
if in.RoleAggregationStrategy != nil {
in, out := &in.RoleAggregationStrategy, &out.RoleAggregationStrategy
*out = new(RoleAggregationStrategy)
@@ -3468,6 +3520,11 @@ func (in *MigrationConfiguration) DeepCopyInto(out *MigrationConfiguration) {
*out = new(int64)
**out = **in
}
if in.MaxDowntimeMs != nil {
in, out := &in.MaxDowntimeMs, &out.MaxDowntimeMs
*out = new(uint64)
**out = **in
}
if in.ProgressTimeout != nil {
in, out := &in.ProgressTimeout, &out.ProgressTimeout
*out = new(int64)
@@ -3637,6 +3694,11 @@ func (in *NetworkSource) DeepCopyInto(out *NetworkSource) {
*out = new(MultusNetwork)
**out = **in
}
if in.ResourceClaim != nil {
in, out := &in.ResourceClaim, &out.ResourceClaim
*out = new(ClaimRequest)
**out = **in
}
return
}
@@ -3918,6 +3980,27 @@ func (in *PermittedHostDevices) DeepCopy() *PermittedHostDevices {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PersistentReservationConfiguration) DeepCopyInto(out *PersistentReservationConfiguration) {
*out = *in
if in.Enabled != nil {
in, out := &in.Enabled, &out.Enabled
*out = new(bool)
**out = **in
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PersistentReservationConfiguration.
func (in *PersistentReservationConfiguration) DeepCopy() *PersistentReservationConfiguration {
if in == nil {
return nil
}
out := new(PersistentReservationConfiguration)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PersistentVolumeClaimInfo) DeepCopyInto(out *PersistentVolumeClaimInfo) {
*out = *in
@@ -4028,6 +4111,22 @@ func (in *Port) DeepCopy() *Port {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PortRange) DeepCopyInto(out *PortRange) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PortRange.
func (in *PortRange) DeepCopy() *PortRange {
if in == nil {
return nil
}
out := new(PortRange)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PreferenceMatcher) DeepCopyInto(out *PreferenceMatcher) {
*out = *in
@@ -4721,6 +4820,62 @@ func (in *SoundDevice) DeepCopy() *SoundDevice {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *StallDetectorOptions) DeepCopyInto(out *StallDetectorOptions) {
*out = *in
if in.StallMargin != nil {
in, out := &in.StallMargin, &out.StallMargin
*out = new(int64)
**out = **in
}
if in.EwmaAlpha != nil {
in, out := &in.EwmaAlpha, &out.EwmaAlpha
*out = new(string)
**out = **in
}
if in.StallProgressTimeout != nil {
in, out := &in.StallProgressTimeout, &out.StallProgressTimeout
*out = new(uint64)
**out = **in
}
if in.SwitchoverTimeout != nil {
in, out := &in.SwitchoverTimeout, &out.SwitchoverTimeout
*out = new(uint64)
**out = **in
}
if in.PrecopyPossibleFactor != nil {
in, out := &in.PrecopyPossibleFactor, &out.PrecopyPossibleFactor
*out = new(string)
**out = **in
}
if in.PatienceWindowDecayFactor != nil {
in, out := &in.PatienceWindowDecayFactor, &out.PatienceWindowDecayFactor
*out = new(string)
**out = **in
}
if in.SearchLocalMinima != nil {
in, out := &in.SearchLocalMinima, &out.SearchLocalMinima
*out = new(bool)
**out = **in
}
if in.CompletionTimeoutFactor != nil {
in, out := &in.CompletionTimeoutFactor, &out.CompletionTimeoutFactor
*out = new(string)
**out = **in
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StallDetectorOptions.
func (in *StallDetectorOptions) DeepCopy() *StallDetectorOptions {
if in == nil {
return nil
}
out := new(StallDetectorOptions)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *StartOptions) DeepCopyInto(out *StartOptions) {
*out = *in
@@ -4877,6 +5032,53 @@ func (in *TDX) DeepCopy() *TDX {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *TDXAttestationConfiguration) DeepCopyInto(out *TDXAttestationConfiguration) {
*out = *in
if in.Enforced != nil {
in, out := &in.Enforced, &out.Enforced
*out = new(bool)
**out = **in
}
if in.QgsSocketPath != nil {
in, out := &in.QgsSocketPath, &out.QgsSocketPath
*out = new(string)
**out = **in
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TDXAttestationConfiguration.
func (in *TDXAttestationConfiguration) DeepCopy() *TDXAttestationConfiguration {
if in == nil {
return nil
}
out := new(TDXAttestationConfiguration)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *TDXConfiguration) DeepCopyInto(out *TDXConfiguration) {
*out = *in
if in.Attestation != nil {
in, out := &in.Attestation, &out.Attestation
*out = new(TDXAttestationConfiguration)
(*in).DeepCopyInto(*out)
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TDXConfiguration.
func (in *TDXConfiguration) DeepCopy() *TDXConfiguration {
if in == nil {
return nil
}
out := new(TDXConfiguration)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *TLBFlush) DeepCopyInto(out *TLBFlush) {
*out = *in
@@ -5217,6 +5419,102 @@ func (in *VGPUOptions) DeepCopy() *VGPUOptions {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *VMIMConfigurationOptions) DeepCopyInto(out *VMIMConfigurationOptions) {
*out = *in
if in.NodeDrainTaintKey != nil {
in, out := &in.NodeDrainTaintKey, &out.NodeDrainTaintKey
*out = new(string)
**out = **in
}
if in.ParallelOutboundMigrationsPerNode != nil {
in, out := &in.ParallelOutboundMigrationsPerNode, &out.ParallelOutboundMigrationsPerNode
*out = new(uint32)
**out = **in
}
if in.ParallelMigrationsPerCluster != nil {
in, out := &in.ParallelMigrationsPerCluster, &out.ParallelMigrationsPerCluster
*out = new(uint32)
**out = **in
}
if in.AllowAutoConverge != nil {
in, out := &in.AllowAutoConverge, &out.AllowAutoConverge
*out = new(bool)
**out = **in
}
if in.BandwidthPerMigration != nil {
in, out := &in.BandwidthPerMigration, &out.BandwidthPerMigration
x := (*in).DeepCopy()
*out = &x
}
if in.CompletionTimeoutPerGiB != nil {
in, out := &in.CompletionTimeoutPerGiB, &out.CompletionTimeoutPerGiB
*out = new(int64)
**out = **in
}
if in.MaxDowntimeMs != nil {
in, out := &in.MaxDowntimeMs, &out.MaxDowntimeMs
*out = new(uint64)
**out = **in
}
if in.ProgressTimeout != nil {
in, out := &in.ProgressTimeout, &out.ProgressTimeout
*out = new(int64)
**out = **in
}
if in.UtilityVolumesTimeout != nil {
in, out := &in.UtilityVolumesTimeout, &out.UtilityVolumesTimeout
*out = new(int64)
**out = **in
}
if in.UnsafeMigrationOverride != nil {
in, out := &in.UnsafeMigrationOverride, &out.UnsafeMigrationOverride
*out = new(bool)
**out = **in
}
if in.AllowPostCopy != nil {
in, out := &in.AllowPostCopy, &out.AllowPostCopy
*out = new(bool)
**out = **in
}
if in.AllowWorkloadDisruption != nil {
in, out := &in.AllowWorkloadDisruption, &out.AllowWorkloadDisruption
*out = new(bool)
**out = **in
}
if in.DisableTLS != nil {
in, out := &in.DisableTLS, &out.DisableTLS
*out = new(bool)
**out = **in
}
if in.Network != nil {
in, out := &in.Network, &out.Network
*out = new(string)
**out = **in
}
if in.MatchSELinuxLevelOnMigration != nil {
in, out := &in.MatchSELinuxLevelOnMigration, &out.MatchSELinuxLevelOnMigration
*out = new(bool)
**out = **in
}
if in.ExperimentalMigrationOptions != nil {
in, out := &in.ExperimentalMigrationOptions, &out.ExperimentalMigrationOptions
*out = new(ExperimentalMigrationOptions)
(*in).DeepCopyInto(*out)
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VMIMConfigurationOptions.
func (in *VMIMConfigurationOptions) DeepCopy() *VMIMConfigurationOptions {
if in == nil {
return nil
}
out := new(VMIMConfigurationOptions)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *VMISelector) DeepCopyInto(out *VMISelector) {
*out = *in
@@ -5890,9 +6188,9 @@ func (in *VirtualMachineInstanceMigrationState) DeepCopyInto(out *VirtualMachine
*out = new(string)
**out = **in
}
if in.MigrationConfiguration != nil {
in, out := &in.MigrationConfiguration, &out.MigrationConfiguration
*out = new(MigrationConfiguration)
if in.VMIMConfigurationOptions != nil {
in, out := &in.VMIMConfigurationOptions, &out.VMIMConfigurationOptions
*out = new(VMIMConfigurationOptions)
(*in).DeepCopyInto(*out)
}
if in.TargetCPUSet != nil {
@@ -6306,6 +6604,32 @@ func (in *VirtualMachineInstanceReplicaSetStatus) DeepCopy() *VirtualMachineInst
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *VirtualMachineInstanceResourceClaim) DeepCopyInto(out *VirtualMachineInstanceResourceClaim) {
*out = *in
if in.ResourceClaimName != nil {
in, out := &in.ResourceClaimName, &out.ResourceClaimName
*out = new(string)
**out = **in
}
if in.ResourceClaimTemplateName != nil {
in, out := &in.ResourceClaimTemplateName, &out.ResourceClaimTemplateName
*out = new(string)
**out = **in
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineInstanceResourceClaim.
func (in *VirtualMachineInstanceResourceClaim) DeepCopy() *VirtualMachineInstanceResourceClaim {
if in == nil {
return nil
}
out := new(VirtualMachineInstanceResourceClaim)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *VirtualMachineInstanceSpec) DeepCopyInto(out *VirtualMachineInstanceSpec) {
*out = *in
@@ -6389,7 +6713,7 @@ func (in *VirtualMachineInstanceSpec) DeepCopyInto(out *VirtualMachineInstanceSp
}
if in.ResourceClaims != nil {
in, out := &in.ResourceClaims, &out.ResourceClaims
*out = make([]corev1.PodResourceClaim, len(*in))
*out = make([]VirtualMachineInstanceResourceClaim, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
+36 -8
View File
@@ -708,14 +708,15 @@ type GPU struct {
}
type ClaimRequest struct {
// ClaimName needs to be provided from the list vmi.spec.resourceClaims[].name where this
// device is allocated
// +optional
ClaimName *string `json:"claimName,omitempty"`
// RequestName needs to be provided from resourceClaim.spec.devices.requests[].name where this
// device is requested
// +optional
RequestName *string `json:"requestName,omitempty"`
// ClaimName references the name of an entry in the
// VMI's spec.resourceClaims[] array. The referenced
// entry may use either resourceClaimName or
// resourceClaimTemplateName.
ClaimName string `json:"claimName,omitempty"`
// RequestName specifies which request from the
// ResourceClaim/ResourceClaimTemplate spec.devices.requests array this
// claim request corresponds to.
RequestName string `json:"requestName,omitempty"`
}
type VGPUOptions struct {
@@ -1455,7 +1456,14 @@ type Interface struct {
// version: 1alphav1
Binding *PluginBinding `json:"binding,omitempty"`
// List of ports to be forwarded to the virtual machine.
// Mutually exclusive with portRanges.
Ports []Port `json:"ports,omitempty"`
// List of port ranges to be forwarded to the virtual machine.
// Mutually exclusive with ports. Only supported on masquerade interfaces.
// This feature is in Alpha.
// +optional
// +listType=atomic
PortRanges []PortRange `json:"portRanges,omitempty"`
// Interface MAC address. For example: de:ad:00:00:be:af or DE-AD-00-00-BE-AF.
MacAddress string `json:"macAddress,omitempty"`
// BootOrder is an integer value > 0, used to determine ordering of boot devices.
@@ -1613,6 +1621,20 @@ type Port struct {
Port int32 `json:"port"`
}
// PortRange represents a range of ports to be forwarded to the virtual machine.
// All fields are mandatory.
type PortRange struct {
// Required. Must be UDP or TCP.
Protocol string `json:"protocol"`
// First port of the range to expose for the virtual machine.
// This must be a valid port number, 0 < x < 65536.
Start int32 `json:"start"`
// Last port of the range to expose for the virtual machine.
// This must be a valid port number, 0 < x < 65536.
// Must be greater than or equal to start.
End int32 `json:"end"`
}
type AccessCredentialSecretSource struct {
// SecretName represents the name of the secret in the VMI's namespace
SecretName string `json:"secretName"`
@@ -1740,6 +1762,12 @@ type Network struct {
type NetworkSource struct {
Pod *PodNetwork `json:"pod,omitempty"`
Multus *MultusNetwork `json:"multus,omitempty"`
// ResourceClaim represents a network resource requested
// via a VMI spec.resourceClaims[] entry, backed by either a
// Kubernetes ResourceClaim or ResourceClaimTemplate.
// This field should only be configured if the NetworkDevicesWithDRA feature-gate is enabled.
// This feature is in alpha.
ResourceClaim *ClaimRequest `json:"resourceClaim,omitempty"`
}
// Represents the stock pod network interface.
+15 -4
View File
@@ -353,8 +353,8 @@ func (GPU) SwaggerDoc() map[string]string {
func (ClaimRequest) SwaggerDoc() map[string]string {
return map[string]string{
"claimName": "ClaimName needs to be provided from the list vmi.spec.resourceClaims[].name where this\ndevice is allocated\n+optional",
"requestName": "RequestName needs to be provided from resourceClaim.spec.devices.requests[].name where this\ndevice is requested\n+optional",
"claimName": "ClaimName references the name of an entry in the\nVMI's spec.resourceClaims[] array. The referenced\nentry may use either resourceClaimName or\nresourceClaimTemplateName.",
"requestName": "RequestName specifies which request from the\nResourceClaim/ResourceClaimTemplate spec.devices.requests array this\nclaim request corresponds to.",
}
}
@@ -746,7 +746,8 @@ func (Interface) SwaggerDoc() map[string]string {
"name": "Logical name of the interface as well as a reference to the associated networks.\nMust match the Name of a Network.",
"model": "Interface model.\nOne of: e1000, e1000e, igb, ne2k_pci, pcnet, rtl8139, virtio.\nDefaults to virtio.",
"binding": "Binding specifies the binding plugin that will be used to connect the interface to the guest.\nIt provides an alternative to InterfaceBindingMethod.\nversion: 1alphav1",
"ports": "List of ports to be forwarded to the virtual machine.",
"ports": "List of ports to be forwarded to the virtual machine.\nMutually exclusive with portRanges.",
"portRanges": "List of port ranges to be forwarded to the virtual machine.\nMutually exclusive with ports. Only supported on masquerade interfaces.\nThis feature is in Alpha.\n+optional\n+listType=atomic",
"macAddress": "Interface MAC address. For example: de:ad:00:00:be:af or DE-AD-00-00-BE-AF.",
"bootOrder": "BootOrder is an integer value > 0, used to determine ordering of boot devices.\nLower values take precedence.\nEach interface or disk that has a boot order must have a unique value.\nInterfaces without a boot order are not tried.\n+optional",
"pciAddress": "If specified, the virtual network interface will be placed on the guests pci address with the specified PCI address. For example: 0000:81:01.10\n+optional",
@@ -842,6 +843,15 @@ func (Port) SwaggerDoc() map[string]string {
}
}
func (PortRange) SwaggerDoc() map[string]string {
return map[string]string{
"": "PortRange represents a range of ports to be forwarded to the virtual machine.\nAll fields are mandatory.",
"protocol": "Required. Must be UDP or TCP.",
"start": "First port of the range to expose for the virtual machine.\nThis must be a valid port number, 0 < x < 65536.",
"end": "Last port of the range to expose for the virtual machine.\nThis must be a valid port number, 0 < x < 65536.\nMust be greater than or equal to start.",
}
}
func (AccessCredentialSecretSource) SwaggerDoc() map[string]string {
return map[string]string{
"secretName": "SecretName represents the name of the secret in the VMI's namespace",
@@ -936,7 +946,8 @@ func (Network) SwaggerDoc() map[string]string {
func (NetworkSource) SwaggerDoc() map[string]string {
return map[string]string{
"": "Represents the source resource that will be connected to the vm.\nOnly one of its members may be specified.",
"": "Represents the source resource that will be connected to the vm.\nOnly one of its members may be specified.",
"resourceClaim": "ResourceClaim represents a network resource requested\nvia a VMI spec.resourceClaims[] entry, backed by either a\nKubernetes ResourceClaim or ResourceClaimTemplate.\nThis field should only be configured if the NetworkDevicesWithDRA feature-gate is enabled.\nThis feature is in alpha.",
}
}
+268 -11
View File
@@ -100,6 +100,12 @@ type VirtualMachineInstanceSpec struct {
// If not specified, the VMI will be dispatched by default scheduler.
// +optional
SchedulerName string `json:"schedulerName,omitempty"`
// ServiceAccountName is the name of the ServiceAccount to use to run the
// virt-launcher pod. This sets pod.spec.serviceAccountName but does NOT
// automatically expose the service account token to the VM guest.
// To expose the token to the VM, use a serviceAccount volume.
// +optional
ServiceAccountName string `json:"serviceAccountName,omitempty"`
// If toleration is specified, obey all the toleration rules.
Tolerations []k8sv1.Toleration `json:"tolerations,omitempty"`
// TopologySpreadConstraints describes how a group of VMIs will be spread across a given topology
@@ -180,13 +186,14 @@ type VirtualMachineInstanceSpec struct {
// This is an alpha field and requires enabling the
// DynamicResourceAllocation feature gate in kubernetes
// https://kubernetes.io/docs/concepts/scheduling-eviction/dynamic-resource-allocation/
// This field should only be configured if one of the feature-gates GPUsWithDRA or HostDevicesWithDRA is enabled.
// This field should only be configured if one of the feature-gates GPUsWithDRA, HostDevicesWithDRA,
// or NetworkDevicesWithDRA is enabled.
// This feature is in alpha.
//
// +listType=map
// +listMapKey=name
// +optional
ResourceClaims []k8sv1.PodResourceClaim `json:"resourceClaims,omitempty"`
ResourceClaims []VirtualMachineInstanceResourceClaim `json:"resourceClaims,omitempty"`
// List of utility volumes that can be mounted to the vmi virt-launcher pod
// without having a matching disk in the domain.
// Used to collect data for various operational workflows.
@@ -197,6 +204,31 @@ type VirtualMachineInstanceSpec struct {
UtilityVolumes []UtilityVolume `json:"utilityVolumes,omitempty"`
}
type VirtualMachineInstanceResourceClaim struct {
// Name uniquely identifies this resource claim inside the VMI.
// This field is required and must be a DNS_LABEL.
Name string `json:"name"`
// ResourceClaimName is the name of a ResourceClaim object in the same
// namespace as this VMI.
//
// Exactly one of ResourceClaimName and ResourceClaimTemplateName must
// be set.
ResourceClaimName *string `json:"resourceClaimName,omitempty"`
// ResourceClaimTemplateName is the name of a ResourceClaimTemplate
// object in the same namespace as this VMI.
//
// The template name is passed through to the generated virt-launcher Pod
// spec. From the Pod spec, the template is used to create a new
// ResourceClaim, which is bound to the virt-launcher Pod. When the
// virt-launcher Pod is deleted, the ResourceClaim is also deleted. The
// generated ResourceClaim name is unique and is recorded in
// pod.status.resourceClaimStatuses.
//
// Exactly one of ResourceClaimName and ResourceClaimTemplateName must
// be set.
ResourceClaimTemplateName *string `json:"resourceClaimTemplateName,omitempty"`
}
func (vmiSpec *VirtualMachineInstanceSpec) UnmarshalJSON(data []byte) error {
type VMISpecAlias VirtualMachineInstanceSpec
var vmiSpecAlias VMISpecAlias
@@ -302,6 +334,9 @@ type VirtualMachineInstanceStatus struct {
// VSOCKCID is used to track the allocated VSOCK CID in the VM.
// +optional
// +kubebuilder:validation:Format:=int64
// +kubebuilder:validation:Minimum:=0
// +kubebuilder:validation:Maximum:=4294967295
VSOCKCID *uint32 `json:"VSOCKCID,omitempty"`
// SELinuxContext is the actual SELinux context of the virt-launcher pod
@@ -404,12 +439,18 @@ type VolumeStatus struct {
// KernelInfo show info about the kernel image
type KernelInfo struct {
// +kubebuilder:validation:Format:=int64
// +kubebuilder:validation:Minimum:=0
// +kubebuilder:validation:Maximum:=4294967295
// Checksum is the checksum of the kernel image
Checksum uint32 `json:"checksum,omitempty"`
}
// InitrdInfo show info about the initrd file
type InitrdInfo struct {
// +kubebuilder:validation:Format:=int64
// +kubebuilder:validation:Minimum:=0
// +kubebuilder:validation:Maximum:=4294967295
// Checksum is the checksum of the initrd file
Checksum uint32 `json:"checksum,omitempty"`
}
@@ -444,6 +485,9 @@ type HotplugVolumeStatus struct {
// ContainerDiskInfo shows info about the containerdisk
type ContainerDiskInfo struct {
// +kubebuilder:validation:Format:=int64
// +kubebuilder:validation:Minimum:=0
// +kubebuilder:validation:Maximum:=4294967295
// Checksum is the checksum of the rootdisk or kernel artifacts inside the containerdisk
Checksum uint32 `json:"checksum,omitempty"`
}
@@ -691,6 +735,9 @@ const (
// VirtualMachineInstanceEvictionRequested indicates that an eviction has been requested for the VMI
VirtualMachineInstanceEvictionRequested VirtualMachineInstanceConditionType = "EvictionRequested"
// VirtualMachineInstanceSoftwareEmulation indicates the VM is running with software emulation
VirtualMachineInstanceSoftwareEmulation VirtualMachineInstanceConditionType = "SoftwareEmulation"
)
// These are valid reasons for VMI conditions.
@@ -985,7 +1032,7 @@ type VirtualMachineInstanceMigrationState struct {
// Name of the migration policy. If string is empty, no policy is matched
MigrationPolicyName *string `json:"migrationPolicyName,omitempty"`
// Migration configurations to apply
MigrationConfiguration *MigrationConfiguration `json:"migrationConfiguration,omitempty"`
VMIMConfigurationOptions *VMIMConfigurationOptions `json:"migrationConfiguration,omitempty"`
// If the VMI requires dedicated CPUs, this field will
// hold the dedicated CPU set on the target node
// +listType=atomic
@@ -1182,8 +1229,6 @@ const (
EphemeralProvisioningObject string = "kubevirt.io/ephemeral-provisioning"
// This annotation stores the memory overhead calculated for the virt-launcher pod
MemoryOverheadAnnotationBytes string = "kubevirt.io/memory-overhead-bytes"
// This annotation indicates the VMI contains an ephemeral hotplug volume
EphemeralHotplugAnnotation string = "kubevirt.io/ephemeral-hotplug-volumes"
// This label indicates the object is a part of the install strategy retrieval process.
InstallStrategyLabel = "kubevirt.io/install-strategy"
@@ -1299,6 +1344,9 @@ const (
// TDXLabel marks the node as capable of running workloads with Intel TDX
TDXLabel string = "kubevirt.io/tdx"
// VMArchLabel marks the node as capable of running VMs of a given architecture
VMArchLabel string = "kubevirt.io/vm-arch-"
// KSMEnabledLabel marks the node as KSM-handling enabled
KSMEnabledLabel string = "kubevirt.io/ksm-enabled"
@@ -1340,6 +1388,11 @@ const (
// representation of the name to ensure uniqueness.
VirtualMachineInstanceIDLabel = "vmi.kubevirt.io/id"
// PersistentReservationLabelPrefix is the label key prefix used to mark
// virt-launcher pods that use SCSI PersistentReservation on a given PVC.
// The suffix is the PVC's UID.
PersistentReservationLabelPrefix = "pr.kubevirt.io/"
// PVCMemoryDumpAnnotation is the name of the memory dump representing the vm name,
// pvc name and the timestamp the memory dump was collected
PVCMemoryDumpAnnotation string = "kubevirt.io/memory-dump"
@@ -1403,6 +1456,16 @@ const (
// This could be useful to distinguish evictions originated from the descheduler.
EvictionSourceAnnotation = "kubevirt.io/eviction-source"
// QGSSocketPathAnnotation specifies the path to the TDX Quote Generation Service socket.
// This annotation is set by virt-handler based on the cluster configuration.
QGSSocketPathAnnotation = "kubevirt.io/qgs-socket-path"
// PauseGuestAgentProbesAnnotation, when set to a truthy value (strconv.ParseBool)
// on a VMI, causes virt-launcher to short-circuit GuestAgentPing probes and
// return immediate success without contacting the QEMU guest agent.
// Remove the annotation (or set to a falsy value) to resume normal probe behavior.
PauseGuestAgentProbesAnnotation string = "kubevirt.io/pause-guest-agent-probes"
// AllowAccessClusterServicesNPLabel is a pod label to be set by virt-components to indicate that they require
// access to cluster services otherwise blocked by the strict network policy (NP).
// This label will be applied to the following virt pods:
@@ -2015,10 +2078,10 @@ const (
// VirtualMachineStatusUnschedulable indicates that an error has occurred while scheduling the virtual machine,
// e.g. due to unsatisfiable resource requests or unsatisfiable scheduling constraints.
VirtualMachineStatusUnschedulable VirtualMachinePrintableStatus = "ErrorUnschedulable"
// VirtualMachineStatusErrImagePull indicates that an error has occured while pulling an image for
// VirtualMachineStatusErrImagePull indicates that an error has occurred while pulling an image for
// a containerDisk VM volume.
VirtualMachineStatusErrImagePull VirtualMachinePrintableStatus = "ErrImagePull"
// VirtualMachineStatusImagePullBackOff indicates that an error has occured while pulling an image for
// VirtualMachineStatusImagePullBackOff indicates that an error has occurred while pulling an image for
// a containerDisk VM volume, and that kubelet is backing off before retrying.
VirtualMachineStatusImagePullBackOff VirtualMachinePrintableStatus = "ImagePullBackOff"
// VirtualMachineStatusPvcNotFound indicates that the virtual machine references a PVC volume which doesn't exist.
@@ -2192,6 +2255,9 @@ type VirtualMachineInstanceBackupStatus struct {
// +optional
// +listType=atomic
Volumes []backupv1.BackupVolumeInfo `json:"volumes,omitempty"`
// QuiesceStatus indicates whether filesystem freeze succeeded, failed, or was skipped.
// +optional
QuiesceStatus string `json:"quiesceStatus,omitempty"`
}
// ChangedBlockTrackingStatus represents the status of ChangedBlockTracking for a VM
@@ -2329,6 +2395,12 @@ type Handler struct {
// +optional
Exec *k8sv1.ExecAction `json:"exec,omitempty" protobuf:"bytes,1,opt,name=exec"`
// GuestAgentPing contacts the qemu-guest-agent for availability checks.
// Probe failures are automatically suppressed when the guest agent is
// unreachable for a non-fault reason: during live migration (guest paused
// on one pod while memory is transferred) and whenever the VM is paused
// for an intentional or transient reason such as a user pause, snapshot,
// save, or dump. Failures are not suppressed when the VM is paused due to
// a fault (IO error, crash, or postcopy failure).
// +optional
GuestAgentPing *GuestAgentPing `json:"guestAgentPing,omitempty"`
// HTTPGet specifies the http request to perform.
@@ -2478,7 +2550,10 @@ type KubeVirtSpec struct {
// Defaults to the same registry the operator's container image is pulled from.
ImageRegistry string `json:"imageRegistry,omitempty"`
// The ImagePullPolicy to use.
// The ImagePullPolicy to use for KubeVirt operator-managed infrastructure
// images (virt-api, virt-controller, virt-handler, virt-exportproxy, etc.).
// For pull policy of user workload pods, see
// spec.configuration.imagePullPolicy.
ImagePullPolicy k8sv1.PullPolicy `json:"imagePullPolicy,omitempty" valid:"required"`
// The imagePullSecrets to pull the container images from
@@ -3007,7 +3082,10 @@ type KubeVirtConfiguration struct {
CPURequest *resource.Quantity `json:"cpuRequest,omitempty"`
DeveloperConfiguration *DeveloperConfiguration `json:"developerConfiguration,omitempty"`
// Deprecated. Use architectureConfiguration instead.
EmulatedMachines []string `json:"emulatedMachines,omitempty"`
EmulatedMachines []string `json:"emulatedMachines,omitempty"`
// The ImagePullPolicy to use for user workload pods and their containers
// (launcher pods, exporter pods, etc.).
// For KubeVirt infrastructure images, use spec.imagePullPolicy instead.
ImagePullPolicy k8sv1.PullPolicy `json:"imagePullPolicy,omitempty"`
MigrationConfiguration *MigrationConfiguration `json:"migrations,omitempty"`
// Deprecated. Use architectureConfiguration instead.
@@ -3096,17 +3174,45 @@ type KubeVirtConfiguration struct {
// +nullable
ChangedBlockTrackingLabelSelectors *ChangedBlockTrackingSelectors `json:"changedBlockTrackingLabelSelectors,omitempty"`
// PersistentReservationConfiguration controls the deployment of additional resources required for using SCSI persistent reservation in VMs
// +nullable
PersistentReservationConfiguration *PersistentReservationConfiguration `json:"persistentReservationConfiguration,omitempty"`
// QGS configuration for attestation on the Intel TDX Platform
// +nullable
ConfidentialCompute *ConfidentialComputeConfiguration `json:"confidentialCompute,omitempty"`
// RoleAggregationStrategy controls whether RBAC cluster roles should be aggregated
// to the default Kubernetes roles (admin, edit, view).
// When set to "AggregateToDefault" (default) or not specified, the aggregate-to-* labels are added to the cluster roles.
// When set to "Manual", the labels are not added, and roles will not be aggregated to the default roles.
// Setting this field to "Manual" requires the OptOutRoleAggregation feature gate to be enabled.
// This is an Alpha feature and subject to change.
// Setting RoleAggregationStrategy to "Manual" requires the OptOutRoleAggregation feature gate
// to be enabled (Beta, enabled by default since v1.9.0).
// +optional
// +kubebuilder:validation:Enum=AggregateToDefault;Manual
RoleAggregationStrategy *RoleAggregationStrategy `json:"roleAggregationStrategy,omitempty"`
}
// QGSConfiguration holds QGS configuration
type TDXAttestationConfiguration struct {
// Indicates whether TDX VM should enforce the existence of QGS (required for attestation) to be scheduled
// +kubebuilder:default=false
Enforced *bool `json:"enforced,omitempty"`
// Socket path pointing to the Quote Generation Service
// +kubebuilder:default=/var/run/tdx-qgs/qgs.socket
QgsSocketPath *string `json:"qgsSocketPath,omitempty"`
}
type TDXConfiguration struct {
Attestation *TDXAttestationConfiguration `json:"attestation,omitempty"`
}
type ConfidentialComputeConfiguration struct {
// TDX configuration for attestation on the Intel TDX Platform
// +nullable
TDX *TDXConfiguration `json:"tdx,omitempty"`
}
const (
// KVM is the default and most common hypervisor used with KubeVirt.
KvmHypervisorName string = "kvm"
@@ -3294,6 +3400,145 @@ type TLSConfiguration struct {
Ciphers []string `json:"ciphers,omitempty"`
}
type StallDetectorOptions struct {
// StallMargin is the fractional tolerance, expressed as a percentage, used when
// comparing remaining migration bytes against the best observed value to detect stalls
// and local minima. A stall is reported when remaining bytes stay above
// (1 - StallMargin/100) of the outside-window minimum.
// Defaults to 4.
//+kubebuilder:validation:Minimum=0
//+kubebuilder:validation:Maximum=100
//+optional
StallMargin *int64 `json:"stallMargin,omitempty"`
// EwmaAlpha is the smoothing factor for the exponentially weighted moving average of
// observed migration bandwidth. Must be in the range (0, 1]; zero is invalid because
// the estimate would never incorporate new samples. Higher values weight recent samples
// more heavily.
// Defaults to "0.4".
//+optional
EwmaAlpha *string `json:"ewmaAlpha,omitempty"`
// StallProgressTimeout is the duration in seconds of the sliding window used to track
// minimum remaining-bytes and detect when migration progress has stalled.
// Defaults to 40.
//+optional
StallProgressTimeout *uint64 `json:"stallProgressTimeout,omitempty"`
// SwitchoverTimeout is the duration in seconds allowed for a stop-and-copy or post-copy
// switchover to complete after being triggered before the migration is aborted.
// Defaults to 60.
//+optional
SwitchoverTimeout *uint64 `json:"switchoverTimeout,omitempty"`
// PrecopyPossibleFactor is the maximum factor by which estimated downtime may exceed
// MaxDowntime while still attempting a soft stop-and-copy instead of aborting the migration.
// Defaults to "1.5".
//+optional
PrecopyPossibleFactor *string `json:"precopyPossibleFactor,omitempty"`
// PatienceWindowDecayFactor is the factor by which the relaxation patience window is
// multiplied after each best-remaining-bytes relaxation step.
// Defaults to "0.5".
//+optional
PatienceWindowDecayFactor *string `json:"patienceWindowDecayFactor,omitempty"`
// SearchLocalMinima controls whether convergence actions are delayed until remaining bytes
// reach a local minimum near the best observed value. When false, actions may trigger
// as soon as a stall is detected.
// Defaults to true.
//+optional
SearchLocalMinima *bool `json:"searchLocalMinima,omitempty"`
// CompletionTimeoutFactor multiplies the computed migration completion timeout to determine
// the total time budget for deciding whether a forced switchover can still finish in time,
// and to extend the abort deadline after initiating a completion-timeout-driven switchover.
// Defaults to "2".
//+optional
CompletionTimeoutFactor *string `json:"completionTimeoutFactor,omitempty"`
}
// MigrationCompression represents the compression method for live migration.
type MigrationCompression string
const (
// MigrationCompressionNone disables compression.
MigrationCompressionNone MigrationCompression = "none"
// MigrationCompressionZstd enables zstd compression on multifd channels.
MigrationCompressionZstd MigrationCompression = "zstd"
)
// ExperimentalMigrationOptions is an alpha API for experimental migration tunables.
// It is intended for experimental purposes only and will be removed in the future.
type ExperimentalMigrationOptions struct {
//+optional
StallDetector *StallDetectorOptions `json:"stallDetector,omitempty"`
// Compression selects the algorithm for compressing the live migration
// data stream. When omitted (nil) or set to "none", compression is
// disabled.
// +kubebuilder:validation:Enum=none;zstd
//+optional
Compression *MigrationCompression `json:"compression,omitempty"`
}
// VMIMConfigurationOptions holds the resolved migration options for a single migration.
// It is written to VirtualMachineInstanceMigrationState and represents the effective
// configuration after merging KubeVirt defaults with any matched MigrationPolicy.
type VMIMConfigurationOptions struct {
// NodeDrainTaintKey defines the taint key that indicates a node should be drained.
// Note: this option relies on the deprecated node taint feature. Default: kubevirt.io/drain
NodeDrainTaintKey *string `json:"nodeDrainTaintKey,omitempty"`
// ParallelOutboundMigrationsPerNode is the maximum number of concurrent outgoing live migrations
// allowed per node. Defaults to 2
ParallelOutboundMigrationsPerNode *uint32 `json:"parallelOutboundMigrationsPerNode,omitempty"`
// ParallelMigrationsPerCluster is the total number of concurrent live migrations
// allowed cluster-wide. Defaults to 5
ParallelMigrationsPerCluster *uint32 `json:"parallelMigrationsPerCluster,omitempty"`
// AllowAutoConverge allows the platform to compromise performance/availability of VMIs to
// guarantee successful VMI live migrations. Defaults to false
AllowAutoConverge *bool `json:"allowAutoConverge,omitempty"`
// BandwidthPerMigration limits the amount of network bandwidth live migrations are allowed to use.
// The value is in quantity per second. Defaults to 0 (no limit)
BandwidthPerMigration *resource.Quantity `json:"bandwidthPerMigration,omitempty"`
// CompletionTimeoutPerGiB is the maximum number of seconds per GiB a migration is allowed to take.
// If the timeout is reached, the migration will be either paused, switched
// to post-copy or cancelled depending on other settings. Defaults to 150
CompletionTimeoutPerGiB *int64 `json:"completionTimeoutPerGiB,omitempty"`
// MaxDowntimeMs specifies the maximum tolerable downtime (in milliseconds) during switchover.
// Defaults to 900
//+kubebuilder:validation:Minimum=1
//+kubebuilder:validation:Maximum=2000000
MaxDowntimeMs *uint64 `json:"maxDowntimeMs,omitempty"`
// ProgressTimeout is the maximum number of seconds a live migration is allowed to make no progress.
// Hitting this timeout means a migration transferred 0 data for that many seconds. The migration is
// then considered stuck and therefore cancelled. Defaults to 150
ProgressTimeout *int64 `json:"progressTimeout,omitempty"`
// UtilityVolumesTimeout is the maximum number of seconds a migration can wait in Pending state
// for utility volumes to be detached. If utility volumes are still present after this timeout,
// the migration will be marked as Failed. Defaults to 150
UtilityVolumesTimeout *int64 `json:"utilityVolumesTimeout,omitempty"`
// UnsafeMigrationOverride allows live migrations to occur even if the compatibility check
// indicates the migration will be unsafe to the guest. Defaults to false
UnsafeMigrationOverride *bool `json:"unsafeMigrationOverride,omitempty"`
// AllowPostCopy enables post-copy live migrations. Such migrations allow even the busiest VMIs
// to successfully live-migrate. However, events like a network failure can cause a VMI crash.
// If set to true, migrations will still start in pre-copy, but switch to post-copy when
// CompletionTimeoutPerGiB triggers. Defaults to false
AllowPostCopy *bool `json:"allowPostCopy,omitempty"`
// AllowWorkloadDisruption indicates that the migration shouldn't be
// canceled after acceptableCompletionTime is exceeded. Instead, if
// permitted, migration will be switched to post-copy or the VMI will be
// paused to allow the migration to complete
AllowWorkloadDisruption *bool `json:"allowWorkloadDisruption,omitempty"`
// When set to true, DisableTLS will disable the additional layer of live migration encryption
// provided by KubeVirt. This is usually a bad idea. Defaults to false
DisableTLS *bool `json:"disableTLS,omitempty"`
// Network is the name of the CNI network to use for live migrations. By default, migrations go
// through the pod network.
Network *string `json:"network,omitempty"`
// By default, the SELinux level of target virt-launcher pods is forced to the level of the source virt-launcher.
// When set to true, MatchSELinuxLevelOnMigration lets the CRI auto-assign a random level to the target.
// That will ensure the target virt-launcher doesn't share categories with another pod on the node.
// However, migrations will fail when using RWX volumes that don't automatically deal with SELinux levels.
MatchSELinuxLevelOnMigration *bool `json:"matchSELinuxLevelOnMigration,omitempty"`
// ExperimentalMigrationOptions is an alpha API. It is intended for experimental
// purposes only and will be removed in the future.
ExperimentalMigrationOptions *ExperimentalMigrationOptions `json:"experimental,omitempty"`
}
// MigrationConfiguration holds migration options.
// Can be overridden for specific groups of VMs though migration policies.
// Visit https://kubevirt.io/user-guide/operations/migration_policies/ for more information.
@@ -3317,6 +3562,11 @@ type MigrationConfiguration struct {
// If the timeout is reached, the migration will be either paused, switched
// to post-copy or cancelled depending on other settings. Defaults to 150
CompletionTimeoutPerGiB *int64 `json:"completionTimeoutPerGiB,omitempty"`
// MaxDowntimeMs specifies the maximum tolerable downtime (in milliseconds) during switchover.
// Defaults to 900
// +kubebuilder:validation:Minimum=1
// +kubebuilder:validation:Maximum=2000000
MaxDowntimeMs *uint64 `json:"maxDowntimeMs,omitempty"`
// ProgressTimeout is the maximum number of seconds a live migration is allowed to make no progress.
// Hitting this timeout means a migration transferred 0 data for that many seconds. The migration is
// then considered stuck and therefore cancelled. Defaults to 150
@@ -3831,3 +4081,10 @@ type ObjectGraphOptions struct {
// LabelSelector is used to filter nodes in the graph based on their labels.
LabelSelector *metav1.LabelSelector `json:"labelSelector,omitempty"`
}
type PersistentReservationConfiguration struct {
// Enabled controls the deployment of additional resources like the pr-helper container
// for enabling the use of the SCSI persistent reservation VMs, defaults to False.
// +nullable
Enabled *bool `json:"enabled,omitempty"`
}
+89 -8
View File
@@ -24,6 +24,7 @@ func (VirtualMachineInstanceSpec) SwaggerDoc() map[string]string {
"nodeSelector": "NodeSelector is a selector which must be true for the vmi to fit on a node.\nSelector which must match a node's labels for the vmi to be scheduled on that node.\nMore info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/\n+optional",
"affinity": "If affinity is specifies, obey all the affinity rules",
"schedulerName": "If specified, the VMI will be dispatched by specified scheduler.\nIf not specified, the VMI will be dispatched by default scheduler.\n+optional",
"serviceAccountName": "ServiceAccountName is the name of the ServiceAccount to use to run the\nvirt-launcher pod. This sets pod.spec.serviceAccountName but does NOT\nautomatically expose the service account token to the VM guest.\nTo expose the token to the VM, use a serviceAccount volume.\n+optional",
"tolerations": "If toleration is specified, obey all the toleration rules.",
"topologySpreadConstraints": "TopologySpreadConstraints describes how a group of VMIs will be spread across a given topology\ndomains. K8s scheduler will schedule VMI pods in a way which abides by the constraints.\n+optional\n+patchMergeKey=topologyKey\n+patchStrategy=merge\n+listType=map\n+listMapKey=topologyKey\n+listMapKey=whenUnsatisfiable",
"evictionStrategy": "EvictionStrategy describes the strategy to follow when a node drain occurs.\nThe possible options are:\n- \"None\": No action will be taken, according to the specified 'RunStrategy' the VirtualMachine will be restarted or shutdown.\n- \"LiveMigrate\": the VirtualMachineInstance will be migrated instead of being shutdown.\n- \"LiveMigrateIfPossible\": the same as \"LiveMigrate\" but only if the VirtualMachine is Live-Migratable, otherwise it will behave as \"None\".\n- \"External\": the VirtualMachineInstance will be protected and `vmi.Status.EvacuationNodeName` will be set on eviction. This is mainly useful for cluster-api-provider-kubevirt (capk) which needs a way for VMI's to be blocked from eviction, yet signal capk that eviction has been called on the VMI so the capk controller can handle tearing the VMI down. Details can be found in the commit description https://github.com/kubevirt/kubevirt/commit/c1d77face705c8b126696bac9a3ee3825f27f1fa.\n+optional",
@@ -39,11 +40,19 @@ func (VirtualMachineInstanceSpec) SwaggerDoc() map[string]string {
"dnsConfig": "Specifies the DNS parameters of a pod.\nParameters specified here will be merged to the generated DNS\nconfiguration based on DNSPolicy.\n+optional",
"accessCredentials": "Specifies a set of public keys to inject into the vm guest\n+listType=atomic\n+optional\n+kubebuilder:validation:MaxItems:=256",
"architecture": "Specifies the architecture of the vm guest you are attempting to run. Defaults to the compiled architecture of the KubeVirt components",
"resourceClaims": "ResourceClaims define which ResourceClaims must be allocated\nand reserved before the VMI, hence virt-launcher pod is allowed to start. The resources\nwill be made available to the domain which consumes them\nby name.\n\nThis is an alpha field and requires enabling the\nDynamicResourceAllocation feature gate in kubernetes\n https://kubernetes.io/docs/concepts/scheduling-eviction/dynamic-resource-allocation/\nThis field should only be configured if one of the feature-gates GPUsWithDRA or HostDevicesWithDRA is enabled.\nThis feature is in alpha.\n\n+listType=map\n+listMapKey=name\n+optional",
"resourceClaims": "ResourceClaims define which ResourceClaims must be allocated\nand reserved before the VMI, hence virt-launcher pod is allowed to start. The resources\nwill be made available to the domain which consumes them\nby name.\n\nThis is an alpha field and requires enabling the\nDynamicResourceAllocation feature gate in kubernetes\n https://kubernetes.io/docs/concepts/scheduling-eviction/dynamic-resource-allocation/\nThis field should only be configured if one of the feature-gates GPUsWithDRA, HostDevicesWithDRA,\nor NetworkDevicesWithDRA is enabled.\nThis feature is in alpha.\n\n+listType=map\n+listMapKey=name\n+optional",
"utilityVolumes": "List of utility volumes that can be mounted to the vmi virt-launcher pod\nwithout having a matching disk in the domain.\nUsed to collect data for various operational workflows.\n+kubebuilder:validation:MaxItems:=256\n+listType=map\n+listMapKey=name\n+optional",
}
}
func (VirtualMachineInstanceResourceClaim) SwaggerDoc() map[string]string {
return map[string]string{
"name": "Name uniquely identifies this resource claim inside the VMI.\nThis field is required and must be a DNS_LABEL.",
"resourceClaimName": "ResourceClaimName is the name of a ResourceClaim object in the same\nnamespace as this VMI.\n\nExactly one of ResourceClaimName and ResourceClaimTemplateName must\nbe set.",
"resourceClaimTemplateName": "ResourceClaimTemplateName is the name of a ResourceClaimTemplate\nobject in the same namespace as this VMI.\n\nThe template name is passed through to the generated virt-launcher Pod\nspec. From the Pod spec, the template is used to create a new\nResourceClaim, which is bound to the virt-launcher Pod. When the\nvirt-launcher Pod is deleted, the ResourceClaim is also deleted. The\ngenerated ResourceClaim name is unique and is recorded in\npod.status.resourceClaimStatuses.\n\nExactly one of ResourceClaimName and ResourceClaimTemplateName must\nbe set.",
}
}
func (VirtualMachineInstancePhaseTransitionTimestamp) SwaggerDoc() map[string]string {
return map[string]string{
"": "VirtualMachineInstancePhaseTransitionTimestamp gives a timestamp in relation to when a phase is set on a vmi",
@@ -79,7 +88,7 @@ func (VirtualMachineInstanceStatus) SwaggerDoc() map[string]string {
"topologyHints": "+optional",
"virtualMachineRevisionName": "VirtualMachineRevisionName is used to get the vm revision of the vmi when doing\nan online vm snapshot\n+optional",
"runtimeUser": "RuntimeUser is used to determine what user will be used in launcher\n+optional",
"VSOCKCID": "VSOCKCID is used to track the allocated VSOCK CID in the VM.\n+optional",
"VSOCKCID": "VSOCKCID is used to track the allocated VSOCK CID in the VM.\n+optional\n+kubebuilder:validation:Format:=int64\n+kubebuilder:validation:Minimum:=0\n+kubebuilder:validation:Maximum:=4294967295",
"selinuxContext": "SELinuxContext is the actual SELinux context of the virt-launcher pod\n+optional",
"machine": "Machine shows the final resulting qemu machine type. This can be different\nthan the machine type selected in the spec, due to qemus machine type alias mechanism.\n+optional",
"currentCPUTopology": "CurrentCPUTopology specifies the current CPU topology used by the VM workload.\nCurrent topology may differ from the desired topology in the spec while CPU hotplug\ntakes place.",
@@ -130,14 +139,14 @@ func (VolumeStatus) SwaggerDoc() map[string]string {
func (KernelInfo) SwaggerDoc() map[string]string {
return map[string]string{
"": "KernelInfo show info about the kernel image",
"checksum": "Checksum is the checksum of the kernel image",
"checksum": "+kubebuilder:validation:Format:=int64\n+kubebuilder:validation:Minimum:=0\n+kubebuilder:validation:Maximum:=4294967295\nChecksum is the checksum of the kernel image",
}
}
func (InitrdInfo) SwaggerDoc() map[string]string {
return map[string]string{
"": "InitrdInfo show info about the initrd file",
"checksum": "Checksum is the checksum of the initrd file",
"checksum": "+kubebuilder:validation:Format:=int64\n+kubebuilder:validation:Minimum:=0\n+kubebuilder:validation:Maximum:=4294967295\nChecksum is the checksum of the initrd file",
}
}
@@ -170,7 +179,7 @@ func (HotplugVolumeStatus) SwaggerDoc() map[string]string {
func (ContainerDiskInfo) SwaggerDoc() map[string]string {
return map[string]string{
"": "ContainerDiskInfo shows info about the containerdisk",
"checksum": "Checksum is the checksum of the rootdisk or kernel artifacts inside the containerdisk",
"checksum": "+kubebuilder:validation:Format:=int64\n+kubebuilder:validation:Minimum:=0\n+kubebuilder:validation:Maximum:=4294967295\nChecksum is the checksum of the rootdisk or kernel artifacts inside the containerdisk",
}
}
@@ -500,6 +509,7 @@ func (VirtualMachineInstanceBackupStatus) SwaggerDoc() map[string]string {
"backupMsg": "BackupMsg resturns any relevant information like failure reason\nunfreeze failed etc...\n+optional",
"checkpointName": "CheckpointName is the name of the checkpoint created for the backup\n+optional",
"volumes": "Volumes lists the volumes included in the backup\n+optional\n+listType=atomic",
"quiesceStatus": "QuiesceStatus indicates whether filesystem freeze succeeded, failed, or was skipped.\n+optional",
}
}
@@ -558,7 +568,7 @@ func (Handler) SwaggerDoc() map[string]string {
return map[string]string{
"": "Handler defines a specific action that should be taken",
"exec": "One and only one of the following should be specified.\nExec specifies the action to take, it will be executed on the guest through the qemu-guest-agent.\nIf the guest agent is not available, this probe will fail.\n+optional",
"guestAgentPing": "GuestAgentPing contacts the qemu-guest-agent for availability checks.\n+optional",
"guestAgentPing": "GuestAgentPing contacts the qemu-guest-agent for availability checks.\nProbe failures are automatically suppressed when the guest agent is\nunreachable for a non-fault reason: during live migration (guest paused\non one pod while memory is transferred) and whenever the VM is paused\nfor an intentional or transient reason such as a user pause, snapshot,\nsave, or dump. Failures are not suppressed when the VM is paused due to\na fault (IO error, crash, or postcopy failure).\n+optional",
"httpGet": "HTTPGet specifies the http request to perform.\n+optional",
"tcpSocket": "TCPSocket specifies an action involving a TCP port.\nTCP hooks not yet supported\n+optional",
}
@@ -622,7 +632,7 @@ func (KubeVirtSpec) SwaggerDoc() map[string]string {
return map[string]string{
"imageTag": "The image tag to use for the continer images installed.\nDefaults to the same tag as the operator's container image.",
"imageRegistry": "The image registry to pull the container images from\nDefaults to the same registry the operator's container image is pulled from.",
"imagePullPolicy": "The ImagePullPolicy to use.",
"imagePullPolicy": "The ImagePullPolicy to use for KubeVirt operator-managed infrastructure\nimages (virt-api, virt-controller, virt-handler, virt-exportproxy, etc.).\nFor pull policy of user workload pods, see\nspec.configuration.imagePullPolicy.",
"imagePullSecrets": "The imagePullSecrets to pull the container images from\nDefaults to none\n+listType=atomic",
"monitorNamespace": "The namespace Prometheus is deployed in\nDefaults to openshift-monitor",
"serviceMonitorNamespace": "The namespace the service monitor will be deployed\n When ServiceMonitorNamespace is set, then we'll install the service monitor object in that namespace\notherwise we will use the monitoring namespace.",
@@ -871,6 +881,7 @@ func (KubeVirtConfiguration) SwaggerDoc() map[string]string {
return map[string]string{
"": "KubeVirtConfiguration holds all kubevirt configurations",
"emulatedMachines": "Deprecated. Use architectureConfiguration instead.",
"imagePullPolicy": "The ImagePullPolicy to use for user workload pods and their containers\n(launcher pods, exporter pods, etc.).\nFor KubeVirt infrastructure images, use spec.imagePullPolicy instead.",
"machineType": "Deprecated. Use architectureConfiguration instead.",
"ovmfPath": "Deprecated. Use architectureConfiguration instead.",
"evictionStrategy": "EvictionStrategy defines at the cluster level if the VirtualMachineInstance should be\nmigrated instead of shut-off in case of a node drain. If the VirtualMachineInstance specific\nfield is set it overrides the cluster level one.",
@@ -888,7 +899,27 @@ func (KubeVirtConfiguration) SwaggerDoc() map[string]string {
"instancetype": "Instancetype configuration\n+nullable",
"hypervisors": "Hypervisors holds information regarding the hypervisor configurations supported on this cluster.\n+listType=atomic\n+kubebuilder:validation:MaxItems:=1",
"changedBlockTrackingLabelSelectors": "ChangedBlockTrackingLabelSelectors defines label selectors. VMs matching these selectors will have changed block tracking enabled.\nEnabling changedBlockTracking is mandatory for performing storage-agnostic backups and incremental backups.\n+nullable",
"roleAggregationStrategy": "RoleAggregationStrategy controls whether RBAC cluster roles should be aggregated\nto the default Kubernetes roles (admin, edit, view).\nWhen set to \"AggregateToDefault\" (default) or not specified, the aggregate-to-* labels are added to the cluster roles.\nWhen set to \"Manual\", the labels are not added, and roles will not be aggregated to the default roles.\nSetting this field to \"Manual\" requires the OptOutRoleAggregation feature gate to be enabled.\nThis is an Alpha feature and subject to change.\n+optional\n+kubebuilder:validation:Enum=AggregateToDefault;Manual",
"persistentReservationConfiguration": "PersistentReservationConfiguration controls the deployment of additional resources required for using SCSI persistent reservation in VMs\n+nullable",
"confidentialCompute": "QGS configuration for attestation on the Intel TDX Platform\n+nullable",
"roleAggregationStrategy": "RoleAggregationStrategy controls whether RBAC cluster roles should be aggregated\nto the default Kubernetes roles (admin, edit, view).\nWhen set to \"AggregateToDefault\" (default) or not specified, the aggregate-to-* labels are added to the cluster roles.\nWhen set to \"Manual\", the labels are not added, and roles will not be aggregated to the default roles.\nSetting RoleAggregationStrategy to \"Manual\" requires the OptOutRoleAggregation feature gate\nto be enabled (Beta, enabled by default since v1.9.0).\n+optional\n+kubebuilder:validation:Enum=AggregateToDefault;Manual",
}
}
func (TDXAttestationConfiguration) SwaggerDoc() map[string]string {
return map[string]string{
"": "QGSConfiguration holds QGS configuration",
"enforced": "Indicates whether TDX VM should enforce the existence of QGS (required for attestation) to be scheduled\n+kubebuilder:default=false",
"qgsSocketPath": "Socket path pointing to the Quote Generation Service\n+kubebuilder:default=/var/run/tdx-qgs/qgs.socket",
}
}
func (TDXConfiguration) SwaggerDoc() map[string]string {
return map[string]string{}
}
func (ConfidentialComputeConfiguration) SwaggerDoc() map[string]string {
return map[string]string{
"tdx": "TDX configuration for attestation on the Intel TDX Platform\n+nullable",
}
}
@@ -987,6 +1018,49 @@ func (TLSConfiguration) SwaggerDoc() map[string]string {
}
}
func (StallDetectorOptions) SwaggerDoc() map[string]string {
return map[string]string{
"stallMargin": "StallMargin is the fractional tolerance, expressed as a percentage, used when\ncomparing remaining migration bytes against the best observed value to detect stalls\nand local minima. A stall is reported when remaining bytes stay above\n(1 - StallMargin/100) of the outside-window minimum.\nDefaults to 4.\n+kubebuilder:validation:Minimum=0\n+kubebuilder:validation:Maximum=100\n+optional",
"ewmaAlpha": "EwmaAlpha is the smoothing factor for the exponentially weighted moving average of\nobserved migration bandwidth. Must be in the range (0, 1]; zero is invalid because\nthe estimate would never incorporate new samples. Higher values weight recent samples\nmore heavily.\nDefaults to \"0.4\".\n+optional",
"stallProgressTimeout": "StallProgressTimeout is the duration in seconds of the sliding window used to track\nminimum remaining-bytes and detect when migration progress has stalled.\nDefaults to 40.\n+optional",
"switchoverTimeout": "SwitchoverTimeout is the duration in seconds allowed for a stop-and-copy or post-copy\nswitchover to complete after being triggered before the migration is aborted.\nDefaults to 60.\n+optional",
"precopyPossibleFactor": "PrecopyPossibleFactor is the maximum factor by which estimated downtime may exceed\nMaxDowntime while still attempting a soft stop-and-copy instead of aborting the migration.\nDefaults to \"1.5\".\n+optional",
"patienceWindowDecayFactor": "PatienceWindowDecayFactor is the factor by which the relaxation patience window is\nmultiplied after each best-remaining-bytes relaxation step.\nDefaults to \"0.5\".\n+optional",
"searchLocalMinima": "SearchLocalMinima controls whether convergence actions are delayed until remaining bytes\nreach a local minimum near the best observed value. When false, actions may trigger\nas soon as a stall is detected.\nDefaults to true.\n+optional",
"completionTimeoutFactor": "CompletionTimeoutFactor multiplies the computed migration completion timeout to determine\nthe total time budget for deciding whether a forced switchover can still finish in time,\nand to extend the abort deadline after initiating a completion-timeout-driven switchover.\nDefaults to \"2\".\n+optional",
}
}
func (ExperimentalMigrationOptions) SwaggerDoc() map[string]string {
return map[string]string{
"": "ExperimentalMigrationOptions is an alpha API for experimental migration tunables.\nIt is intended for experimental purposes only and will be removed in the future.",
"stallDetector": "+optional",
"compression": "Compression selects the algorithm for compressing the live migration\ndata stream. When omitted (nil) or set to \"none\", compression is\ndisabled.\n+kubebuilder:validation:Enum=none;zstd\n+optional",
}
}
func (VMIMConfigurationOptions) SwaggerDoc() map[string]string {
return map[string]string{
"": "VMIMConfigurationOptions holds the resolved migration options for a single migration.\nIt is written to VirtualMachineInstanceMigrationState and represents the effective\nconfiguration after merging KubeVirt defaults with any matched MigrationPolicy.",
"nodeDrainTaintKey": "NodeDrainTaintKey defines the taint key that indicates a node should be drained.\nNote: this option relies on the deprecated node taint feature. Default: kubevirt.io/drain",
"parallelOutboundMigrationsPerNode": "ParallelOutboundMigrationsPerNode is the maximum number of concurrent outgoing live migrations\nallowed per node. Defaults to 2",
"parallelMigrationsPerCluster": "ParallelMigrationsPerCluster is the total number of concurrent live migrations\nallowed cluster-wide. Defaults to 5",
"allowAutoConverge": "AllowAutoConverge allows the platform to compromise performance/availability of VMIs to\nguarantee successful VMI live migrations. Defaults to false",
"bandwidthPerMigration": "BandwidthPerMigration limits the amount of network bandwidth live migrations are allowed to use.\nThe value is in quantity per second. Defaults to 0 (no limit)",
"completionTimeoutPerGiB": "CompletionTimeoutPerGiB is the maximum number of seconds per GiB a migration is allowed to take.\nIf the timeout is reached, the migration will be either paused, switched\nto post-copy or cancelled depending on other settings. Defaults to 150",
"maxDowntimeMs": "MaxDowntimeMs specifies the maximum tolerable downtime (in milliseconds) during switchover.\nDefaults to 900\n+kubebuilder:validation:Minimum=1\n+kubebuilder:validation:Maximum=2000000",
"progressTimeout": "ProgressTimeout is the maximum number of seconds a live migration is allowed to make no progress.\nHitting this timeout means a migration transferred 0 data for that many seconds. The migration is\nthen considered stuck and therefore cancelled. Defaults to 150",
"utilityVolumesTimeout": "UtilityVolumesTimeout is the maximum number of seconds a migration can wait in Pending state\nfor utility volumes to be detached. If utility volumes are still present after this timeout,\nthe migration will be marked as Failed. Defaults to 150",
"unsafeMigrationOverride": "UnsafeMigrationOverride allows live migrations to occur even if the compatibility check\nindicates the migration will be unsafe to the guest. Defaults to false",
"allowPostCopy": "AllowPostCopy enables post-copy live migrations. Such migrations allow even the busiest VMIs\nto successfully live-migrate. However, events like a network failure can cause a VMI crash.\nIf set to true, migrations will still start in pre-copy, but switch to post-copy when\nCompletionTimeoutPerGiB triggers. Defaults to false",
"allowWorkloadDisruption": "AllowWorkloadDisruption indicates that the migration shouldn't be\ncanceled after acceptableCompletionTime is exceeded. Instead, if\npermitted, migration will be switched to post-copy or the VMI will be\npaused to allow the migration to complete",
"disableTLS": "When set to true, DisableTLS will disable the additional layer of live migration encryption\nprovided by KubeVirt. This is usually a bad idea. Defaults to false",
"network": "Network is the name of the CNI network to use for live migrations. By default, migrations go\nthrough the pod network.",
"matchSELinuxLevelOnMigration": "By default, the SELinux level of target virt-launcher pods is forced to the level of the source virt-launcher.\nWhen set to true, MatchSELinuxLevelOnMigration lets the CRI auto-assign a random level to the target.\nThat will ensure the target virt-launcher doesn't share categories with another pod on the node.\nHowever, migrations will fail when using RWX volumes that don't automatically deal with SELinux levels.",
"experimental": "ExperimentalMigrationOptions is an alpha API. It is intended for experimental\npurposes only and will be removed in the future.",
}
}
func (MigrationConfiguration) SwaggerDoc() map[string]string {
return map[string]string{
"": "MigrationConfiguration holds migration options.\nCan be overridden for specific groups of VMs though migration policies.\nVisit https://kubevirt.io/user-guide/operations/migration_policies/ for more information.",
@@ -996,6 +1070,7 @@ func (MigrationConfiguration) SwaggerDoc() map[string]string {
"allowAutoConverge": "AllowAutoConverge allows the platform to compromise performance/availability of VMIs to\nguarantee successful VMI live migrations. Defaults to false",
"bandwidthPerMigration": "BandwidthPerMigration limits the amount of network bandwidth live migrations are allowed to use.\nThe value is in quantity per second. Defaults to 0 (no limit)",
"completionTimeoutPerGiB": "CompletionTimeoutPerGiB is the maximum number of seconds per GiB a migration is allowed to take.\nIf the timeout is reached, the migration will be either paused, switched\nto post-copy or cancelled depending on other settings. Defaults to 150",
"maxDowntimeMs": "MaxDowntimeMs specifies the maximum tolerable downtime (in milliseconds) during switchover.\nDefaults to 900\n+kubebuilder:validation:Minimum=1\n+kubebuilder:validation:Maximum=2000000",
"progressTimeout": "ProgressTimeout is the maximum number of seconds a live migration is allowed to make no progress.\nHitting this timeout means a migration transferred 0 data for that many seconds. The migration is\nthen considered stuck and therefore cancelled. Defaults to 150",
"utilityVolumesTimeout": "UtilityVolumesTimeout is the maximum number of seconds a migration can wait in Pending state\nfor utility volumes to be detached. If utility volumes are still present after this timeout,\nthe migration will be marked as Failed. Defaults to 150",
"unsafeMigrationOverride": "UnsafeMigrationOverride allows live migrations to occur even if the compatibility check\nindicates the migration will be unsafe to the guest. Defaults to false",
@@ -1229,3 +1304,9 @@ func (ObjectGraphOptions) SwaggerDoc() map[string]string {
"labelSelector": "LabelSelector is used to filter nodes in the graph based on their labels.",
}
}
func (PersistentReservationConfiguration) SwaggerDoc() map[string]string {
return map[string]string{
"enabled": "Enabled controls the deployment of additional resources like the pr-helper container\nfor enabling the use of the SCSI persistent reservation VMs, defaults to False.\n+nullable",
}
}
@@ -21,10 +21,10 @@ Copyright The KubeVirt Authors.
// Code generated by deepcopy-gen. DO NOT EDIT.
package v1alpha1
package v1
import (
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
)
@@ -78,6 +78,43 @@ func (in *VirtualMachineExport) DeepCopyObject() runtime.Object {
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *VirtualMachineExportBackup) DeepCopyInto(out *VirtualMachineExportBackup) {
*out = *in
if in.Endpoints != nil {
in, out := &in.Endpoints, &out.Endpoints
*out = make([]VirtualMachineExportBackupEndpoint, len(*in))
copy(*out, *in)
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineExportBackup.
func (in *VirtualMachineExportBackup) DeepCopy() *VirtualMachineExportBackup {
if in == nil {
return nil
}
out := new(VirtualMachineExportBackup)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *VirtualMachineExportBackupEndpoint) DeepCopyInto(out *VirtualMachineExportBackupEndpoint) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineExportBackupEndpoint.
func (in *VirtualMachineExportBackupEndpoint) DeepCopy() *VirtualMachineExportBackupEndpoint {
if in == nil {
return nil
}
out := new(VirtualMachineExportBackupEndpoint)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *VirtualMachineExportLink) DeepCopyInto(out *VirtualMachineExportLink) {
*out = *in
@@ -88,6 +125,13 @@ func (in *VirtualMachineExportLink) DeepCopyInto(out *VirtualMachineExportLink)
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.Backups != nil {
in, out := &in.Backups, &out.Backups
*out = make([]VirtualMachineExportBackup, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.Manifests != nil {
in, out := &in.Manifests, &out.Manifests
*out = make([]VirtualMachineExportManifest, len(*in))
@@ -192,7 +236,7 @@ func (in *VirtualMachineExportSpec) DeepCopyInto(out *VirtualMachineExportSpec)
}
if in.TTLDuration != nil {
in, out := &in.TTLDuration, &out.TTLDuration
*out = new(v1.Duration)
*out = new(metav1.Duration)
**out = **in
}
return
@@ -21,4 +21,4 @@
// +groupName=export.kubevirt.io
// +k8s:openapi-gen=true
package v1alpha1
package v1
@@ -13,11 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Copyright 2022 Red Hat, Inc.
* Copyright The KubeVirt Authors.
*
*/
package v1alpha1
package v1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -28,7 +28,7 @@ import (
)
// SchemeGroupVersion is group version used to register these objects
var SchemeGroupVersion = schema.GroupVersion{Group: export.GroupName, Version: "v1alpha1"}
var SchemeGroupVersion = schema.GroupVersion{Group: export.GroupName, Version: "v1"}
// Kind takes an unqualified kind and returns back a Group qualified GroupKind
func Kind(kind string) schema.GroupKind {
@@ -13,11 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Copyright 2022 Red Hat, Inc.
* Copyright The KubeVirt Authors.
*
*/
package v1alpha1
package v1
import (
"time"
@@ -134,6 +134,12 @@ type VirtualMachineExportLink struct {
// +optional
Volumes []VirtualMachineExportVolume `json:"volumes,omitempty"`
// Backups is a list of available backups for the export
// +listType=map
// +listMapKey=name
// +optional
Backups []VirtualMachineExportBackup `json:"backups,omitempty"`
// Manifests is a list of available manifests for the export
// +listType=map
// +listMapKey=type
@@ -157,6 +163,8 @@ const (
AllManifests ExportManifestType = "all"
// AuthHeader returns a CDI compatible secret containing the token as an Auth header
AuthHeader ExportManifestType = "auth-header-secret"
// OCI returns the OCI image layout TAR archive
OCI ExportManifestType = "oci"
)
// VirtualMachineExportVolume contains the name and available formats for the exported volume
@@ -190,6 +198,33 @@ type VirtualMachineExportVolumeFormat struct {
Url string `json:"url"`
}
// VirtualMachineExportBackup contains the name and available endpoints for the exported backup
type VirtualMachineExportBackup struct {
// Name is the name of the exported volume
Name string `json:"name"`
// +listType=map
// +listMapKey=endpoint
// +optional
Endpoints []VirtualMachineExportBackupEndpoint `json:"endpoints,omitempty"`
}
type ExportBackupEndpoint string
const (
// Map is the bitmap endpoint of the backup
Map ExportBackupEndpoint = "map"
// Data is the read endpoint of the backup
Data ExportBackupEndpoint = "data"
)
// VirtualMachineExportBackupEndpoint contains the endpoint type and URL to interact with a backup export
type VirtualMachineExportBackupEndpoint struct {
// Endpoint is the endpoint of the backup export at the specified URL
Endpoint ExportBackupEndpoint `json:"endpoint"`
// Url is the url that contains the volume in the format specified
Url string `json:"url"`
}
// ConditionType is the const type for Conditions
type ConditionType string
@@ -200,6 +235,8 @@ const (
ConditionPVC ConditionType = "PVCReady"
// ConditionVolumesCreated is the condition to see if volumes are created from volume snapshots
ConditionVolumesCreated ConditionType = "VolumesCreated"
// ConditionOCIReady indicates whether the OCI artifact export is ready
ConditionOCIReady ConditionType = "OCIReady"
)
// Condition defines conditions
@@ -1,6 +1,6 @@
// Code generated by swagger-doc. DO NOT EDIT.
package v1alpha1
package v1
func (VirtualMachineExport) SwaggerDoc() map[string]string {
return map[string]string{
@@ -50,6 +50,7 @@ func (VirtualMachineExportLink) SwaggerDoc() map[string]string {
"": "VirtualMachineExportLink contains a list of volumes available for export, as well as the URLs to obtain these volumes",
"cert": "Cert is the public CA certificate base64 encoded",
"volumes": "Volumes is a list of available volumes to export\n+listType=map\n+listMapKey=name\n+optional",
"backups": "Backups is a list of available backups for the export\n+listType=map\n+listMapKey=name\n+optional",
"manifests": "Manifests is a list of available manifests for the export\n+listType=map\n+listMapKey=type\n+optional",
}
}
@@ -78,6 +79,22 @@ func (VirtualMachineExportVolumeFormat) SwaggerDoc() map[string]string {
}
}
func (VirtualMachineExportBackup) SwaggerDoc() map[string]string {
return map[string]string{
"": "VirtualMachineExportBackup contains the name and available endpoints for the exported backup",
"name": "Name is the name of the exported volume",
"endpoints": "+listType=map\n+listMapKey=endpoint\n+optional",
}
}
func (VirtualMachineExportBackupEndpoint) SwaggerDoc() map[string]string {
return map[string]string{
"": "VirtualMachineExportBackupEndpoint contains the endpoint type and URL to interact with a backup export",
"endpoint": "Endpoint is the endpoint of the backup export at the specified URL",
"url": "Url is the url that contains the volume in the format specified",
}
}
func (Condition) SwaggerDoc() map[string]string {
return map[string]string{
"": "Condition defines conditions",
+10
View File
@@ -230,6 +230,11 @@ func (in *DevicePreferences) DeepCopyInto(out *DevicePreferences) {
*out = new(v1.PanicDeviceModel)
**out = **in
}
if in.PreferredVideoType != nil {
in, out := &in.PreferredVideoType, &out.PreferredVideoType
*out = new(string)
**out = **in
}
return
}
@@ -813,6 +818,11 @@ func (in *VirtualMachinePreferenceSpec) DeepCopyInto(out *VirtualMachinePreferen
*out = new(string)
**out = **in
}
if in.PreferredLaunchSecurity != nil {
in, out := &in.PreferredLaunchSecurity, &out.PreferredLaunchSecurity
*out = new(v1.LaunchSecurity)
(*in).DeepCopyInto(*out)
}
return
}
+11
View File
@@ -119,6 +119,7 @@ type VirtualMachineInstancetypeSpec struct {
// Optionally defines the LaunchSecurity to be used by the instancetype.
//
// +optional
// Deprecated: Will be removed with v1beta2 or v1
LaunchSecurity *v1.LaunchSecurity `json:"launchSecurity,omitempty"`
// Optionally defines the required Annotations to be used by the instance type and applied to the VirtualMachineInstance
@@ -307,6 +308,11 @@ type VirtualMachinePreferenceSpec struct {
//
//+optional
PreferredArchitecture *string `json:"preferredArchitecture,omitempty"`
// Optionally defines the preferred LaunchSecurity
//
// +optional
PreferredLaunchSecurity *v1.LaunchSecurity `json:"preferredLaunchSecurity,omitempty"`
}
type VolumePreferences struct {
@@ -533,6 +539,11 @@ type DevicePreferences struct {
//
// +optional
PreferredPanicDeviceModel *v1.PanicDeviceModel `json:"preferredPanicDeviceModel,omitempty"`
// PreferredVideoType optionally defines the preferred type for Video devices.
//
// +optional
PreferredVideoType *string `json:"preferredVideoType,omitempty"`
}
// FeaturePreferences contains various optional defaults for Features.
+3 -1
View File
@@ -39,7 +39,7 @@ func (VirtualMachineInstancetypeSpec) SwaggerDoc() map[string]string {
"hostDevices": "Optionally defines any HostDevices associated with the instancetype.\n\n+optional\n+listType=atomic",
"ioThreadsPolicy": "Optionally defines the IOThreadsPolicy to be used by the instancetype.\n\n+optional",
"ioThreads": "Optionally specifies the IOThreads options to be used by the instancetype.\n+optional",
"launchSecurity": "Optionally defines the LaunchSecurity to be used by the instancetype.\n\n+optional",
"launchSecurity": "Optionally defines the LaunchSecurity to be used by the instancetype.\n\n+optional\nDeprecated: Will be removed with v1beta2 or v1",
"annotations": "Optionally defines the required Annotations to be used by the instance type and applied to the VirtualMachineInstance\n\n+optional",
}
}
@@ -111,6 +111,7 @@ func (VirtualMachinePreferenceSpec) SwaggerDoc() map[string]string {
"annotations": "Optionally defines preferred Annotations to be applied to the VirtualMachineInstance\n\n+optional",
"preferSpreadSocketToCoreRatio": "PreferSpreadSocketToCoreRatio defines the ratio to spread vCPUs between cores and sockets, it defaults to 2.\n\n+optional",
"preferredArchitecture": "PreferredArchitecture defines a prefeerred architecture for the VirtualMachine\n\n+optional",
"preferredLaunchSecurity": "Optionally defines the preferred LaunchSecurity\n\n+optional",
}
}
@@ -164,6 +165,7 @@ func (DevicePreferences) SwaggerDoc() map[string]string {
"preferredTPM": "PreferredTPM optionally defines the preferred TPM device to be used.\n\n+optional",
"preferredInterfaceMasquerade": "PreferredInterfaceMasquerade optionally defines the preferred masquerade configuration to use with each network interface.\n\n+optional",
"preferredPanicDeviceModel": "PreferredPanicDeviceModel optionally defines the preferred panic device model to use with panic devices.\n\n+optional",
"preferredVideoType": "PreferredVideoType optionally defines the preferred type for Video devices.\n\n+optional",
}
}
+11
View File
@@ -25,6 +25,7 @@ package v1alpha1
import (
runtime "k8s.io/apimachinery/pkg/runtime"
v1 "kubevirt.io/api/core/v1"
)
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
@@ -133,6 +134,11 @@ func (in *MigrationPolicySpec) DeepCopyInto(out *MigrationPolicySpec) {
*out = new(int64)
**out = **in
}
if in.MaxDowntimeMs != nil {
in, out := &in.MaxDowntimeMs, &out.MaxDowntimeMs
*out = new(uint64)
**out = **in
}
if in.AllowPostCopy != nil {
in, out := &in.AllowPostCopy, &out.AllowPostCopy
*out = new(bool)
@@ -143,6 +149,11 @@ func (in *MigrationPolicySpec) DeepCopyInto(out *MigrationPolicySpec) {
*out = new(bool)
**out = **in
}
if in.ExperimentalMigrationOptions != nil {
in, out := &in.ExperimentalMigrationOptions, &out.ExperimentalMigrationOptions
*out = new(v1.ExperimentalMigrationOptions)
(*in).DeepCopyInto(*out)
}
return
}
+8 -35
View File
@@ -50,9 +50,17 @@ type MigrationPolicySpec struct {
//+optional
CompletionTimeoutPerGiB *int64 `json:"completionTimeoutPerGiB,omitempty"`
//+optional
//+kubebuilder:validation:Minimum=1
//+kubebuilder:validation:Maximum=2000000
MaxDowntimeMs *uint64 `json:"maxDowntimeMs,omitempty"`
//+optional
AllowPostCopy *bool `json:"allowPostCopy,omitempty"`
//+optional
AllowWorkloadDisruption *bool `json:"allowWorkloadDisruption,omitempty"`
// ExperimentalMigrationOptions is an alpha API. It is intended for experimental
// purposes only and will be removed in the future.
//+optional
ExperimentalMigrationOptions *k6tv1.ExperimentalMigrationOptions `json:"experimental,omitempty"`
}
type LabelSelector map[string]string
@@ -77,38 +85,3 @@ type MigrationPolicyList struct {
// +listType=atomic
Items []MigrationPolicy `json:"items"`
}
// GetMigrationConfByPolicy returns a new migration configuration. The new configuration attributes will be overridden
// by the migration policy if the specified attributes were defined for this policy. Otherwise they wouldn't change.
// The boolean returned value indicates if any changes were made to the configurations.
func (m *MigrationPolicy) GetMigrationConfByPolicy(clusterMigrationConfigurations *k6tv1.MigrationConfiguration) (changed bool, err error) {
policySpec := m.Spec
changed = false
if policySpec.AllowAutoConverge != nil {
changed = true
*clusterMigrationConfigurations.AllowAutoConverge = *policySpec.AllowAutoConverge
}
if policySpec.BandwidthPerMigration != nil {
changed = true
*clusterMigrationConfigurations.BandwidthPerMigration = *policySpec.BandwidthPerMigration
}
if policySpec.CompletionTimeoutPerGiB != nil {
changed = true
*clusterMigrationConfigurations.CompletionTimeoutPerGiB = *policySpec.CompletionTimeoutPerGiB
}
if policySpec.AllowPostCopy != nil {
changed = true
*clusterMigrationConfigurations.AllowPostCopy = *policySpec.AllowPostCopy
}
if policySpec.AllowWorkloadDisruption != nil {
changed = true
*clusterMigrationConfigurations.AllowWorkloadDisruption = *policySpec.AllowWorkloadDisruption
} else if policySpec.AllowWorkloadDisruption == nil && policySpec.AllowPostCopy != nil {
// For backward compatibility, AllowWorkloadDisruption will follow the
// value of AllowPostCopy, if not explicitly set
*clusterMigrationConfigurations.AllowWorkloadDisruption = *policySpec.AllowPostCopy
}
return changed, nil
}
@@ -14,8 +14,10 @@ func (MigrationPolicySpec) SwaggerDoc() map[string]string {
"allowAutoConverge": "+optional",
"bandwidthPerMigration": "+optional",
"completionTimeoutPerGiB": "+optional",
"maxDowntimeMs": "+optional\n+kubebuilder:validation:Minimum=1\n+kubebuilder:validation:Maximum=2000000",
"allowPostCopy": "+optional",
"allowWorkloadDisruption": "+optional",
"experimental": "ExperimentalMigrationOptions is an alpha API. It is intended for experimental\npurposes only and will be removed in the future.\n+optional",
}
}
+33
View File
@@ -0,0 +1,33 @@
/*
* 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 The KubeVirt Authors.
*
*/
package plugin
const (
GroupName = "plugin.kubevirt.io"
LatestVersion = "v1alpha1"
Kind = "Plugin"
ListKind = "PluginList"
ResourcePluginSingular = "plugin"
ResourcePluginPlural = "plugins"
)
var (
ApiSupportedWebhookVersions = []string{LatestVersion}
)
+261
View File
@@ -0,0 +1,261 @@
//go:build !ignore_autogenerated
// +build !ignore_autogenerated
/*
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 The KubeVirt Authors.
*/
// Code generated by deepcopy-gen. DO NOT EDIT.
package v1alpha1
import (
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
)
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AdmissionReference) DeepCopyInto(out *AdmissionReference) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AdmissionReference.
func (in *AdmissionReference) DeepCopy() *AdmissionReference {
if in == nil {
return nil
}
out := new(AdmissionReference)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *CELDomainHook) DeepCopyInto(out *CELDomainHook) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CELDomainHook.
func (in *CELDomainHook) DeepCopy() *CELDomainHook {
if in == nil {
return nil
}
out := new(CELDomainHook)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *DomainHook) DeepCopyInto(out *DomainHook) {
*out = *in
if in.CEL != nil {
in, out := &in.CEL, &out.CEL
*out = new(CELDomainHook)
**out = **in
}
if in.Sidecar != nil {
in, out := &in.Sidecar, &out.Sidecar
*out = new(SidecarDomainHook)
**out = **in
}
if in.Timeout != nil {
in, out := &in.Timeout, &out.Timeout
*out = new(v1.Duration)
**out = **in
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DomainHook.
func (in *DomainHook) DeepCopy() *DomainHook {
if in == nil {
return nil
}
out := new(DomainHook)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *NodeHook) DeepCopyInto(out *NodeHook) {
*out = *in
if in.PermittedHooks != nil {
in, out := &in.PermittedHooks, &out.PermittedHooks
*out = make([]NodeHookPoint, len(*in))
copy(*out, *in)
}
if in.Timeout != nil {
in, out := &in.Timeout, &out.Timeout
*out = new(v1.Duration)
**out = **in
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeHook.
func (in *NodeHook) DeepCopy() *NodeHook {
if in == nil {
return nil
}
out := new(NodeHook)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Plugin) DeepCopyInto(out *Plugin) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
out.Status = in.Status
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Plugin.
func (in *Plugin) DeepCopy() *Plugin {
if in == nil {
return nil
}
out := new(Plugin)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *Plugin) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PluginList) DeepCopyInto(out *PluginList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]Plugin, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PluginList.
func (in *PluginList) DeepCopy() *PluginList {
if in == nil {
return nil
}
out := new(PluginList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *PluginList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PluginSpec) DeepCopyInto(out *PluginSpec) {
*out = *in
if in.DomainHooks != nil {
in, out := &in.DomainHooks, &out.DomainHooks
*out = make([]DomainHook, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.NodeHooks != nil {
in, out := &in.NodeHooks, &out.NodeHooks
*out = make([]NodeHook, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.MutatingAdmissionPolicies != nil {
in, out := &in.MutatingAdmissionPolicies, &out.MutatingAdmissionPolicies
*out = make([]AdmissionReference, len(*in))
copy(*out, *in)
}
if in.ValidatingAdmissionPolicies != nil {
in, out := &in.ValidatingAdmissionPolicies, &out.ValidatingAdmissionPolicies
*out = make([]AdmissionReference, len(*in))
copy(*out, *in)
}
if in.MutatingAdmissionWebhooks != nil {
in, out := &in.MutatingAdmissionWebhooks, &out.MutatingAdmissionWebhooks
*out = make([]AdmissionReference, len(*in))
copy(*out, *in)
}
if in.ValidatingAdmissionWebhooks != nil {
in, out := &in.ValidatingAdmissionWebhooks, &out.ValidatingAdmissionWebhooks
*out = make([]AdmissionReference, len(*in))
copy(*out, *in)
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PluginSpec.
func (in *PluginSpec) DeepCopy() *PluginSpec {
if in == nil {
return nil
}
out := new(PluginSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PluginStatus) DeepCopyInto(out *PluginStatus) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PluginStatus.
func (in *PluginStatus) DeepCopy() *PluginStatus {
if in == nil {
return nil
}
out := new(PluginStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *SidecarDomainHook) DeepCopyInto(out *SidecarDomainHook) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SidecarDomainHook.
func (in *SidecarDomainHook) DeepCopy() *SidecarDomainHook {
if in == nil {
return nil
}
out := new(SidecarDomainHook)
in.DeepCopyInto(out)
return out
}
+24
View File
@@ -0,0 +1,24 @@
/*
* 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 The KubeVirt Authors.
*
*/
// +k8s:deepcopy-gen=package
// +groupName=plugin.kubevirt.io
// +k8s:openapi-gen=true
package v1alpha1
+57
View File
@@ -0,0 +1,57 @@
/*
* 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 The KubeVirt Authors.
*
*/
package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"kubevirt.io/api/plugin"
)
var SchemeGroupVersion = schema.GroupVersion{Group: plugin.GroupName, Version: "v1alpha1"}
var (
PluginGroupVersionKind = schema.GroupVersionKind{Group: plugin.GroupName, Version: SchemeGroupVersion.Version, Kind: plugin.Kind}
PluginListGroupVersionKind = schema.GroupVersionKind{Group: plugin.GroupName, Version: SchemeGroupVersion.Version, Kind: plugin.ListKind}
)
func Kind(kind string) schema.GroupKind {
return SchemeGroupVersion.WithKind(kind).GroupKind()
}
func Resource(resource string) schema.GroupResource {
return SchemeGroupVersion.WithResource(resource).GroupResource()
}
var (
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
AddToScheme = SchemeBuilder.AddToScheme
)
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&Plugin{},
&PluginList{},
)
metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
return nil
}
+192
View File
@@ -0,0 +1,192 @@
/*
* 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 The KubeVirt Authors.
*
*/
package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +k8s:openapi-gen=true
// +genclient
// +genclient:nonNamespaced
// Plugin defines a KubeVirt extension that can modify VM domain XML,
// hook into VM lifecycle events, and reference admission objects.
type Plugin struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
// Spec defines the plugin's hooks and admission references.
Spec PluginSpec `json:"spec"`
// Status reflects the observed state of the plugin.
// +optional
Status PluginStatus `json:"status,omitempty"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type PluginList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
// +listType=atomic
Items []Plugin `json:"items"`
}
type PluginSpec struct {
// Condition is a CEL expression that determines whether this plugin applies to a given VM.
// When set, this acts as a baseline filter for all hooks in the plugin.
// Individual hooks may further narrow the scope with their own Condition fields.
// +optional
Condition string `json:"condition,omitempty"`
// FailureStrategy specifies the default behavior when the plugin itself is unhealthy
// (e.g. a referenced webhook is not ready, or a sidecar socket is unreachable).
// Individual hooks may override this with their own FailureStrategy.
// +optional
FailureStrategy FailureStrategy `json:"failureStrategy,omitempty"`
// DomainHooks defines hooks that modify the libvirt domain XML.
// Hooks are applied in declaration order within each plugin.
// Across plugins, hooks are applied in alphabetical order by plugin name.
// +optional
// +listType=atomic
DomainHooks []DomainHook `json:"domainHooks,omitempty"`
// NodeHooks defines hooks that execute during VM lifecycle events.
// Hooks are applied in declaration order within each plugin.
// Across plugins, hooks are applied in alphabetical order by plugin name.
// +optional
// +listType=atomic
NodeHooks []NodeHook `json:"nodeHooks,omitempty"`
// MutatingAdmissionPolicies references MutatingAdmissionPolicy objects managed by the plugin.
// +optional
// +listType=atomic
MutatingAdmissionPolicies []AdmissionReference `json:"mutatingAdmissionPolicies,omitempty"`
// ValidatingAdmissionPolicies references ValidatingAdmissionPolicy objects managed by the plugin.
// +optional
// +listType=atomic
ValidatingAdmissionPolicies []AdmissionReference `json:"validatingAdmissionPolicies,omitempty"`
// MutatingAdmissionWebhooks references MutatingWebhookConfiguration objects managed by the plugin.
// +optional
// +listType=atomic
MutatingAdmissionWebhooks []AdmissionReference `json:"mutatingAdmissionWebhooks,omitempty"`
// ValidatingAdmissionWebhooks references ValidatingWebhookConfiguration objects managed by the plugin.
// +optional
// +listType=atomic
ValidatingAdmissionWebhooks []AdmissionReference `json:"validatingAdmissionWebhooks,omitempty"`
}
// FailureStrategy specifies how hook failures are handled. Defaults to Fail if not specified.
// +enum
type FailureStrategy string
const (
FailureStrategyFail FailureStrategy = "Fail"
FailureStrategyIgnore FailureStrategy = "Ignore"
)
// InvocationContext identifies why a domain hook is being invoked.
// +enum
type InvocationContext string
const (
InvocationContextBoot InvocationContext = "Boot"
InvocationContextMigrationSource InvocationContext = "MigrationSource"
InvocationContextMigrationTarget InvocationContext = "MigrationTarget"
)
// DomainHook defines a hook that modifies the libvirt domain XML.
// Exactly one of cel or sidecar must be specified.
type DomainHook struct {
// CEL defines a CEL expression that transforms the domain XML.
// +optional
CEL *CELDomainHook `json:"cel,omitempty"`
// Sidecar defines a sidecar-based hook that transforms the domain XML via a Unix socket.
// +optional
Sidecar *SidecarDomainHook `json:"sidecar,omitempty"`
// Condition is a CEL expression that determines whether this hook applies to a given VM.
// +optional
Condition string `json:"condition,omitempty"`
// FailureStrategy specifies how to handle hook failures (Fail or Ignore).
// +optional
FailureStrategy FailureStrategy `json:"failureStrategy,omitempty"`
// Timeout specifies the maximum duration to wait for the hook to complete.
// +optional
Timeout *metav1.Duration `json:"timeout,omitempty"`
}
type CELDomainHook struct {
// Expression is the CEL expression applied to the domain XML.
// +kubebuilder:validation:MinLength=1
Expression string `json:"expression"`
}
type SidecarDomainHook struct {
// SocketPath is the path to the Unix socket used to communicate with the sidecar.
// +kubebuilder:validation:MinLength=1
SocketPath string `json:"socketPath"`
}
// NodeHook defines a hook that runs an executable on the hosting node during VM lifecycle events.
// Unlike DomainHooks which modify the libvirt domain XML, NodeHooks perform node-level operations
// such as configuring networking, storage preparation, or device management.
// Hooks may fire multiple times for the same lifecycle event due to reconciliation retries.
// Implementations must be idempotent.
type NodeHook struct {
// Socket is the path to the Unix socket for hook communication.
// +kubebuilder:validation:MinLength=1
Socket string `json:"socket"`
// PermittedHooks lists the VM lifecycle events this hook handles.
// +kubebuilder:validation:MinItems=1
// +listType=atomic
PermittedHooks []NodeHookPoint `json:"permittedHooks"`
// Condition is a CEL expression that determines whether this hook applies to a given VM.
// +optional
Condition string `json:"condition,omitempty"`
// FailureStrategy specifies how to handle hook failures (Fail or Ignore).
// +optional
FailureStrategy FailureStrategy `json:"failureStrategy,omitempty"`
// Timeout specifies the maximum duration to wait for the hook to complete.
// +optional
Timeout *metav1.Duration `json:"timeout,omitempty"`
}
// NodeHookPoint identifies a VM lifecycle event for node-level hooks.
// +enum
type NodeHookPoint string
const (
NodeHookPreVMStart NodeHookPoint = "PreVMStart"
NodeHookPostVMStart NodeHookPoint = "PostVMStart"
NodeHookPreVMStop NodeHookPoint = "PreVMStop"
NodeHookPostVMStop NodeHookPoint = "PostVMStop"
NodeHookPreMigrationSource NodeHookPoint = "PreMigrationSource"
NodeHookPreMigrationTarget NodeHookPoint = "PreMigrationTarget"
NodeHookPostMigrationTarget NodeHookPoint = "PostMigrationTarget"
)
// AdmissionReference is a reference to an admission object by name.
type AdmissionReference struct {
// Name is the name of the admission object.
// +kubebuilder:validation:MinLength=1
Name string `json:"name"`
}
type PluginStatus struct{}
+76
View File
@@ -0,0 +1,76 @@
// Code generated by swagger-doc. DO NOT EDIT.
package v1alpha1
func (Plugin) SwaggerDoc() map[string]string {
return map[string]string{
"": "Plugin defines a KubeVirt extension that can modify VM domain XML,\nhook into VM lifecycle events, and reference admission objects.",
"spec": "Spec defines the plugin's hooks and admission references.",
"status": "Status reflects the observed state of the plugin.\n+optional",
}
}
func (PluginList) SwaggerDoc() map[string]string {
return map[string]string{
"": "+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object",
"items": "+listType=atomic",
}
}
func (PluginSpec) SwaggerDoc() map[string]string {
return map[string]string{
"condition": "Condition is a CEL expression that determines whether this plugin applies to a given VM.\nWhen set, this acts as a baseline filter for all hooks in the plugin.\nIndividual hooks may further narrow the scope with their own Condition fields.\n+optional",
"failureStrategy": "FailureStrategy specifies the default behavior when the plugin itself is unhealthy\n(e.g. a referenced webhook is not ready, or a sidecar socket is unreachable).\nIndividual hooks may override this with their own FailureStrategy.\n+optional",
"domainHooks": "DomainHooks defines hooks that modify the libvirt domain XML.\nHooks are applied in declaration order within each plugin.\nAcross plugins, hooks are applied in alphabetical order by plugin name.\n+optional\n+listType=atomic",
"nodeHooks": "NodeHooks defines hooks that execute during VM lifecycle events.\nHooks are applied in declaration order within each plugin.\nAcross plugins, hooks are applied in alphabetical order by plugin name.\n+optional\n+listType=atomic",
"mutatingAdmissionPolicies": "MutatingAdmissionPolicies references MutatingAdmissionPolicy objects managed by the plugin.\n+optional\n+listType=atomic",
"validatingAdmissionPolicies": "ValidatingAdmissionPolicies references ValidatingAdmissionPolicy objects managed by the plugin.\n+optional\n+listType=atomic",
"mutatingAdmissionWebhooks": "MutatingAdmissionWebhooks references MutatingWebhookConfiguration objects managed by the plugin.\n+optional\n+listType=atomic",
"validatingAdmissionWebhooks": "ValidatingAdmissionWebhooks references ValidatingWebhookConfiguration objects managed by the plugin.\n+optional\n+listType=atomic",
}
}
func (DomainHook) SwaggerDoc() map[string]string {
return map[string]string{
"": "DomainHook defines a hook that modifies the libvirt domain XML.\nExactly one of cel or sidecar must be specified.",
"cel": "CEL defines a CEL expression that transforms the domain XML.\n+optional",
"sidecar": "Sidecar defines a sidecar-based hook that transforms the domain XML via a Unix socket.\n+optional",
"condition": "Condition is a CEL expression that determines whether this hook applies to a given VM.\n+optional",
"failureStrategy": "FailureStrategy specifies how to handle hook failures (Fail or Ignore).\n+optional",
"timeout": "Timeout specifies the maximum duration to wait for the hook to complete.\n+optional",
}
}
func (CELDomainHook) SwaggerDoc() map[string]string {
return map[string]string{
"expression": "Expression is the CEL expression applied to the domain XML.\n+kubebuilder:validation:MinLength=1",
}
}
func (SidecarDomainHook) SwaggerDoc() map[string]string {
return map[string]string{
"socketPath": "SocketPath is the path to the Unix socket used to communicate with the sidecar.\n+kubebuilder:validation:MinLength=1",
}
}
func (NodeHook) SwaggerDoc() map[string]string {
return map[string]string{
"": "NodeHook defines a hook that runs an executable on the hosting node during VM lifecycle events.\nUnlike DomainHooks which modify the libvirt domain XML, NodeHooks perform node-level operations\nsuch as configuring networking, storage preparation, or device management.\nHooks may fire multiple times for the same lifecycle event due to reconciliation retries.\nImplementations must be idempotent.",
"socket": "Socket is the path to the Unix socket for hook communication.\n+kubebuilder:validation:MinLength=1",
"permittedHooks": "PermittedHooks lists the VM lifecycle events this hook handles.\n+kubebuilder:validation:MinItems=1\n+listType=atomic",
"condition": "Condition is a CEL expression that determines whether this hook applies to a given VM.\n+optional",
"failureStrategy": "FailureStrategy specifies how to handle hook failures (Fail or Ignore).\n+optional",
"timeout": "Timeout specifies the maximum duration to wait for the hook to complete.\n+optional",
}
}
func (AdmissionReference) SwaggerDoc() map[string]string {
return map[string]string{
"": "AdmissionReference is a reference to an admission object by name.",
"name": "Name is the name of the admission object.\n+kubebuilder:validation:MinLength=1",
}
}
func (PluginStatus) SwaggerDoc() map[string]string {
return map[string]string{}
}
+6 -5
View File
@@ -77,11 +77,12 @@ type VirtualMachineSnapshotSpec struct {
type Indication string
const (
VMSnapshotOnlineSnapshotIndication Indication = "Online"
VMSnapshotNoGuestAgentIndication Indication = "NoGuestAgent"
VMSnapshotGuestAgentIndication Indication = "GuestAgent"
VMSnapshotQuiesceTimeoutIndication Indication = "QuiesceTimeout"
VMSnapshotPausedIndication Indication = "Paused"
VMSnapshotOnlineSnapshotIndication Indication = "Online"
VMSnapshotNoGuestAgentIndication Indication = "NoGuestAgent"
VMSnapshotGuestAgentIndication Indication = "GuestAgent"
VMSnapshotQuiesceTimeoutIndication Indication = "QuiesceTimeout"
VMSnapshotPausedIndication Indication = "Paused"
VMSnapshotPartialSnapshotIndication Indication = "PartialSnapshot"
)
// SourceIndication provides an indication of the source VM with its description message
+8 -5
View File
@@ -78,11 +78,12 @@ type VirtualMachineSnapshotSpec struct {
type Indication string
const (
VMSnapshotOnlineSnapshotIndication Indication = "Online"
VMSnapshotNoGuestAgentIndication Indication = "NoGuestAgent"
VMSnapshotGuestAgentIndication Indication = "GuestAgent"
VMSnapshotQuiesceTimeoutIndication Indication = "QuiesceTimeout"
VMSnapshotPausedIndication Indication = "Paused"
VMSnapshotOnlineSnapshotIndication Indication = "Online"
VMSnapshotNoGuestAgentIndication Indication = "NoGuestAgent"
VMSnapshotGuestAgentIndication Indication = "GuestAgent"
VMSnapshotQuiesceTimeoutIndication Indication = "QuiesceTimeout"
VMSnapshotPausedIndication Indication = "Paused"
VMSnapshotPartialSnapshotIndication Indication = "PartialSnapshot"
)
// SourceIndication provides an indication of the source VM with its description message
@@ -387,6 +388,8 @@ type VirtualMachineRestoreSpec struct {
VirtualMachineSnapshotName string `json:"virtualMachineSnapshotName"`
// +optional
// +kubebuilder:default=WaitGracePeriod
// +kubebuilder:validation:Enum=StopTarget;WaitGracePeriod;FailImmediate;WaitEventually
TargetReadinessPolicy *TargetReadinessPolicy `json:"targetReadinessPolicy,omitempty"`
// +optional
+1 -1
View File
@@ -150,7 +150,7 @@ func (VirtualMachineRestoreSpec) SwaggerDoc() map[string]string {
return map[string]string{
"": "VirtualMachineRestoreSpec is the spec for a VirtualMachineRestore resource",
"target": "initially only VirtualMachine type supported",
"targetReadinessPolicy": "+optional",
"targetReadinessPolicy": "+optional\n+kubebuilder:default=WaitGracePeriod\n+kubebuilder:validation:Enum=StopTarget;WaitGracePeriod;FailImmediate;WaitEventually",
"volumeRestorePolicy": "+optional",
"volumeOwnershipPolicy": "+optional",
"volumeRestoreOverrides": "VolumeRestoreOverrides gives the option to change properties of each restored volume\nFor example, specifying the name of the restored volume, or adding labels/annotations to it\n+optional\n+listType=atomic",
+24 -11
View File
@@ -31,10 +31,11 @@ import (
clonev1alpha1 "kubevirt.io/client-go/kubevirt/typed/clone/v1alpha1"
clonev1beta1 "kubevirt.io/client-go/kubevirt/typed/clone/v1beta1"
kubevirtv1 "kubevirt.io/client-go/kubevirt/typed/core/v1"
exportv1alpha1 "kubevirt.io/client-go/kubevirt/typed/export/v1alpha1"
exportv1 "kubevirt.io/client-go/kubevirt/typed/export/v1"
exportv1beta1 "kubevirt.io/client-go/kubevirt/typed/export/v1beta1"
instancetypev1beta1 "kubevirt.io/client-go/kubevirt/typed/instancetype/v1beta1"
migrationsv1alpha1 "kubevirt.io/client-go/kubevirt/typed/migrations/v1alpha1"
pluginv1alpha1 "kubevirt.io/client-go/kubevirt/typed/plugin/v1alpha1"
poolv1alpha1 "kubevirt.io/client-go/kubevirt/typed/pool/v1alpha1"
poolv1beta1 "kubevirt.io/client-go/kubevirt/typed/pool/v1beta1"
snapshotv1alpha1 "kubevirt.io/client-go/kubevirt/typed/snapshot/v1alpha1"
@@ -47,10 +48,11 @@ type Interface interface {
CloneV1alpha1() clonev1alpha1.CloneV1alpha1Interface
CloneV1beta1() clonev1beta1.CloneV1beta1Interface
KubevirtV1() kubevirtv1.KubevirtV1Interface
ExportV1alpha1() exportv1alpha1.ExportV1alpha1Interface
ExportV1beta1() exportv1beta1.ExportV1beta1Interface
ExportV1() exportv1.ExportV1Interface
InstancetypeV1beta1() instancetypev1beta1.InstancetypeV1beta1Interface
MigrationsV1alpha1() migrationsv1alpha1.MigrationsV1alpha1Interface
PluginV1alpha1() pluginv1alpha1.PluginV1alpha1Interface
PoolV1alpha1() poolv1alpha1.PoolV1alpha1Interface
PoolV1beta1() poolv1beta1.PoolV1beta1Interface
SnapshotV1alpha1() snapshotv1alpha1.SnapshotV1alpha1Interface
@@ -64,10 +66,11 @@ type Clientset struct {
cloneV1alpha1 *clonev1alpha1.CloneV1alpha1Client
cloneV1beta1 *clonev1beta1.CloneV1beta1Client
kubevirtV1 *kubevirtv1.KubevirtV1Client
exportV1alpha1 *exportv1alpha1.ExportV1alpha1Client
exportV1beta1 *exportv1beta1.ExportV1beta1Client
exportV1 *exportv1.ExportV1Client
instancetypeV1beta1 *instancetypev1beta1.InstancetypeV1beta1Client
migrationsV1alpha1 *migrationsv1alpha1.MigrationsV1alpha1Client
pluginV1alpha1 *pluginv1alpha1.PluginV1alpha1Client
poolV1alpha1 *poolv1alpha1.PoolV1alpha1Client
poolV1beta1 *poolv1beta1.PoolV1beta1Client
snapshotV1alpha1 *snapshotv1alpha1.SnapshotV1alpha1Client
@@ -94,16 +97,16 @@ func (c *Clientset) KubevirtV1() kubevirtv1.KubevirtV1Interface {
return c.kubevirtV1
}
// ExportV1alpha1 retrieves the ExportV1alpha1Client
func (c *Clientset) ExportV1alpha1() exportv1alpha1.ExportV1alpha1Interface {
return c.exportV1alpha1
}
// ExportV1beta1 retrieves the ExportV1beta1Client
func (c *Clientset) ExportV1beta1() exportv1beta1.ExportV1beta1Interface {
return c.exportV1beta1
}
// ExportV1 retrieves the ExportV1Client
func (c *Clientset) ExportV1() exportv1.ExportV1Interface {
return c.exportV1
}
// InstancetypeV1beta1 retrieves the InstancetypeV1beta1Client
func (c *Clientset) InstancetypeV1beta1() instancetypev1beta1.InstancetypeV1beta1Interface {
return c.instancetypeV1beta1
@@ -114,6 +117,11 @@ func (c *Clientset) MigrationsV1alpha1() migrationsv1alpha1.MigrationsV1alpha1In
return c.migrationsV1alpha1
}
// PluginV1alpha1 retrieves the PluginV1alpha1Client
func (c *Clientset) PluginV1alpha1() pluginv1alpha1.PluginV1alpha1Interface {
return c.pluginV1alpha1
}
// PoolV1alpha1 retrieves the PoolV1alpha1Client
func (c *Clientset) PoolV1alpha1() poolv1alpha1.PoolV1alpha1Interface {
return c.poolV1alpha1
@@ -194,11 +202,11 @@ func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset,
if err != nil {
return nil, err
}
cs.exportV1alpha1, err = exportv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient)
cs.exportV1beta1, err = exportv1beta1.NewForConfigAndClient(&configShallowCopy, httpClient)
if err != nil {
return nil, err
}
cs.exportV1beta1, err = exportv1beta1.NewForConfigAndClient(&configShallowCopy, httpClient)
cs.exportV1, err = exportv1.NewForConfigAndClient(&configShallowCopy, httpClient)
if err != nil {
return nil, err
}
@@ -210,6 +218,10 @@ func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset,
if err != nil {
return nil, err
}
cs.pluginV1alpha1, err = pluginv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient)
if err != nil {
return nil, err
}
cs.poolV1alpha1, err = poolv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient)
if err != nil {
return nil, err
@@ -251,10 +263,11 @@ func New(c rest.Interface) *Clientset {
cs.cloneV1alpha1 = clonev1alpha1.New(c)
cs.cloneV1beta1 = clonev1beta1.New(c)
cs.kubevirtV1 = kubevirtv1.New(c)
cs.exportV1alpha1 = exportv1alpha1.New(c)
cs.exportV1beta1 = exportv1beta1.New(c)
cs.exportV1 = exportv1.New(c)
cs.instancetypeV1beta1 = instancetypev1beta1.New(c)
cs.migrationsV1alpha1 = migrationsv1alpha1.New(c)
cs.pluginV1alpha1 = pluginv1alpha1.New(c)
cs.poolV1alpha1 = poolv1alpha1.New(c)
cs.poolV1beta1 = poolv1beta1.New(c)
cs.snapshotV1alpha1 = snapshotv1alpha1.New(c)
+4 -2
View File
@@ -30,10 +30,11 @@ import (
clonev1alpha1 "kubevirt.io/api/clone/v1alpha1"
clonev1beta1 "kubevirt.io/api/clone/v1beta1"
kubevirtv1 "kubevirt.io/api/core/v1"
exportv1alpha1 "kubevirt.io/api/export/v1alpha1"
exportv1 "kubevirt.io/api/export/v1"
exportv1beta1 "kubevirt.io/api/export/v1beta1"
instancetypev1beta1 "kubevirt.io/api/instancetype/v1beta1"
migrationsv1alpha1 "kubevirt.io/api/migrations/v1alpha1"
pluginv1alpha1 "kubevirt.io/api/plugin/v1alpha1"
poolv1alpha1 "kubevirt.io/api/pool/v1alpha1"
poolv1beta1 "kubevirt.io/api/pool/v1beta1"
snapshotv1alpha1 "kubevirt.io/api/snapshot/v1alpha1"
@@ -48,10 +49,11 @@ var localSchemeBuilder = runtime.SchemeBuilder{
clonev1alpha1.AddToScheme,
clonev1beta1.AddToScheme,
kubevirtv1.AddToScheme,
exportv1alpha1.AddToScheme,
exportv1beta1.AddToScheme,
exportv1.AddToScheme,
instancetypev1beta1.AddToScheme,
migrationsv1alpha1.AddToScheme,
pluginv1alpha1.AddToScheme,
poolv1alpha1.AddToScheme,
poolv1beta1.AddToScheme,
snapshotv1alpha1.AddToScheme,
+22
View File
@@ -0,0 +1,22 @@
/*
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 The KubeVirt Authors.
*/
// Code generated by client-gen. DO NOT EDIT.
// This package has the automatically generated typed clients.
package v1
@@ -18,34 +18,34 @@ Copyright The KubeVirt Authors.
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
package v1
import (
http "net/http"
rest "k8s.io/client-go/rest"
exportv1alpha1 "kubevirt.io/api/export/v1alpha1"
exportv1 "kubevirt.io/api/export/v1"
scheme "kubevirt.io/client-go/kubevirt/scheme"
)
type ExportV1alpha1Interface interface {
type ExportV1Interface interface {
RESTClient() rest.Interface
VirtualMachineExportsGetter
}
// ExportV1alpha1Client is used to interact with features provided by the export.kubevirt.io group.
type ExportV1alpha1Client struct {
// ExportV1Client is used to interact with features provided by the export.kubevirt.io group.
type ExportV1Client struct {
restClient rest.Interface
}
func (c *ExportV1alpha1Client) VirtualMachineExports(namespace string) VirtualMachineExportInterface {
func (c *ExportV1Client) VirtualMachineExports(namespace string) VirtualMachineExportInterface {
return newVirtualMachineExports(c, namespace)
}
// NewForConfig creates a new ExportV1alpha1Client for the given config.
// NewForConfig creates a new ExportV1Client for the given config.
// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient),
// where httpClient was generated with rest.HTTPClientFor(c).
func NewForConfig(c *rest.Config) (*ExportV1alpha1Client, error) {
func NewForConfig(c *rest.Config) (*ExportV1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
@@ -57,9 +57,9 @@ func NewForConfig(c *rest.Config) (*ExportV1alpha1Client, error) {
return NewForConfigAndClient(&config, httpClient)
}
// NewForConfigAndClient creates a new ExportV1alpha1Client for the given config and http client.
// NewForConfigAndClient creates a new ExportV1Client for the given config and http client.
// Note the http client provided takes precedence over the configured transport values.
func NewForConfigAndClient(c *rest.Config, h *http.Client) (*ExportV1alpha1Client, error) {
func NewForConfigAndClient(c *rest.Config, h *http.Client) (*ExportV1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
@@ -68,12 +68,12 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*ExportV1alpha1Clien
if err != nil {
return nil, err
}
return &ExportV1alpha1Client{client}, nil
return &ExportV1Client{client}, nil
}
// NewForConfigOrDie creates a new ExportV1alpha1Client for the given config and
// NewForConfigOrDie creates a new ExportV1Client for the given config and
// panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *ExportV1alpha1Client {
func NewForConfigOrDie(c *rest.Config) *ExportV1Client {
client, err := NewForConfig(c)
if err != nil {
panic(err)
@@ -81,13 +81,13 @@ func NewForConfigOrDie(c *rest.Config) *ExportV1alpha1Client {
return client
}
// New creates a new ExportV1alpha1Client for the given RESTClient.
func New(c rest.Interface) *ExportV1alpha1Client {
return &ExportV1alpha1Client{c}
// New creates a new ExportV1Client for the given RESTClient.
func New(c rest.Interface) *ExportV1Client {
return &ExportV1Client{c}
}
func setConfigDefaults(config *rest.Config) error {
gv := exportv1alpha1.SchemeGroupVersion
gv := exportv1.SchemeGroupVersion
config.GroupVersion = &gv
config.APIPath = "/apis"
config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion()
@@ -101,7 +101,7 @@ func setConfigDefaults(config *rest.Config) error {
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *ExportV1alpha1Client) RESTClient() rest.Interface {
func (c *ExportV1Client) RESTClient() rest.Interface {
if c == nil {
return nil
}
@@ -18,6 +18,6 @@ Copyright The KubeVirt Authors.
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
package v1
type VirtualMachineExportExpansion interface{}
@@ -18,16 +18,16 @@ Copyright The KubeVirt Authors.
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
package v1
import (
context "context"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
gentype "k8s.io/client-go/gentype"
exportv1alpha1 "kubevirt.io/api/export/v1alpha1"
exportv1 "kubevirt.io/api/export/v1"
scheme "kubevirt.io/client-go/kubevirt/scheme"
)
@@ -39,34 +39,34 @@ type VirtualMachineExportsGetter interface {
// VirtualMachineExportInterface has methods to work with VirtualMachineExport resources.
type VirtualMachineExportInterface interface {
Create(ctx context.Context, virtualMachineExport *exportv1alpha1.VirtualMachineExport, opts v1.CreateOptions) (*exportv1alpha1.VirtualMachineExport, error)
Update(ctx context.Context, virtualMachineExport *exportv1alpha1.VirtualMachineExport, opts v1.UpdateOptions) (*exportv1alpha1.VirtualMachineExport, error)
Create(ctx context.Context, virtualMachineExport *exportv1.VirtualMachineExport, opts metav1.CreateOptions) (*exportv1.VirtualMachineExport, error)
Update(ctx context.Context, virtualMachineExport *exportv1.VirtualMachineExport, opts metav1.UpdateOptions) (*exportv1.VirtualMachineExport, error)
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
UpdateStatus(ctx context.Context, virtualMachineExport *exportv1alpha1.VirtualMachineExport, opts v1.UpdateOptions) (*exportv1alpha1.VirtualMachineExport, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*exportv1alpha1.VirtualMachineExport, error)
List(ctx context.Context, opts v1.ListOptions) (*exportv1alpha1.VirtualMachineExportList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *exportv1alpha1.VirtualMachineExport, err error)
UpdateStatus(ctx context.Context, virtualMachineExport *exportv1.VirtualMachineExport, opts metav1.UpdateOptions) (*exportv1.VirtualMachineExport, error)
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
Get(ctx context.Context, name string, opts metav1.GetOptions) (*exportv1.VirtualMachineExport, error)
List(ctx context.Context, opts metav1.ListOptions) (*exportv1.VirtualMachineExportList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *exportv1.VirtualMachineExport, err error)
VirtualMachineExportExpansion
}
// virtualMachineExports implements VirtualMachineExportInterface
type virtualMachineExports struct {
*gentype.ClientWithList[*exportv1alpha1.VirtualMachineExport, *exportv1alpha1.VirtualMachineExportList]
*gentype.ClientWithList[*exportv1.VirtualMachineExport, *exportv1.VirtualMachineExportList]
}
// newVirtualMachineExports returns a VirtualMachineExports
func newVirtualMachineExports(c *ExportV1alpha1Client, namespace string) *virtualMachineExports {
func newVirtualMachineExports(c *ExportV1Client, namespace string) *virtualMachineExports {
return &virtualMachineExports{
gentype.NewClientWithList[*exportv1alpha1.VirtualMachineExport, *exportv1alpha1.VirtualMachineExportList](
gentype.NewClientWithList[*exportv1.VirtualMachineExport, *exportv1.VirtualMachineExportList](
"virtualmachineexports",
c.RESTClient(),
scheme.ParameterCodec,
namespace,
func() *exportv1alpha1.VirtualMachineExport { return &exportv1alpha1.VirtualMachineExport{} },
func() *exportv1alpha1.VirtualMachineExportList { return &exportv1alpha1.VirtualMachineExportList{} },
func() *exportv1.VirtualMachineExport { return &exportv1.VirtualMachineExport{} },
func() *exportv1.VirtualMachineExportList { return &exportv1.VirtualMachineExportList{} },
),
}
}
@@ -0,0 +1,23 @@
/*
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 The KubeVirt Authors.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
type PluginExpansion interface{}
+72
View File
@@ -0,0 +1,72 @@
/*
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 The KubeVirt Authors.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
import (
context "context"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
gentype "k8s.io/client-go/gentype"
pluginv1alpha1 "kubevirt.io/api/plugin/v1alpha1"
scheme "kubevirt.io/client-go/kubevirt/scheme"
)
// PluginsGetter has a method to return a PluginInterface.
// A group's client should implement this interface.
type PluginsGetter interface {
Plugins() PluginInterface
}
// PluginInterface has methods to work with Plugin resources.
type PluginInterface interface {
Create(ctx context.Context, plugin *pluginv1alpha1.Plugin, opts v1.CreateOptions) (*pluginv1alpha1.Plugin, error)
Update(ctx context.Context, plugin *pluginv1alpha1.Plugin, opts v1.UpdateOptions) (*pluginv1alpha1.Plugin, error)
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
UpdateStatus(ctx context.Context, plugin *pluginv1alpha1.Plugin, opts v1.UpdateOptions) (*pluginv1alpha1.Plugin, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*pluginv1alpha1.Plugin, error)
List(ctx context.Context, opts v1.ListOptions) (*pluginv1alpha1.PluginList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *pluginv1alpha1.Plugin, err error)
PluginExpansion
}
// plugins implements PluginInterface
type plugins struct {
*gentype.ClientWithList[*pluginv1alpha1.Plugin, *pluginv1alpha1.PluginList]
}
// newPlugins returns a Plugins
func newPlugins(c *PluginV1alpha1Client) *plugins {
return &plugins{
gentype.NewClientWithList[*pluginv1alpha1.Plugin, *pluginv1alpha1.PluginList](
"plugins",
c.RESTClient(),
scheme.ParameterCodec,
"",
func() *pluginv1alpha1.Plugin { return &pluginv1alpha1.Plugin{} },
func() *pluginv1alpha1.PluginList { return &pluginv1alpha1.PluginList{} },
),
}
}
@@ -0,0 +1,109 @@
/*
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 The KubeVirt Authors.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
import (
http "net/http"
rest "k8s.io/client-go/rest"
pluginv1alpha1 "kubevirt.io/api/plugin/v1alpha1"
scheme "kubevirt.io/client-go/kubevirt/scheme"
)
type PluginV1alpha1Interface interface {
RESTClient() rest.Interface
PluginsGetter
}
// PluginV1alpha1Client is used to interact with features provided by the plugin.kubevirt.io group.
type PluginV1alpha1Client struct {
restClient rest.Interface
}
func (c *PluginV1alpha1Client) Plugins() PluginInterface {
return newPlugins(c)
}
// NewForConfig creates a new PluginV1alpha1Client for the given config.
// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient),
// where httpClient was generated with rest.HTTPClientFor(c).
func NewForConfig(c *rest.Config) (*PluginV1alpha1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
httpClient, err := rest.HTTPClientFor(&config)
if err != nil {
return nil, err
}
return NewForConfigAndClient(&config, httpClient)
}
// NewForConfigAndClient creates a new PluginV1alpha1Client for the given config and http client.
// Note the http client provided takes precedence over the configured transport values.
func NewForConfigAndClient(c *rest.Config, h *http.Client) (*PluginV1alpha1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientForConfigAndClient(&config, h)
if err != nil {
return nil, err
}
return &PluginV1alpha1Client{client}, nil
}
// NewForConfigOrDie creates a new PluginV1alpha1Client for the given config and
// panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *PluginV1alpha1Client {
client, err := NewForConfig(c)
if err != nil {
panic(err)
}
return client
}
// New creates a new PluginV1alpha1Client for the given RESTClient.
func New(c rest.Interface) *PluginV1alpha1Client {
return &PluginV1alpha1Client{c}
}
func setConfigDefaults(config *rest.Config) error {
gv := pluginv1alpha1.SchemeGroupVersion
config.GroupVersion = &gv
config.APIPath = "/apis"
config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion()
if config.UserAgent == "" {
config.UserAgent = rest.DefaultKubernetesUserAgent()
}
return nil
}
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *PluginV1alpha1Client) RESTClient() rest.Interface {
if c == nil {
return nil
}
return c.restClient
}
+1 -1
View File
@@ -218,7 +218,7 @@ func (l FilteredVerbosityLogger) Info(msg string) {
}
func (l FilteredVerbosityLogger) Infof(msg string, args ...interface{}) {
l.filteredLogger.log(2, "msg", fmt.Sprintf(msg, args...))
l.filteredLogger.Level(INFO).log(2, "msg", fmt.Sprintf(msg, args...))
}
func (l FilteredVerbosityLogger) Object(obj LoggableObject) *FilteredVerbosityLogger {
+7 -4
View File
@@ -1431,7 +1431,7 @@ k8s.io/utils/pointer
k8s.io/utils/ptr
k8s.io/utils/third_party/forked/golang/btree
k8s.io/utils/trace
# kubevirt.io/api v1.8.2
# kubevirt.io/api v1.9.0
## explicit; go 1.24.0
kubevirt.io/api/backup
kubevirt.io/api/backup/v1alpha1
@@ -1441,19 +1441,21 @@ kubevirt.io/api/clone/v1beta1
kubevirt.io/api/core
kubevirt.io/api/core/v1
kubevirt.io/api/export
kubevirt.io/api/export/v1alpha1
kubevirt.io/api/export/v1
kubevirt.io/api/export/v1beta1
kubevirt.io/api/instancetype
kubevirt.io/api/instancetype/v1beta1
kubevirt.io/api/migrations
kubevirt.io/api/migrations/v1alpha1
kubevirt.io/api/plugin
kubevirt.io/api/plugin/v1alpha1
kubevirt.io/api/pool
kubevirt.io/api/pool/v1alpha1
kubevirt.io/api/pool/v1beta1
kubevirt.io/api/snapshot
kubevirt.io/api/snapshot/v1alpha1
kubevirt.io/api/snapshot/v1beta1
# kubevirt.io/client-go v1.8.2
# kubevirt.io/client-go v1.9.0
## explicit; go 1.24.0
kubevirt.io/client-go/kubevirt
kubevirt.io/client-go/kubevirt/scheme
@@ -1461,10 +1463,11 @@ kubevirt.io/client-go/kubevirt/typed/backup/v1alpha1
kubevirt.io/client-go/kubevirt/typed/clone/v1alpha1
kubevirt.io/client-go/kubevirt/typed/clone/v1beta1
kubevirt.io/client-go/kubevirt/typed/core/v1
kubevirt.io/client-go/kubevirt/typed/export/v1alpha1
kubevirt.io/client-go/kubevirt/typed/export/v1
kubevirt.io/client-go/kubevirt/typed/export/v1beta1
kubevirt.io/client-go/kubevirt/typed/instancetype/v1beta1
kubevirt.io/client-go/kubevirt/typed/migrations/v1alpha1
kubevirt.io/client-go/kubevirt/typed/plugin/v1alpha1
kubevirt.io/client-go/kubevirt/typed/pool/v1alpha1
kubevirt.io/client-go/kubevirt/typed/pool/v1beta1
kubevirt.io/client-go/kubevirt/typed/snapshot/v1alpha1