File tree Expand file tree Collapse file tree 2 files changed +13
-10
lines changed Expand file tree Collapse file tree 2 files changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -143,21 +143,22 @@ func (scope *machineReconcileScope) reconcile(hw *tinkv1.Hardware) error {
143
143
return fmt .Errorf ("ensure template and workflow returned: %w" , err )
144
144
}
145
145
146
- if wf .Status .State == tinkv1 .WorkflowStateFailed || wf .Status .State == tinkv1 .WorkflowStateTimeout {
146
+ // STATE_* is needed for Helm charts <= 0.6.2
147
+ switch wf .Status .State {
148
+ case tinkv1 .WorkflowStateFailed , tinkv1 .WorkflowState ("STATE_FAILED" ):
147
149
return errWorkflowFailed
148
- }
150
+ case tinkv1 .WorkflowStateTimeout , tinkv1 .WorkflowState ("STATE_TIMEOUT" ):
151
+ return errWorkflowTimeout
152
+ case tinkv1 .WorkflowStateSuccess , tinkv1 .WorkflowState ("STATE_SUCCESS" ):
153
+ scope .log .Info ("Marking TinkerbellMachine as Ready" )
154
+ scope .tinkerbellMachine .Status .Ready = true
149
155
150
- if wf .Status .State != tinkv1 .WorkflowStateSuccess {
156
+ if err := scope .patchHardwareAnnotations (hw , map [string ]string {HardwareProvisionedAnnotation : "true" }); err != nil {
157
+ return fmt .Errorf ("failed to patch hardware: %w" , err )
158
+ }
151
159
return nil
152
160
}
153
161
154
- scope .log .Info ("Marking TinkerbellMachine as Ready" )
155
- scope .tinkerbellMachine .Status .Ready = true
156
-
157
- if err := scope .patchHardwareAnnotations (hw , map [string ]string {HardwareProvisionedAnnotation : "true" }); err != nil {
158
- return fmt .Errorf ("failed to patch hardware: %w" , err )
159
- }
160
-
161
162
return nil
162
163
}
163
164
Original file line number Diff line number Diff line change @@ -18,6 +18,8 @@ import (
18
18
// errWorkflowFailed is the error returned when the workflow fails.
19
19
var errWorkflowFailed = errors .New ("workflow failed" )
20
20
21
+ var errWorkflowTimeout = errors .New ("workflow timed out" )
22
+
21
23
// errISOBootURLRequired is the error returned when the isoURL is required for iso boot mode.
22
24
var errISOBootURLRequired = errors .New ("iso boot mode requires an isoURL" )
23
25
You can’t perform that action at this time.
0 commit comments