This commit is contained in:
mr
2025-04-28 14:01:57 +02:00
parent 83d118fb05
commit 93f3806b86
4 changed files with 86 additions and 82 deletions

32
main.go
View File

@@ -84,11 +84,11 @@ func main() {
err := new_wf.LoadFrom(conf.GetConfig().WorkflowID, conf.GetConfig().PeerID)
if err != nil {
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)
_, argo_file_path, 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())
@@ -100,20 +100,22 @@ func main() {
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())
}
/*
THIS FAILED FOR LOCAL ARGO ACTIONS ! IN PURPOSE OF MAIN KEEPING DEMO AVAILABLE i comment it
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