mirror of
https://github.com/kemko/nomad.git
synced 2026-01-09 03:45:41 +03:00
job region defaults to client node region if 'global' or none provided (#6064)
This commit is contained in:
@@ -453,8 +453,8 @@ func (c *Client) getNodeClientImpl(nodeID string, timeout time.Duration, q *Quer
|
||||
// If the client is configured for a particular region use that
|
||||
region = c.config.Region
|
||||
default:
|
||||
// No region information is given so use the default.
|
||||
region = "global"
|
||||
// No region information is given so use GlobalRegion as the default.
|
||||
region = GlobalRegion
|
||||
}
|
||||
|
||||
// Get an API client for the node
|
||||
|
||||
@@ -25,6 +25,13 @@ const (
|
||||
|
||||
// DefaultNamespace is the default namespace.
|
||||
DefaultNamespace = "default"
|
||||
|
||||
// For Job configuration, GlobalRegion is a sentinel region value
|
||||
// that users may specify to indicate the job should be run on
|
||||
// the region of the node that the job was submitted to.
|
||||
// For Client configuration, if no region information is given,
|
||||
// the client node will default to be part of the GlobalRegion.
|
||||
GlobalRegion = "global"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -704,7 +711,7 @@ func (j *Job) Canonicalize() {
|
||||
j.Stop = boolToPtr(false)
|
||||
}
|
||||
if j.Region == nil {
|
||||
j.Region = stringToPtr("global")
|
||||
j.Region = stringToPtr(GlobalRegion)
|
||||
}
|
||||
if j.Namespace == nil {
|
||||
j.Namespace = stringToPtr("default")
|
||||
|
||||
Reference in New Issue
Block a user