Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
Signed-off-by: Guvenc Gulce <guevenc.guelce@sap.com>
  • Loading branch information
guvenc committed Feb 17, 2025
1 parent 615ad58 commit 90067bd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 3 additions & 1 deletion controllers/networkinterface_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,9 @@ func (r *NetworkInterfaceReconciler) reconcile(ctx context.Context, log logr.Log
}
if r.TapDeviceMode {
pciAddr.Device = strings.ReplaceAll(strings.ReplaceAll(pciAddr.Device, ":", ""), ".", "")
nic.Status.TAPDevice.Name = pciAddr.Device
nic.Status.TAPDevice = &metalnetv1alpha1.TAPDevice{
Name: pciAddr.Device,
}
} else {
nic.Status.PCIAddress = &metalnetv1alpha1.PCIAddress{
Bus: pciAddr.Bus,
Expand Down
8 changes: 7 additions & 1 deletion netfns/netfns.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,13 @@ func (s *fileClaimStore) Create(uid types.UID, addr ghw.PCIAddress) error {
return ErrClaimAlreadyExists
}

data := []byte(addr.String())
var data []byte
if !s.isTAPStore {
data = []byte(addr.String())
} else {
data = []byte(addr.Device)
}

return os.WriteFile(filename, data, filePerm)
}

Expand Down

0 comments on commit 90067bd

Please sign in to comment.