Skip to content

Commit

Permalink
Adding a default value for hardware metadata state (#669)
Browse files Browse the repository at this point in the history
## Description
The metadata state field is consumed in CAPT for checking if a given hardware is [ready](https://github.com/tinkerbell/cluster-api-provider-tinkerbell/blob/main/controllers/machine.go#L97).

The changes sets a default value for the field to `provisioning` with kubebuilder defaults. Currently this field is left empty.

## Why is this needed
Boots and CAPT looks at `spec.metadata.state` to check if a hardware needs to be PXE served and if a hardware is ready.
Today a user is not expected to set the field but defaulting to `provisioning` helps provide context to the starting state of the tinkerbell provisioning process.
  • Loading branch information
mergify[bot] authored Jan 17, 2023
2 parents 07a611f + 0955770 commit ae32f7f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions api/v1alpha1/hardware_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ type IP struct {
}

type HardwareMetadata struct {
// +kubebuilder:default:=provisioning
State string `json:"state,omitempty"`
BondingMode int64 `json:"bonding_mode,omitempty"`
Manufacturer *MetadataManufacturer `json:"manufacturer,omitempty"`
Expand Down
1 change: 1 addition & 0 deletions config/crd/bases/tinkerbell.org_hardware.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ spec:
type: string
type: object
state:
default: provisioning
type: string
type: object
resources:
Expand Down

0 comments on commit ae32f7f

Please sign in to comment.