Finished to implement admiralty onto the final argo yaml file and restructured file creation

This commit is contained in:
pb
2025-04-02 11:40:14 +02:00
parent 73e1747c91
commit 08ade1af66
5 changed files with 125 additions and 54 deletions

33
main.go
View File

@@ -88,32 +88,33 @@ func main() {
logger.Error().Msg("Could not retrieve workflow " + conf.GetConfig().WorkflowID + " from oc-catalog API")
}
builder, argo_file_path, stepMax, err := new_wf.ExportToArgo(exec.ExecutionsID, conf.GetConfig().Timeout)
builder, stepMax, err := new_wf.ExportToArgo(exec.ExecutionsID, conf.GetConfig().Timeout)
if err != nil {
logger.Error().Msg("Could not create the Argo file for " + conf.GetConfig().WorkflowID)
logger.Error().Msg(err.Error())
}
logger.Debug().Msg("Created :" + argo_file_path)
argo_file_path, err := builder.CompleteBuild(exec.ExecutionsID)
if err != nil {
logger.Error().Msg(err.Error())
}
workflowName = getContainerName(argo_file_path)
wf_logger = logger.With().Str("argo_name", workflowName).Str("workflow_id", conf.GetConfig().WorkflowID).Str("workflow_execution_id", conf.GetConfig().ExecutionID).Logger()
wf_logger.Debug().Msg("Testing argo name")
err = builder.CompleteBuild(exec.ExecutionsID)
if err != nil {
logger.Error().Msg(err.Error())
}
_ = stepMax
// if conf.GetConfig().KubeHost == "" {
// // Not in a k8s environment, get conf from parameters
// fmt.Println("Executes outside of k8s")
// executeOutside(argo_file_path, stepMax)
// } else {
// // Executed in a k8s environment
// fmt.Println("Executes inside a k8s")
// executeInside(exec.GetID(), "argo", argo_file_path, stepMax)
// }
if conf.GetConfig().KubeHost == "" {
// Not in a k8s environment, get conf from parameters
fmt.Println("Executes outside of k8s")
executeOutside(argo_file_path, stepMax)
} else {
// Executed in a k8s environment
fmt.Println("Executes inside a k8s")
executeInside(exec.GetID(), "argo", argo_file_path, stepMax)
}
}
// So far we only log the output from