Skip to content

Commit

Permalink
Validate mac address on Hardware spec:
Browse files Browse the repository at this point in the history
This only allows lower case mac addresses.
This simplifies matching/looking up mac addresses.
Without this values could be upper case or mixed case.
Upper case and mixed cases will cause clients to miss
lookups if using the wrong case. This standardized to lowercase
to remove this error prone interaction.

Signed-off-by: Jacob Weinstock <[email protected]>
  • Loading branch information
jacobweinstock committed Jun 14, 2022
1 parent 9039877 commit dfa33fc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkg/apis/core/v1alpha1/hardware_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ type HardwareList struct {
// +kubebuilder:resource:path=hardware,scope=Namespaced,categories=tinkerbell,singular=hardware,shortName=hw
// +kubebuilder:storageversion
// +kubebuilder:printcolumn:JSONPath=".status.state",name=State,type=string
// +kubebuilder:validation:JSONPath=".spec.interfaces.dhcp.mac":Pattern=([0-9a-f]{2}[:]){5}([0-9a-f]{2})

// Hardware is the Schema for the Hardware API.
type Hardware struct {
Expand Down

0 comments on commit dfa33fc

Please sign in to comment.