Skip to content

Commit

Permalink
Fix network interface status patching
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
adracus authored and guvenc committed Sep 22, 2023
1 parent 62f3fda commit 70330ff
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions controllers/networkinterface_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down

0 comments on commit 70330ff

Please sign in to comment.