Use regular conf oclib library instead of custom implem to leverage env variable injection fonctionality; Dockerfile refactor
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"oc-schedulerd/conf"
|
||||
"os/exec"
|
||||
|
||||
oclib "cloud.o-forge.io/core/oc-lib"
|
||||
"github.com/rs/zerolog"
|
||||
)
|
||||
|
||||
@@ -30,7 +31,7 @@ func (lm *LocalMonitor) LaunchLocalMonitor() {
|
||||
}
|
||||
|
||||
func (lm *LocalMonitor) execLocalKube() {
|
||||
args := []string{"-e", lm.ExecutionID, "-u", lm.LokiURL, "-m", conf.GetConfig().MongoUrl, "-d", conf.GetConfig().DBName}
|
||||
args := []string{"-e", lm.ExecutionID, "-u", lm.LokiURL, "-m", oclib.GetConfig().MongoUrl, "-d", oclib.GetConfig().MongoDatabase}
|
||||
if lm.Duration > 0 {
|
||||
args = append(args, "-t", fmt.Sprintf("%d", lm.Duration))
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package daemons
|
||||
|
||||
import (
|
||||
"oc-schedulerd/conf"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
@@ -49,10 +48,10 @@ func (em *ExecutionManager) executeBooking(booking *workflow_execution.WorkflowE
|
||||
duration = int(booking.EndDate.Sub(*booking.ExecDate).Seconds())
|
||||
}
|
||||
monitor := LocalMonitor{
|
||||
Logger: logger,
|
||||
Duration: duration,
|
||||
LokiURL: conf.GetConfig().LokiUrl,
|
||||
KubeURL: "localhost",
|
||||
Logger: logger,
|
||||
Duration: duration,
|
||||
LokiURL: oclib.GetConfig().LokiUrl,
|
||||
KubeURL: "localhost",
|
||||
ExecutionID: booking.UUID,
|
||||
}
|
||||
monitor.LaunchLocalMonitor()
|
||||
|
||||
@@ -3,7 +3,6 @@ package daemons
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"oc-schedulerd/conf"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
@@ -64,7 +63,7 @@ type ScheduleManager struct {
|
||||
// on workflows' scheduling. Messages must contain
|
||||
// workflow execution ID, to allow retrieval of execution infos
|
||||
func (s *ScheduleManager) ListenNATS() {
|
||||
nc, err := nats.Connect(conf.GetConfig().NatsUrl)
|
||||
nc, err := nats.Connect(oclib.GetConfig().NATSUrl)
|
||||
if err != nil {
|
||||
s.Logger.Error().Msg("Could not connect to NATS")
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user