Skip to content

Commit

Permalink
[DHCP] Add PXEURL to VPC DHCP Subnet config
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeymatov authored and Frostman committed Mar 6, 2024
1 parent e745ecf commit 70dcd3d
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions api/vpc/v1alpha2/vpc_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ type VPCDHCP struct {
Enable bool `json:"enable,omitempty"`
// Range is the DHCP range for the subnet if DHCP server is enabled
Range *VPCDHCPRange `json:"range,omitempty"`
// PXEURL is the URL for the PXE server if DHCP server is enabled
PXEURL string `json:"pxeURL,omitempty"`
}

// VPCDHCPRange defines the DHCP range for the subnet if DHCP server is enabled
Expand Down
1 change: 1 addition & 0 deletions cmd/hhfctl/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ func main() {
VLAN: cCtx.String("vlan"),
DHCP: vpcapi.VPCDHCP{
Enable: cCtx.Bool("dhcp"),
PXEURL: cCtx.String("dhcp-pxe-url"),
Range: &vpcapi.VPCDHCPRange{
Start: cCtx.String("dhcp-range-start"),
End: cCtx.String("dhcp-range-end"),
Expand Down
4 changes: 4 additions & 0 deletions config/crd/bases/agent.githedgehog.com_agents.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1162,6 +1162,10 @@ spec:
enable:
description: Enable enables DHCP server for the subnet
type: boolean
pxeURL:
description: PXEURL is the URL for the PXE server
if DHCP server is enabled
type: string
range:
description: Range is the DHCP range for the subnet
if DHCP server is enabled
Expand Down
4 changes: 4 additions & 0 deletions config/crd/bases/vpc.githedgehog.com_vpcs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ spec:
enable:
description: Enable enables DHCP server for the subnet
type: boolean
pxeURL:
description: PXEURL is the URL for the PXE server if DHCP
server is enabled
type: string
range:
description: Range is the DHCP range for the subnet if DHCP
server is enabled
Expand Down
1 change: 1 addition & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,7 @@ _Appears in:_
| `relay` _string_ | Relay is the DHCP relay IP address, if specified, DHCP server will be disabled |
| `enable` _boolean_ | Enable enables DHCP server for the subnet |
| `range` _[VPCDHCPRange](#vpcdhcprange)_ | Range is the DHCP range for the subnet if DHCP server is enabled |
| `pxeURL` _string_ | PXEURL is the URL for the PXE server if DHCP server is enabled |


#### VPCDHCPRange
Expand Down
1 change: 1 addition & 0 deletions pkg/ctrl/vpc/dhcpd.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ func (r *VPCReconciler) updateDHCPSubnets(ctx context.Context, vpc *vpcapi.VPC)
EndIP: end,
VRF: fmt.Sprintf("VrfV%s", vpc.Name), // TODO move to utils
CircuitID: fmt.Sprintf("Vlan%s", subnet.VLAN), // TODO move to utils
PXEURL: subnet.DHCP.PXEURL,
}

return nil
Expand Down

0 comments on commit 70dcd3d

Please sign in to comment.