From 70330ff017429d05160c5ddac6dc05f1fd146518 Mon Sep 17 00:00:00 2001 From: Axel Christ Date: Fri, 22 Sep 2023 17:07:43 +0200 Subject: [PATCH] Fix network interface status patching Currently, the network interface IP virtual IP / NAT IP is only patched if there was an error - this change fixes it to set it only when there is no error. --- controllers/networkinterface_controller.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/controllers/networkinterface_controller.go b/controllers/networkinterface_controller.go index 592730b..0fc601d 100644 --- a/controllers/networkinterface_controller.go +++ b/controllers/networkinterface_controller.go @@ -825,7 +825,7 @@ func (r *NetworkInterfaceReconciler) reconcile(ctx context.Context, log logr.Log Slot: pciAddr.Device, Function: pciAddr.Function, } - if virtualIPErr != nil { + if virtualIPErr == nil { nic.Status.VirtualIP = nic.Spec.VirtualIP } if natIPErr == nil { @@ -837,10 +837,10 @@ func (r *NetworkInterfaceReconciler) reconcile(ctx context.Context, log logr.Log } else { nic.Status.NatIP = nil } - if prefixesErr != nil { + if prefixesErr == nil { nic.Status.Prefixes = nic.Spec.Prefixes } - if lbTargetErr != nil { + if lbTargetErr == nil { nic.Status.LoadBalancerTargets = nic.Spec.LoadBalancerTargets } }); err != nil {