Skip to content

Commit

Permalink
init config correctly
Browse files Browse the repository at this point in the history
Signed-off-by: MUzairS15 <[email protected]>
  • Loading branch information
MUzairS15 committed Jan 23, 2024
1 parent c829869 commit ad4a258
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,19 @@ func main() {
// no configs found from meshsync CRD log warning
log.Warn(err)
}
// Config init and seed
cfg, err := config.New(provider)
if err != nil {
log.Error(err)
os.Exit(1)
}

config.Server["version"] = version
err = cfg.SetObject(config.ServerKey, config.Server)
if err != nil {
log.Error(err)
os.Exit(1)
}

err = config.PatchCRVersion(&kubeClient.RestConfig)
if err != nil {
Expand All @@ -70,22 +83,8 @@ func main() {
}
}

// Config init and seed
cfg, err := config.New(provider)
if err != nil {
log.Error(err)
os.Exit(1)
}

cfg.SetKey(config.BrokerURL, os.Getenv("BROKER_URL"))

config.Server["version"] = version
err = cfg.SetObject(config.ServerKey, config.Server)
if err != nil {
log.Error(err)
os.Exit(1)
}

err = cfg.SetObject(config.ResourcesKey, config.Pipelines)
if err != nil {
log.Error(err)
Expand Down

0 comments on commit ad4a258

Please sign in to comment.