debug
This commit is contained in:
parent
feca395039
commit
696493fe5a
@ -2,13 +2,11 @@ FROM golang:alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
COPY . .
|
||||
RUN apt install tar/stable
|
||||
RUN go build .
|
||||
|
||||
FROM argoproj/argocd:latest
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=builder /bin/tar /bin/tar
|
||||
COPY conf/docker_ocmonitord_conf.json /app/conf/
|
||||
COPY --from=builder /app/oc-monitord .
|
@ -1,3 +0,0 @@
|
||||
{
|
||||
"oc-catalog": "https://oc-catalog:8087"
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
{
|
||||
"oc-catalog": "https://localhost:8087"
|
||||
}
|
15
main.go
15
main.go
@ -115,6 +115,7 @@ func executeWorkflow(argo_file_path string) {
|
||||
// var stderr io.ReadCloser
|
||||
var err error
|
||||
cmd := exec.Command("argo", "submit", "--watch", "./argo_workflows/"+argo_file_path, "--serviceaccount=argo", "-n", "argo")
|
||||
fmt.Println(cmd)
|
||||
if stdout, err = cmd.StdoutPipe(); err != nil {
|
||||
wf_logger.Error().Msg("Could not retrieve stdoutpipe " + err.Error())
|
||||
return
|
||||
@ -199,18 +200,17 @@ func loadConfig(is_k8s bool, parser *argparse.Parser) {
|
||||
}
|
||||
|
||||
func setConf(is_k8s bool, o *onion.Onion, parser *argparse.Parser) {
|
||||
mongo := ""
|
||||
db := ""
|
||||
if is_k8s {
|
||||
conf.GetConfig().LokiURL = o.GetStringDefault("lokiurl", "http://127.0.0.1:3100")
|
||||
conf.GetConfig().ExecutionID = o.GetString("workflow")
|
||||
mongo = o.GetStringDefault("mongourl", "mongodb://127.0.0.1:27017")
|
||||
db = o.GetStringDefault("database", "DC_myDC")
|
||||
mongo := o.GetStringDefault("mongourl", "mongodb://127.0.0.1:27017")
|
||||
db := o.GetStringDefault("database", "DC_myDC")
|
||||
oclib.SetConfig(mongo, db)
|
||||
} else {
|
||||
url := parser.String("u", "url", &argparse.Options{Required: true, Default: "http://127.0.0.1:3100", Help: "Url to the Loki database logs will be sent to"})
|
||||
workflow := parser.String("w", "workflow", &argparse.Options{Required: true, Help: "Execution ID of the workflow to request from oc-catalog API"})
|
||||
mongo = *parser.String("m", "mongo", &argparse.Options{Required: true, Help: "URL to reach the MongoDB"})
|
||||
db = *parser.String("d", "database", &argparse.Options{Required: true, Help: "Name of the database to query in MongoDB"})
|
||||
mongo := parser.String("m", "mongo", &argparse.Options{Required: true, Default: "mongodb://127.0.0.1:27017", Help: "URL to reach the MongoDB"})
|
||||
db := parser.String("d", "database", &argparse.Options{Required: true, Default: "DC_myDC", Help: "Name of the database to query in MongoDB"})
|
||||
err := parser.Parse(os.Args)
|
||||
if err != nil {
|
||||
fmt.Println(parser.Usage(err))
|
||||
@ -218,8 +218,9 @@ func setConf(is_k8s bool, o *onion.Onion, parser *argparse.Parser) {
|
||||
}
|
||||
conf.GetConfig().LokiURL = *url
|
||||
conf.GetConfig().ExecutionID = *workflow
|
||||
oclib.SetConfig(*mongo, *db)
|
||||
}
|
||||
oclib.SetConfig(mongo, db)
|
||||
|
||||
}
|
||||
|
||||
func initOnion(o *onion.Onion) *onion.Onion {
|
||||
|
BIN
oc-monitord
BIN
oc-monitord
Binary file not shown.
@ -26,7 +26,7 @@ type Workflow struct {
|
||||
ApiVersion string `yaml:"apiVersion"`
|
||||
Kind string `yaml:"kind"`
|
||||
Metadata struct {
|
||||
Name string `yaml:"Name"`
|
||||
Name string `yaml:"name"`
|
||||
} `yaml:"metadata"`
|
||||
Spec Spec `yaml:"spec,omitempty"`
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user