Adapted some of the steps of the executeInside()'s method to work with the updated Admiralty environment, using execution id as namespace, serviceAccount naming convention and adding the serviceAccount in the workflow's YAML. Logging not working yet.
This commit is contained in:
13
main.go
13
main.go
@@ -96,12 +96,12 @@ func main() {
|
||||
logger.Error().Msg(err.Error())
|
||||
}
|
||||
|
||||
argo_file_path, err := builder.CompleteBuild(exec.ExecutionsID)
|
||||
argoFilePath, err := builder.CompleteBuild(exec.ExecutionsID)
|
||||
if err != nil {
|
||||
logger.Error().Msg(err.Error())
|
||||
}
|
||||
|
||||
workflowName = getContainerName(argo_file_path)
|
||||
workflowName = getContainerName(argoFilePath)
|
||||
|
||||
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")
|
||||
@@ -110,11 +110,12 @@ func main() {
|
||||
if conf.GetConfig().KubeHost == "" {
|
||||
// Not in a k8s environment, get conf from parameters
|
||||
fmt.Println("Executes outside of k8s")
|
||||
executeOutside(argo_file_path, stepMax, builder.Workflow)
|
||||
executeOutside(argoFilePath, stepMax, builder.Workflow)
|
||||
} else {
|
||||
// Executed in a k8s environment
|
||||
fmt.Println("Executes inside a k8s")
|
||||
executeInside(exec.GetID(), "argo", argo_file_path, stepMax)
|
||||
// executeInside(exec.GetID(), "argo", argo_file_path, stepMax) // commenting to use conf.ExecutionID instead of exec.GetID()
|
||||
executeInside(conf.GetConfig().ExecutionID, conf.GetConfig().ExecutionID, argoFilePath, stepMax)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -294,6 +295,8 @@ func setConf(is_k8s bool, o *onion.Onion, parser *argparse.Parser) {
|
||||
host := parser.String("H", "host", &argparse.Options{Required: false, Default: "", Help: "Host for the Kubernetes cluster"})
|
||||
port := parser.String("P", "port", &argparse.Options{Required: false, Default: "6443", Help: "Port for the Kubernetes cluster"})
|
||||
|
||||
// argoHost := parser.String("h", "argoHost", &argparse.Options{Required: false, Default: "", Help: "Host where Argo is running from"}) // can't use -h because its reserved to help
|
||||
|
||||
err := parser.Parse(os.Args)
|
||||
if err != nil {
|
||||
fmt.Println(parser.Usage(err))
|
||||
@@ -311,6 +314,8 @@ func setConf(is_k8s bool, o *onion.Onion, parser *argparse.Parser) {
|
||||
conf.GetConfig().KubeHost = *host
|
||||
conf.GetConfig().KubePort = *port
|
||||
|
||||
// conf.GetConfig().ArgoHost = *argoHost
|
||||
|
||||
decoded, err := base64.StdEncoding.DecodeString(*ca)
|
||||
if err == nil {
|
||||
conf.GetConfig().KubeCA = string(decoded)
|
||||
|
||||
Reference in New Issue
Block a user