Skip to content

Commit

Permalink
Introduce IPv6 OOB plugin (#134)
Browse files Browse the repository at this point in the history
* Introduce IPv6 OOB plugin

IPv4 implementation still to come

* Remove not needed function
  • Loading branch information
damyan authored Apr 22, 2024
1 parent 242ab3c commit 7125197
Show file tree
Hide file tree
Showing 5 changed files with 505 additions and 3 deletions.
2 changes: 2 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import (
pl_bluefield "github.com/ironcore-dev/fedhcp/plugins/bluefield"
pl_ipam "github.com/ironcore-dev/fedhcp/plugins/ipam"
pl_onmetal "github.com/ironcore-dev/fedhcp/plugins/onmetal"
pl_oob "github.com/ironcore-dev/fedhcp/plugins/oob"
pl_pxeboot "github.com/ironcore-dev/fedhcp/plugins/pxeboot"

"github.com/sirupsen/logrus"
Expand Down Expand Up @@ -82,6 +83,7 @@ var desiredPlugins = []*plugins.Plugin{
&pl_bluefield.Plugin,
&pl_ipam.Plugin,
&pl_onmetal.Plugin,
&pl_oob.Plugin,
&pl_pxeboot.Plugin,
}

Expand Down
4 changes: 2 additions & 2 deletions plugins/ipam/k8s.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func (k K8sClient) createIpamIP(ipaddr net.IP, mac net.HardwareAddr) error {
return err
}
if ipamIP != nil {
err = k.doCreateIpamIP(ipamIP, subnetName)
err = k.doCreateIpamIP(ipamIP)
if err != nil {
return err
}
Expand Down Expand Up @@ -237,7 +237,7 @@ func (k K8sClient) waitForDeletion(ipamIP *ipamv1alpha1.IP) error {
return errors.New("timeout reached, IP not deleted")
}

func (k K8sClient) doCreateIpamIP(ipamIP *ipamv1alpha1.IP, subnetName string) error {
func (k K8sClient) doCreateIpamIP(ipamIP *ipamv1alpha1.IP) error {
err := k.Client.Create(k.Ctx, ipamIP)
if err != nil && !apierrors.IsAlreadyExists(err) {
return fmt.Errorf("failed to create IP %s/%s: %w", ipamIP.Namespace, ipamIP.Name, err)
Expand Down
2 changes: 1 addition & 1 deletion plugins/ipam/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var (

func parseArgs(args ...string) (string, []string, error) {
if len(args) < 2 {
return "", []string{""}, fmt.Errorf("At least two arguments must be passed to ipam plugin, a namespace and a comma-separated subnet names list, got %d", len(args))
return "", []string{""}, fmt.Errorf("at least two arguments must be passed to ipam plugin, a namespace and a comma-separated subnet names list, got %d", len(args))
}

namespace := args[0]
Expand Down
Loading

0 comments on commit 7125197

Please sign in to comment.