Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Commit

Permalink
Add debug
Browse files Browse the repository at this point in the history
  • Loading branch information
anandswaminathan committed Sep 29, 2020
1 parent e54c081 commit f616f34
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions go/tasks/plugins/array/k8s/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,26 +106,32 @@ func (e Executor) Handle(ctx context.Context, tCtx core.TaskExecutionContext) (c
err = nil

case arrayCore.PhaseCheckingSubTaskExecutions:
logger.Debugf(ctx, "In PhaseCheckingSubTaskExecutions [%v] - [%v]", tCtx, pluginState)
nextState, logLinks, err = LaunchAndCheckSubTasksState(ctx, tCtx, e.kubeClient, pluginConfig,
tCtx.DataStore(), tCtx.OutputWriter().GetOutputPrefixPath(), tCtx.OutputWriter().GetRawOutputPrefix(), pluginState)

case arrayCore.PhaseAssembleFinalOutput:
logger.Debugf(ctx, "In PhaseAssembleFinalOutput [%v] - [%v]", tCtx, pluginState)
nextState, err = array.AssembleFinalOutputs(ctx, e.outputsAssembler, tCtx, arrayCore.PhaseSuccess, pluginState)

case arrayCore.PhaseWriteToDiscoveryThenFail:
logger.Debugf(ctx, "In PhaseWriteToDiscoveryThenFail [%v] - [%v]", tCtx, pluginState)
nextState, err = array.WriteToDiscovery(ctx, tCtx, pluginState, arrayCore.PhaseAssembleFinalError)

case arrayCore.PhaseWriteToDiscovery:
logger.Debugf(ctx, "In PhaseWriteToDiscovery [%v] - [%v]", tCtx, pluginState)
nextState, err = array.WriteToDiscovery(ctx, tCtx, pluginState, arrayCore.PhaseAssembleFinalOutput)

case arrayCore.PhaseAssembleFinalError:
logger.Debugf(ctx, "In PhaseAssembleFinalError [%v] - [%v]", tCtx, pluginState)
nextState, err = array.AssembleFinalOutputs(ctx, e.errorAssembler, tCtx, arrayCore.PhaseRetryableFailure, pluginState)

default:
nextState = pluginState
err = nil
}
if err != nil {
logger.Errorf(ctx, "K8s array transition failed %v", err)
return core.UnknownTransition, err
}

Expand Down
3 changes: 2 additions & 1 deletion go/tasks/plugins/array/k8s/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ func LaunchAndCheckSubTasksState(ctx context.Context, tCtx core.TaskExecutionCon

var monitorResult MonitorResult
monitorResult, err = task.Monitor(ctx, tCtx, kubeClient, dataStore, outputPrefix, baseOutputDataSandbox)
if monitorResult != MonitorSuccess {
logger.Debugf(ctx, "K8s array task monitor %v - %v - %v", task, monitorResult, err)
if err != nil || monitorResult != MonitorSuccess {
return currentState, logLinks, err
}
}
Expand Down

0 comments on commit f616f34

Please sign in to comment.