moved the logger creation to the utils package to make them available to all packages without recreating or passing them
This commit is contained in:
@@ -66,6 +66,8 @@ func (k *KubernetesTools) LogWorkflow(execID string, namespace string, workflowN
|
||||
return errors.New("Could not retrieve workflow ID from execution ID " + execID)
|
||||
}
|
||||
if exec.State == enum.DRAFT || exec.State == enum.FAILURE || exec.State == enum.SUCCESS {
|
||||
l := utils.GetWFLogger("")
|
||||
l.Error().Msg("The execution's state doesn't meet requirement, state is : " + exec.State.String())
|
||||
return nil
|
||||
}
|
||||
k.logWorkflow(namespace, workflowName, argoFilePath, stepMax, current_watch, previous_watch, argoLogs, seen, logFunc)
|
||||
@@ -76,6 +78,7 @@ func (k *KubernetesTools) logWorkflow(namespace string, workflowName string, arg
|
||||
seen []string,
|
||||
logFunc func(argoFilePath string, stepMax int, pipe io.ReadCloser, current_watch *models.ArgoWatch, previous_watch *models.ArgoWatch, argoLogs *models.ArgoLogs, seen []string, wg *sync.WaitGroup)) error {
|
||||
// List pods related to the Argo workflow
|
||||
fmt.Println("\n!!!!!!!! !!!!!!!!!! !!!!!!!! &&&& & STARTING LOG\n\n")
|
||||
labelSelector := fmt.Sprintf("workflows.argoproj.io/workflow=%s", workflowName)
|
||||
for retries := 0; retries < 10; retries++ { // Retry for up to ~20 seconds
|
||||
// List workflow pods
|
||||
|
Reference in New Issue
Block a user