mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
Avoid panic during startup with 1.10.2 (#26219)
* fix: initalize the topology of teh processors to avoid nil pointers * func: initialize topology to avoid nil pointers * fix: update the new public method for NodeProcessorResources
This commit is contained in:
committed by
GitHub
parent
e13ceab855
commit
3b44090156
@@ -1569,6 +1569,12 @@ func (c *Client) setupNode() error {
|
||||
node.NodeResources.MinDynamicPort = newConfig.MinDynamicPort
|
||||
node.NodeResources.MaxDynamicPort = newConfig.MaxDynamicPort
|
||||
node.NodeResources.Processors = newConfig.Node.NodeResources.Processors
|
||||
|
||||
if node.NodeResources.Processors.Empty() {
|
||||
node.NodeResources.Processors = structs.NodeProcessorResources{
|
||||
Topology: &numalib.Topology{},
|
||||
}
|
||||
}
|
||||
}
|
||||
if node.ReservedResources == nil {
|
||||
node.ReservedResources = &structs.NodeReservedResources{}
|
||||
|
||||
@@ -18,7 +18,7 @@ type SystemScanner interface {
|
||||
// a single Topology, which can then be used to answer questions about the CPU
|
||||
// topology of the system.
|
||||
func Scan(scanners []SystemScanner) *Topology {
|
||||
top := new(Topology)
|
||||
top := &Topology{}
|
||||
for _, scanner := range scanners {
|
||||
scanner.ScanSystem(top)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user