Skip to content

Commit 94cdfc4

Browse files
committed
replace clientIDs by clientID
1 parent 5feac80 commit 94cdfc4

File tree

4 files changed

+5
-12
lines changed

4 files changed

+5
-12
lines changed

api/v1beta1/dhcphosts_types.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
// DnsmasqDhcpHost holds the mapping between Macs and IP that will be added to dnsmasq dhcp-hosts file.
2424
type DhcpHost struct {
2525
Macs []string `json:"macs,omitempty"`
26-
ClientIDs []string `json:"clientIDs,omitempty"`
26+
ClientID string `json:"clientID,omitempty"`
2727
SetTags []string `json:"setTags,omitempty"`
2828
Tags []string `json:"tags,omitempty"`
2929
IP string `json:"ip,omitempty"`

api/v1beta1/zz_generated.deepcopy.go

-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/dnsmasq.kvaps.cf_dhcphosts.yaml

+2-4
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,8 @@ spec:
4949
description: DnsmasqDhcpHost holds the mapping between Macs and IP
5050
that will be added to dnsmasq dhcp-hosts file.
5151
properties:
52-
clientIDs:
53-
items:
54-
type: string
55-
type: array
52+
clientID:
53+
type: string
5654
hostname:
5755
type: string
5856
ignore:

controllers/dhcphosts_controller.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ func (r *DhcpHostsReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) {
8181
for _, v := range h.Macs {
8282
configLine += "," + v
8383
}
84-
for _, v := range h.ClientIDs {
85-
configLine += ",id:" + v
84+
if h.ClientID != "" {
85+
configLine += ",id:" + h.ClientID
8686
}
8787
for _, v := range h.SetTags {
8888
configLine += ",set:" + v

0 commit comments

Comments
 (0)