mirror of
https://github.com/kerberos-io/agent.git
synced 2026-10-25 18:38:23 +00:00
fix for updating older agents
This commit is contained in:
@@ -33,10 +33,7 @@ func AddRoutes(r *gin.Engine, authMiddleware *jwt.GinJWTMiddleware, configuratio
|
||||
var conf models.Config
|
||||
c.BindJSON(&conf)
|
||||
|
||||
if os.Getenv("DEPLOYMENT") == "" || os.Getenv("DEPLOYMENT") == "agent" {
|
||||
res, _ := json.MarshalIndent(conf, "", "\t")
|
||||
ioutil.WriteFile("./data/config/config.json", res, 0644)
|
||||
} else if os.Getenv("DEPLOYMENT") == "factory" {
|
||||
if os.Getenv("DEPLOYMENT") == "factory" || os.Getenv("MACHINERY_ENVIRONMENT") == "kubernetes" {
|
||||
// Write to mongodb
|
||||
session := database.New().Copy()
|
||||
defer session.Close()
|
||||
@@ -47,6 +44,9 @@ func AddRoutes(r *gin.Engine, authMiddleware *jwt.GinJWTMiddleware, configuratio
|
||||
"type": "config",
|
||||
"name": os.Getenv("DEPLOYMENT_NAME"),
|
||||
}, &conf)
|
||||
} else if os.Getenv("DEPLOYMENT") == "" || os.Getenv("DEPLOYMENT") == "agent" {
|
||||
res, _ := json.MarshalIndent(conf, "", "\t")
|
||||
ioutil.WriteFile("./data/config/config.json", res, 0644)
|
||||
}
|
||||
|
||||
select {
|
||||
|
||||
Reference in New Issue
Block a user