Created
June 18, 2022 07:07
-
-
Save lgfa29/44a3420fa588248fe39c942ee87131c0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/nomad/structs/network.go b/nomad/structs/network.go | |
index 30e769323..3f7f1c8be 100644 | |
--- a/nomad/structs/network.go | |
+++ b/nomad/structs/network.go | |
@@ -4,6 +4,8 @@ import ( | |
"fmt" | |
"math/rand" | |
"net" | |
+ "os" | |
+ "strings" | |
"sync" | |
"github.com/hashicorp/nomad/helper" | |
@@ -174,6 +176,9 @@ func (idx *NetworkIndex) Overcommitted() bool { | |
// SetNode is used to setup the available network resources. Returns | |
// true if there is a collision | |
func (idx *NetworkIndex) SetNode(node *Node) (collide bool, reason string) { | |
+ if os.Getenv("CRASH") != "" && strings.HasPrefix(node.Name, "crash") { | |
+ return true, "crash" | |
+ } | |
// COMPAT(0.11): Remove in 0.11 | |
// Grab the network resources, handling both new and old |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment