Skip to content

Commit

Permalink
Allow jobs not requiring any network resources
Browse files Browse the repository at this point in the history
Jobs not requiring any network resources should be allowed
even when the network fingerprinter is disabled.
  • Loading branch information
wjordan committed Aug 24, 2022
1 parent 34e4b08 commit 85cd4a0
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions scheduler/feasible.go
Expand Up @@ -381,6 +381,11 @@ func (c *NetworkChecker) SetNetwork(network *structs.NetworkResource) {
}

func (c *NetworkChecker) Feasible(option *structs.Node) bool {
// Allow jobs not requiring any network resources
if c.ports == nil {
return true
}

if !c.hasNetwork(option) {

// special case - if the client is running a version older than 0.12 but
Expand All @@ -398,13 +403,7 @@ func (c *NetworkChecker) Feasible(option *structs.Node) bool {
return false
}

if c.ports != nil {
if !c.hasHostNetworks(option) {
return false
}
}

return true
return c.hasHostNetworks(option)
}

func (c *NetworkChecker) hasHostNetworks(option *structs.Node) bool {
Expand Down

0 comments on commit 85cd4a0

Please sign in to comment.