Skip to content

Commit

Permalink
Fix linting issues:
Browse files Browse the repository at this point in the history
Signed-off-by: Jacob Weinstock <[email protected]>
  • Loading branch information
jacobweinstock committed Oct 10, 2024
1 parent da39f02 commit 00eee39
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 23 deletions.
3 changes: 1 addition & 2 deletions internal/deprecated/workflow/post.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ func (s *state) postActions(ctx context.Context) (reconcile.Result, error) {
}

// 2. Handle ISO eject scenario.
switch s.workflow.Spec.BootOptions.BootMode {
case v1alpha1.BootModeISO:
if s.workflow.Spec.BootOptions.BootMode == v1alpha1.BootModeISO {
if s.hardware == nil {
return reconcile.Result{}, errors.New("hardware is nil")
}
Expand Down
16 changes: 0 additions & 16 deletions internal/deprecated/workflow/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,22 +227,6 @@ func (r *Reconciler) processNewWorkflow(ctx context.Context, logger logr.Logger,
return reconcile.Result{Requeue: true}, nil
}

/*
// handle boot target if requested
switch stored.Spec.BootOptions.BootTarget {
case v1alpha1.BootTargetNetwork:
// netboot the hardware if requested
if stored.Spec.BootOptions.OneTimeNetboot {
stored.Status.State = v1alpha1.WorkflowStateWaiting
return reconcile.Result{Requeue: true}, err
}
case v1alpha1.BootTargetCDROM:
// TODO(jacobweinstock): add status if isoURL is not set
stored.Status.State = v1alpha1.WorkflowStateWaiting
return reconcile.Result{Requeue: true}, err
}
*/

stored.Status.State = v1alpha1.WorkflowStatePending
return reconcile.Result{}, nil
}
Expand Down
7 changes: 2 additions & 5 deletions internal/server/kubernetes_api_workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,10 @@ func (s *KubernetesBackedServer) GetWorkflowContexts(req *proto.WorkflowContextR
return err
}
for _, wf := range wflows {
// Don't serve Actions when in a v1alpha1.WorkflowStateWaiting state.
// Don't serve Actions when in a v1alpha1.WorkflowStatePreparing state.
// This is to prevent the worker from starting Actions before Workflow boot options are performed.
if wf.Spec.BootOptions.BootMode != "" && wf.Status.State == v1alpha1.WorkflowStatePreparing {
//if wf.Spec.BootOptions.ToggleAllowNetboot || wf.Spec.BootOptions.OneTimeNetboot {
//if wf.Status.State == v1alpha1.WorkflowStateWaiting {
continue
//}
}
if err := stream.Send(getWorkflowContext(wf)); err != nil {
return err
Expand Down Expand Up @@ -162,7 +159,7 @@ cont:
}
// Mark success on last action success
if wfContext.CurrentActionIndex+1 == wfContext.TotalNumberOfActions {
// wf.Status.State = v1alpha1.WorkflowState(proto.State_name[int32(wfContext.CurrentActionState)])
// Set the state to POST instead of Success to allow any post tasks to run.
wf.Status.State = v1alpha1.WorkflowStatePost
}
case proto.State_STATE_PENDING:
Expand Down

0 comments on commit 00eee39

Please sign in to comment.