Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: yaroslavborbat <[email protected]>
  • Loading branch information
yaroslavborbat committed Dec 4, 2024
1 parent a1821f9 commit 5c5875a
Showing 1 changed file with 12 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -418,41 +418,21 @@ index 0000000000..b16c2f365f
+ return false
+}
diff --git a/pkg/virt-controller/watch/vmi.go b/pkg/virt-controller/watch/vmi.go
index 0c4bfca389..b798743c61 100644
index 0c4bfca389..6bd1ecf76a 100644
--- a/pkg/virt-controller/watch/vmi.go
+++ b/pkg/virt-controller/watch/vmi.go
@@ -30,16 +30,20 @@ import (
"strings"
"time"

@@ -69,6 +69,10 @@ import (
virtconfig "kubevirt.io/kubevirt/pkg/virt-config"
"kubevirt.io/kubevirt/pkg/virt-controller/services"
"kubevirt.io/kubevirt/pkg/virt-controller/watch/descheduler"
+
+ "k8s.io/apimachinery/pkg/labels"
"k8s.io/utils/ptr"

+ "kubevirt.io/kubevirt/pkg/indexers"
"kubevirt.io/kubevirt/pkg/virt-controller/network"

+ networkv1 "github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1"
+
+ "kubevirt.io/kubevirt/pkg/util/affinity"
+
"kubevirt.io/kubevirt/pkg/virt-controller/watch/topology"

backendstorage "kubevirt.io/kubevirt/pkg/storage/backend-storage"
)

- networkv1 "github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1"
-
k8sv1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/equality"
k8serrors "k8s.io/apimachinery/pkg/api/errors"
@@ -51,7 +55,6 @@ import (
"k8s.io/client-go/tools/record"
"k8s.io/client-go/util/workqueue"
"k8s.io/utils/trace"
-
virtv1 "kubevirt.io/api/core/v1"
"kubevirt.io/client-go/kubecli"
"kubevirt.io/client-go/log"
@@ -114,6 +117,10 @@ func NewVMIController(templateService services.TemplateService,
const (
@@ -114,6 +118,10 @@ func NewVMIController(templateService services.TemplateService,
backendStorage: backendstorage.NewBackendStorage(clientset, clusterConfig, storageClassInformer.GetStore(), storageProfileInformer.GetStore(), pvcInformer.GetIndexer()),
}

Expand All @@ -463,15 +443,15 @@ index 0c4bfca389..b798743c61 100644
c.hasSynced = func() bool {
return vmInformer.HasSynced() && vmiInformer.HasSynced() && podInformer.HasSynced() &&
dataVolumeInformer.HasSynced() && cdiConfigInformer.HasSynced() && cdiInformer.HasSynced() &&
@@ -208,6 +215,7 @@ type VMIController struct {
@@ -208,6 +216,7 @@ type VMIController struct {
vmiIndexer cache.Indexer
vmStore cache.Store
podIndexer cache.Indexer
+ nodeIndexer cache.Indexer
pvcIndexer cache.Indexer
storageClassStore cache.Store
topologyHinter topology.Hinter
@@ -691,6 +699,10 @@ func (c *VMIController) updateStatus(vmi *virtv1.VirtualMachineInstance, pod *k8
@@ -691,6 +700,10 @@ func (c *VMIController) updateStatus(vmi *virtv1.VirtualMachineInstance, pod *k8
c.syncVolumesUpdate(vmiCopy)
}

Expand All @@ -482,7 +462,7 @@ index 0c4bfca389..b798743c61 100644
case vmi.IsScheduled():
if !vmiPodExists {
vmiCopy.Status.Phase = virtv1.Failed
@@ -2416,6 +2428,166 @@ func (c *VMIController) syncVolumesUpdate(vmi *virtv1.VirtualMachineInstance) {
@@ -2416,6 +2429,166 @@ func (c *VMIController) syncVolumesUpdate(vmi *virtv1.VirtualMachineInstance) {
vmiConditions.UpdateCondition(vmi, &condition)
}

Expand Down

0 comments on commit 5c5875a

Please sign in to comment.