diff --git a/pkg/virt-controller/watch/drain/disruptionbudget/disruptionbudget.go b/pkg/virt-controller/watch/drain/disruptionbudget/disruptionbudget.go index 96b235319ff1..d96d93287ffd 100644 --- a/pkg/virt-controller/watch/drain/disruptionbudget/disruptionbudget.go +++ b/pkg/virt-controller/watch/drain/disruptionbudget/disruptionbudget.go @@ -286,6 +286,7 @@ func (c *DisruptionBudgetController) enqueueVirtualMachine(obj interface{}) { key, err := controller.KeyFunc(vmi) if err != nil { logger.Object(vmi).Reason(err).Error("Failed to extract key from virtualmachineinstance.") + return } c.Queue.Add(key) } diff --git a/pkg/virt-controller/watch/drain/evacuation/evacuation.go b/pkg/virt-controller/watch/drain/evacuation/evacuation.go index 6e9635510892..516097c8b27e 100644 --- a/pkg/virt-controller/watch/drain/evacuation/evacuation.go +++ b/pkg/virt-controller/watch/drain/evacuation/evacuation.go @@ -110,6 +110,7 @@ func (c *EvacuationController) enqueueNode(obj interface{}) { key, err := controller.KeyFunc(node) if err != nil { logger.Object(node).Reason(err).Error("Failed to extract key from node.") + return } c.Queue.Add(key) } @@ -240,6 +241,7 @@ func (c *EvacuationController) enqueueVirtualMachine(obj interface{}) { key, err := controller.KeyFunc(vmi) if err != nil { logger.Object(vmi).Reason(err).Error("Failed to extract key from virtualmachineinstance.") + return } c.Queue.Add(key) } diff --git a/pkg/virt-controller/watch/migration.go b/pkg/virt-controller/watch/migration.go index 526dfb27ea3c..982bf998729a 100644 --- a/pkg/virt-controller/watch/migration.go +++ b/pkg/virt-controller/watch/migration.go @@ -1264,6 +1264,7 @@ func (c *MigrationController) enqueueMigration(obj interface{}) { key, err := controller.KeyFunc(migration) if err != nil { logger.Object(migration).Reason(err).Error("Failed to extract key from migration.") + return } c.Queue.Add(key) } diff --git a/pkg/virt-controller/watch/node.go b/pkg/virt-controller/watch/node.go index 219a62a5de4c..559b80c1379f 100644 --- a/pkg/virt-controller/watch/node.go +++ b/pkg/virt-controller/watch/node.go @@ -87,6 +87,7 @@ func (c *NodeController) enqueueNode(obj interface{}) { key, err := controller.KeyFunc(node) if err != nil { logger.Object(node).Reason(err).Error("Failed to extract key from node.") + return } c.Queue.Add(key) } diff --git a/pkg/virt-controller/watch/pool.go b/pkg/virt-controller/watch/pool.go index b4a365ebcf79..95b94e573b53 100644 --- a/pkg/virt-controller/watch/pool.go +++ b/pkg/virt-controller/watch/pool.go @@ -341,6 +341,7 @@ func (c *PoolController) enqueuePool(obj interface{}) { key, err := controller.KeyFunc(pool) if err != nil { logger.Object(pool).Reason(err).Error("Failed to extract key from pool.") + return } // Delay prevents pool from being reconciled too often diff --git a/pkg/virt-controller/watch/replicaset.go b/pkg/virt-controller/watch/replicaset.go index c02bf6262b28..f425eacd0cc7 100644 --- a/pkg/virt-controller/watch/replicaset.go +++ b/pkg/virt-controller/watch/replicaset.go @@ -578,6 +578,7 @@ func (c *VMIReplicaSet) enqueueReplicaSet(obj interface{}) { key, err := controller.KeyFunc(rs) if err != nil { logger.Object(rs).Reason(err).Error(failedRsKeyExtraction) + return } c.Queue.Add(key) } @@ -603,7 +604,7 @@ func max(x int, y int) int { return y } -//limit +// limit func limit(x int, burstReplicas uint) int { replicas := int(burstReplicas) if x <= 0 { diff --git a/pkg/virt-controller/watch/vm.go b/pkg/virt-controller/watch/vm.go index 3613ff52acb0..b34bd7fe99a8 100644 --- a/pkg/virt-controller/watch/vm.go +++ b/pkg/virt-controller/watch/vm.go @@ -1643,6 +1643,7 @@ func (c *VMController) enqueueVm(obj interface{}) { key, err := controller.KeyFunc(vm) if err != nil { logger.Object(vm).Reason(err).Error(failedExtractVmkeyFromVmErrMsg) + return } c.Queue.Add(key) } diff --git a/pkg/virt-controller/watch/vmi.go b/pkg/virt-controller/watch/vmi.go index 3d68537b2f1e..718639d8409f 100644 --- a/pkg/virt-controller/watch/vmi.go +++ b/pkg/virt-controller/watch/vmi.go @@ -1415,6 +1415,7 @@ func (c *VMIController) enqueueVirtualMachine(obj interface{}) { key, err := controller.KeyFunc(vmi) if err != nil { logger.Object(vmi).Reason(err).Error("Failed to extract key from virtualmachine.") + return } c.Queue.Add(key) } diff --git a/pkg/virt-controller/watch/workload-updater/workload-updater.go b/pkg/virt-controller/watch/workload-updater/workload-updater.go index 66e49676c6b6..b955d14b2e90 100644 --- a/pkg/virt-controller/watch/workload-updater/workload-updater.go +++ b/pkg/virt-controller/watch/workload-updater/workload-updater.go @@ -210,6 +210,7 @@ func (c *WorkloadUpdateController) enqueueKubeVirt(obj interface{}) { key, err := controller.KeyFunc(kv) if err != nil { logger.Object(kv).Reason(err).Error("Failed to extract key from KubeVirt.") + return } c.queue.AddAfter(key, defaultThrottleIntervalSeconds) } diff --git a/pkg/virt-operator/kubevirt.go b/pkg/virt-operator/kubevirt.go index 640750c7a4a0..2c2ee9259974 100644 --- a/pkg/virt-operator/kubevirt.go +++ b/pkg/virt-operator/kubevirt.go @@ -549,6 +549,7 @@ func (c *KubeVirtController) enqueueKubeVirt(obj interface{}) { key, err := controller.KeyFunc(kv) if err != nil { logger.Object(kv).Reason(err).Error("Failed to extract key from KubeVirt.") + return } c.delayedQueueAdder(key, c.queue) }