in config/yamlcfg/yaml2proto.go [140:178]
func Update(cfg *config.Configuration, yamlData []byte, reconcile *DefaultConfiguration, strict bool) error {
newConfig := &config.Configuration{}
if strict {
if err := yaml.UnmarshalStrict(yamlData, newConfig); err != nil {
return err
}
} else {
if err := yaml.Unmarshal(yamlData, newConfig); err != nil {
return err
}
}
if cfg == nil {
cfg = &config.Configuration{}
}
for _, testgroup := range newConfig.TestGroups {
if reconcile != nil {
ReconcileTestGroup(testgroup, reconcile.DefaultTestGroup)
}
cfg.TestGroups = append(cfg.TestGroups, testgroup)
}
for _, dashboard := range newConfig.Dashboards {
if reconcile != nil {
for _, dashboardtab := range dashboard.DashboardTab {
ReconcileDashboardTab(dashboardtab, reconcile.DefaultDashboardTab)
}
}
cfg.Dashboards = append(cfg.Dashboards, dashboard)
}
for _, dashboardGroup := range newConfig.DashboardGroups {
cfg.DashboardGroups = append(cfg.DashboardGroups, dashboardGroup)
}
return nil
}