diff --git a/config/crd/bases/tinkerbell.org_hardware.yaml b/config/crd/bases/tinkerbell.org_hardware.yaml index 0a535e630..c52f13bb7 100644 --- a/config/crd/bases/tinkerbell.org_hardware.yaml +++ b/config/crd/bases/tinkerbell.org_hardware.yaml @@ -108,6 +108,7 @@ spec: format: int64 type: integer mac: + pattern: ([0-9a-f]{2}[:]){5}([0-9a-f]{2}) type: string name_servers: items: diff --git a/pkg/apis/core/v1alpha1/hardware_types.go b/pkg/apis/core/v1alpha1/hardware_types.go index 5b1037cb4..cdcc6e61d 100644 --- a/pkg/apis/core/v1alpha1/hardware_types.go +++ b/pkg/apis/core/v1alpha1/hardware_types.go @@ -115,6 +115,7 @@ type OSIE struct { // DHCP configuration. type DHCP struct { + // +kubebuilder:validation:Pattern="([0-9a-f]{2}[:]){5}([0-9a-f]{2})" MAC string `json:"mac,omitempty"` Hostname string `json:"hostname,omitempty"` LeaseTime int64 `json:"lease_time,omitempty"`