-func applyDeprecatedConfig(cfg *arvados.Config, dc *deprecatedConfig, log logger) error {
- hostname, err := os.Hostname()
- if err != nil {
- return err
- }
- for id, dcluster := range dc.Clusters {
- cluster, ok := cfg.Clusters[id]
- if !ok {
- return fmt.Errorf("can't load legacy config %q that is not present in current config", id)
- }
- for name, np := range dcluster.NodeProfiles {
- if name == "*" || name == os.Getenv("ARVADOS_NODE_PROFILE") || name == hostname {
- applyDeprecatedNodeProfile(hostname, np.RailsAPI, &cluster.Services.RailsAPI)
- applyDeprecatedNodeProfile(hostname, np.Controller, &cluster.Services.Controller)
- applyDeprecatedNodeProfile(hostname, np.DispatchCloud, &cluster.Services.DispatchCloud)
- }
- }
- if dst, n := &cluster.API.MaxItemsPerResponse, dcluster.RequestLimits.MaxItemsPerResponse; n != nil && *n != *dst {
- log.Warnf("overriding Clusters.%s.API.MaxItemsPerResponse with deprecated config RequestLimits.MultiClusterRequestConcurrency = %d", id, *n)
- *dst = *n
- }
- if dst, n := &cluster.API.MaxRequestAmplification, dcluster.RequestLimits.MultiClusterRequestConcurrency; n != nil && *n != *dst {
- log.Warnf("overriding Clusters.%s.API.MaxRequestAmplification with deprecated config RequestLimits.MultiClusterRequestConcurrency = %d", id, *n)
- *dst = *n
+func checkKeyConflict(label string, m map[string]string) error {
+ saw := map[string]bool{}
+ for k := range m {
+ k = strings.ToLower(k)
+ if saw[k] {
+ return fmt.Errorf("%s: multiple entries for %q (fix by using same capitalization as default/example file)", label, k)