Skip to content

Commit 666d364

Browse files
Merge pull request #406 from jacobweinstock/iso-mounting
Add error handling for ISO boot mode: ## Description <!--- Please describe what this PR is going to change --> Error out when isoURL is empty and boot mode is iso. Also, always enable ToggleAllowNetboot. ## Why is this needed <!--- Link to issue you have raised --> Fixes: # ## How Has This Been Tested? <!--- Please describe in detail how you tested your changes. --> <!--- Include details of your testing environment, and the tests you ran to --> <!--- see how your change affects other areas of the code, etc. --> ## How are existing users impacted? What migration steps/scripts do we need? <!--- Fixes a bug, unblocks installation, removes a component of the stack etc --> <!--- Requires a DB migration script, etc. --> ## Checklist: I have: - [ ] updated the documentation and/or roadmap (if required) - [ ] added unit or e2e tests - [ ] provided instructions on how to upgrade
2 parents 92a81ef + 83879bc commit 666d364

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

controller/machine/workflow.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ func (scope *machineReconcileScope) createWorkflow(hw *tinkv1.Hardware) error {
5454
TemplateRef: scope.tinkerbellMachine.Name,
5555
HardwareRef: hw.Name,
5656
HardwareMap: map[string]string{"device_1": hw.Spec.Metadata.Instance.ID},
57+
BootOptions: tinkv1.BootOptions{
58+
ToggleAllowNetboot: true,
59+
},
5760
},
5861
}
5962

@@ -63,11 +66,12 @@ func (scope *machineReconcileScope) createWorkflow(hw *tinkv1.Hardware) error {
6366
switch scope.tinkerbellMachine.Spec.BootOptions.BootMode {
6467
case v1beta1.BootMode("netboot"):
6568
workflow.Spec.BootOptions.BootMode = tinkv1.BootMode("netboot")
66-
workflow.Spec.BootOptions.ToggleAllowNetboot = true
6769
case v1beta1.BootMode("iso"):
70+
if scope.tinkerbellMachine.Spec.BootOptions.ISOURL == "" {
71+
return fmt.Errorf("iso boot mode requires an isoURL")
72+
}
6873
workflow.Spec.BootOptions.BootMode = tinkv1.BootMode("iso")
6974
workflow.Spec.BootOptions.ISOURL = scope.tinkerbellMachine.Spec.BootOptions.ISOURL
70-
workflow.Spec.BootOptions.ToggleAllowNetboot = true
7175
}
7276
}
7377

0 commit comments

Comments
 (0)