Fix: backwards compatibility for allocator default settings
When the allocator is not defined in the configuration, it will take defaults and assume there is a "tags" informer. That is not the case. When not defined, we assume it should allocate only by "freespace".
This commit is contained in:
parent
1dca6e0eca
commit
3f895df8cf
|
@ -168,6 +168,13 @@ func createCluster(
|
||||||
informers = append(informers, tagsinf)
|
informers = append(informers, tagsinf)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// For legacy compatibility we need to make the allocator
|
||||||
|
// automatically compatible with informers that have been loaded. For
|
||||||
|
// simplicity we assume that anyone that does not specify an allocator
|
||||||
|
// configuration (legacy configs), will be using "freespace"
|
||||||
|
if !cfgMgr.IsLoadedFromJSON(config.Allocator, cfgs.BalancedAlloc.ConfigKey()) {
|
||||||
|
cfgs.BalancedAlloc.AllocateBy = []string{"freespace"}
|
||||||
|
}
|
||||||
alloc, err := balanced.New(cfgs.BalancedAlloc)
|
alloc, err := balanced.New(cfgs.BalancedAlloc)
|
||||||
checkErr("creating allocator", err)
|
checkErr("creating allocator", err)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user