diff --git a/models/links.go b/models/links.go index 02ba8a7..5c9d396 100644 --- a/models/links.go +++ b/models/links.go @@ -49,7 +49,5 @@ func NewLink(src ResourceObject, srcId string, dst ResourceObject, dstId string) return } -// So far only computing components expect the ID of the DC in their attributes -// func (l *Link) AddLinkToDataCenter(component models.ComputingModel) { -// } + diff --git a/models/schedule.go b/models/schedule.go index d157166..1f747b4 100644 --- a/models/schedule.go +++ b/models/schedule.go @@ -99,7 +99,7 @@ func CheckSchedule(cronString string, duration uint, cronFirstDate, cronLastDate return errors.New("Bad cron message: " + err.Error()) } - dcModel := GetDatacenterFromAcronym(services.DC_NAME) + dcModel := GetDatacenterFromAcronym(services.DC_NAME) if dcModel == nil { return errors.New("The DC " + services.DC_NAME + " doesn't have any DC model with that acronym") } diff --git a/out/docs/UML/plantuml/diagram_object_models/diagram_object_models.png b/out/docs/UML/plantuml/diagram_object_models/diagram_object_models.png deleted file mode 100644 index 6b837f1..0000000 Binary files a/out/docs/UML/plantuml/diagram_object_models/diagram_object_models.png and /dev/null differ diff --git a/services/discovery.go b/services/discovery.go index f533184..d49af38 100644 --- a/services/discovery.go +++ b/services/discovery.go @@ -3,6 +3,8 @@ package services import ( "os" + conf "cloud.o-forge.io/core/oc-catalog/conf" + SelfAPI "cloud.o-forge.io/core/oc-catalog/selfapi" "github.com/beego/beego/v2/core/logs" beego "github.com/beego/beego/v2/server/web" @@ -14,6 +16,7 @@ func GetSelfAPI(host string) *SelfAPI.APIClient { return SelfAPI.NewAPIClient(&SelfAPI.Configuration{BasePath: "http://" + host + "/v1"}) } +// Need to understand why there are so many different DC name func Discoveryinit() { dcNameOS := os.Getenv("DOCKER_DCNAME") @@ -32,4 +35,7 @@ func Discoveryinit() { DC_NAME = "DC_DEFAULT" logs.Warning("Default DC name is used") + // Quickfix for scheduling + DC_NAME = conf.GetConfig().DCNAME + } diff --git a/services/init.go b/services/init.go index 6f71a0c..2c483a8 100644 --- a/services/init.go +++ b/services/init.go @@ -5,7 +5,7 @@ import ( ) func Init() { - // Discoveryinit() //First init DC name + Discoveryinit() //First init DC name // var DBpoint string // var err error