Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/go-logr/logr v1.2.4
github.com/google/uuid v1.3.0
github.com/onmetal/controller-utils v0.8.2
github.com/onmetal/metalnet v0.1.0
github.com/onmetal/metalnet v0.1.8
github.com/onmetal/onmetal-api v0.1.2-0.20230925221054-61f5769766f5
github.com/onsi/ginkgo/v2 v2.12.1
github.com/onsi/gomega v1.27.10
Expand Down
10 changes: 4 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -251,12 +251,10 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus=
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
github.com/onmetal/controller-utils v0.8.2 h1:dMPTWivqFVIkSbHRtG9Xue+kVR+Hqu3Ag8ULDBQg5Jo=
github.com/onmetal/controller-utils v0.8.2/go.mod h1:FNYXMHxQsZuEypdScP1ZEBK5i10XyCkNNGzhB6icglA=
github.com/onmetal/metalnet v0.1.0 h1:KnwFz7/3IA/WzPDZOcpVPzV1Y09y1LZWxsz8tWeAfbc=
github.com/onmetal/metalnet v0.1.0/go.mod h1:Vgl0Ux3wN6gpcA5D+I3uqiX+ApmV4eGEa1AgiyZ1SSw=
github.com/onmetal/metalnet v0.1.8 h1:u79ym5c9gdgVbvwVMvrVuJFRGh3ICNnISRiMazX+wzk=
github.com/onmetal/metalnet v0.1.8/go.mod h1:qmow/RHK+gtFSOFZ5IMqCr39feiWMTp5G23FtxznMpw=
github.com/onmetal/onmetal-api v0.1.2-0.20230925221054-61f5769766f5 h1:21mj4+i7USA6Nmhu2duK2d0/F0BaJUmKPb1uhkfVPSU=
github.com/onmetal/onmetal-api v0.1.2-0.20230925221054-61f5769766f5/go.mod h1:5eTd/SL3vtxCmLvL0EKmxkp6j+yUuHuM26rD7L5QuPQ=
github.com/onsi/ginkgo/v2 v2.12.1 h1:uHNEO1RP2SpuZApSkel9nEh1/Mu+hmQe7Q+Pepg5OYA=
Expand All @@ -282,8 +280,8 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0=
github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/soheilhy/cmux v0.1.5 h1:jjzc5WVemNEDTLwv9tlmemhC73tI08BNOIGwBOo10Js=
github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0=
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
Expand Down
9 changes: 9 additions & 0 deletions metalnetlet/controllers/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,15 @@ func workaroundMetalnetNoIPv6IPToIPs(metalnetVirtualIP *metalnetv1alpha1.IP) []m
return []metalnetv1alpha1.IP{*metalnetVirtualIP}
}

// workaroundMetalnetNoIPv6NATIPToIPs works around the missing public IPv6 support in metalnet by
// making a slice of the single virtual IP.
func workaroundMetalnetNoIPv6NATIPToIPs(natDetails *metalnetv1alpha1.NATDetails) []metalnetv1alpha1.IP {
if natDetails == nil {
return nil
}
return []metalnetv1alpha1.IP{*natDetails.IP}
}

// workaroundMetalnetNoIPv6NATDetailsToNATDetailsPointer works around the missing NAT IPv6 support in metalnet by
// returning only the IPv4 NAT details.
func workaroundMetalnetNoIPv6NATDetailsToNATDetailsPointer(natDetails []metalnetv1alpha1.NATDetails) *metalnetv1alpha1.NATDetails {
Expand Down
2 changes: 1 addition & 1 deletion metalnetlet/controllers/networkinterface_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ func (r *NetworkInterfaceReconciler) updateStatus(
nic.Status.PCIAddress = nil
}
nic.Status.PublicIPs = metalnetIPsToIPs(workaroundMetalnetNoIPv6IPToIPs(metalnetNic.Status.VirtualIP))
nic.Status.NATIPs = metalnetIPsToIPs(workaroundMetalnetNoIPv6IPToIPs(metalnetNic.Status.NatIP))
nic.Status.NATIPs = metalnetIPsToIPs(workaroundMetalnetNoIPv6NATIPToIPs(metalnetNic.Status.NatIP))
nic.Status.Prefixes = metalnetIPPrefixesToIPPrefixes(metalnetNic.Spec.Prefixes)
if err := r.Status().Patch(ctx, nic, client.MergeFrom(base)); err != nil {
return fmt.Errorf("error patching network interface status: %w", err)
Expand Down