oc-schedulerd/main.go

48 lines
877 B
Go
Raw Normal View History

2023-10-18 17:08:53 +02:00
package main
import (
"fmt"
2023-10-18 17:08:53 +02:00
"os"
"time"
2024-07-03 10:21:17 +02:00
conf "oc-scheduler/conf"
2023-10-18 17:08:53 +02:00
"github.com/rs/zerolog"
)
var log zerolog.Logger
func main() {
output := zerolog.ConsoleWriter{Out: os.Stdout, TimeFormat: time.RFC3339}
log = zerolog.New(output).With().Timestamp().Logger()
2024-07-03 10:21:17 +02:00
app_conf := conf.GetConfig()
apiurl := app_conf.OcCatalogUrl
2023-10-18 17:08:53 +02:00
var g Graph
2023-10-18 17:08:53 +02:00
list, err := g.GetGraphList(apiurl)
if err != nil {
log.Fatal().Msg("Failed to get the workspaces list, check api url and that api server is up : " + apiurl)
}
2024-07-03 10:22:22 +02:00
println("Available workspaces :")
2023-10-18 17:08:53 +02:00
for workspace, _ := range list {
println(workspace)
}
2024-07-03 10:22:22 +02:00
if _, err := os.Stat("./argo_workflows/"); os.IsNotExist(err) {
os.Mkdir("./argo_workflows/",0755)
log.Info().Msg("Created argo_workflows/")
}
g.LoadFrom(list["test-alpr"])
2024-05-03 10:58:06 +02:00
g.ExportToArgo("test-alpr")
2024-07-03 10:22:22 +02:00
for(1 == 1){
fmt.Print("")
}
fmt.Print("stop")
2023-10-18 17:08:53 +02:00
}