Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
Signed-off-by: Abhinav Pandey <abhinavmpandey08@gmail.com>
  • Loading branch information
abhinavmpandey08 committed Feb 1, 2022
1 parent fb91790 commit 753d39d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
3 changes: 2 additions & 1 deletion api/v1beta1/tinkerbellmachine_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ type TinkerbellMachineSpec struct {
// +optional
ImageLookupOSVersion string `json:"imageLookupOSVersion,omitempty"`

// TemplateOverride overrides the default CAPT hardware template
// TemplateOverride overrides the default Tinkerbell template used by CAPT.
// You can learn more about Tinkerbell templates here: https://docs.tinkerbell.org/templates/
// +optional
TemplateOverride string `json:"templateOverride,omitempty"`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,9 @@ spec:
providerID:
type: string
templateOverride:
description: TemplateOverride overrides the default CAPT hardware
template
description: 'TemplateOverride overrides the default Tinkerbell template
used by CAPT. You can learn more about Tinkerbell templates here:
https://docs.tinkerbell.org/templates/'
type: string
type: object
status:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,9 @@ spec:
providerID:
type: string
templateOverride:
description: TemplateOverride overrides the default CAPT hardware
template
description: 'TemplateOverride overrides the default Tinkerbell
template used by CAPT. You can learn more about Tinkerbell
templates here: https://docs.tinkerbell.org/templates/'
type: string
type: object
required:
Expand Down
8 changes: 4 additions & 4 deletions controllers/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,12 @@ func (mrc *machineReconcileContext) imageURL() (string, error) {
}

func (mrc *machineReconcileContext) createTemplate(hardware *tinkv1.Hardware) error {
if len(hardware.Status.Disks) < 1 {
return ErrHardwareMissingDiskConfiguration
}

templateData := mrc.tinkerbellMachine.Spec.TemplateOverride
if templateData == "" {
if len(hardware.Status.Disks) < 1 {
return ErrHardwareMissingDiskConfiguration
}

targetDisk := hardware.Status.Disks[0].Device
targetDevice := firstPartitionFromDevice(targetDisk)

Expand Down

0 comments on commit 753d39d

Please sign in to comment.