Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lots more fixes, consul 1.9.5 (patched)
- Loading branch information
Showing
7 changed files
with
144 additions
and
13 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
diff --git a/api/agent.go b/api/agent.go | ||
index a4cc143f0..696025015 100644 | ||
--- a/api/agent.go | ||
+++ b/api/agent.go | ||
@@ -288,7 +288,7 @@ type AgentCheckRegistration struct { | ||
type AgentServiceCheck struct { | ||
CheckID string `json:",omitempty"` | ||
Name string `json:",omitempty"` | ||
- Args []string `json:"ScriptArgs,omitempty"` | ||
+ ScriptArgs []string `json:",omitempty"` | ||
DockerContainerID string `json:",omitempty"` | ||
Shell string `json:",omitempty"` // Only supported for Docker. | ||
Interval string `json:",omitempty"` | ||
diff --git a/api/agent_test.go b/api/agent_test.go | ||
index 6bcd7868c..77cd4f9a1 100644 | ||
--- a/api/agent_test.go | ||
+++ b/api/agent_test.go | ||
@@ -905,8 +905,8 @@ func TestAPI_AgentScriptCheck(t *testing.T) { | ||
reg := &AgentCheckRegistration{ | ||
Name: "foo", | ||
AgentServiceCheck: AgentServiceCheck{ | ||
- Interval: "10s", | ||
- Args: []string{"sh", "-c", "false"}, | ||
+ Interval: "10s", | ||
+ ScriptArgs: []string{"sh", "-c", "false"}, | ||
}, | ||
} | ||
if err := agent.CheckRegister(reg); err != nil { | ||
@@ -928,8 +928,8 @@ func TestAPI_AgentScriptCheck(t *testing.T) { | ||
Port: 1234, | ||
Checks: AgentServiceChecks{ | ||
&AgentServiceCheck{ | ||
- Interval: "10s", | ||
- Args: []string{"sh", "-c", "false"}, | ||
+ Interval: "10s", | ||
+ ScriptArgs: []string{"sh", "-c", "false"}, | ||
}, | ||
}, | ||
} | ||
@@ -1063,7 +1063,7 @@ func TestAPI_AgentChecks_Docker(t *testing.T) { | ||
ServiceID: "redis", | ||
AgentServiceCheck: AgentServiceCheck{ | ||
DockerContainerID: "f972c95ebf0e", | ||
- Args: []string{"/bin/true"}, | ||
+ ScriptArgs: []string{"/bin/true"}, | ||
Shell: "/bin/bash", | ||
Interval: "10s", | ||
}, | ||
diff --git a/command/services/config_test.go b/command/services/config_test.go | ||
index 71cdd96e8..4b2b7e3f2 100644 | ||
--- a/command/services/config_test.go | ||
+++ b/command/services/config_test.go | ||
@@ -150,6 +150,27 @@ func TestStructsToAgentService(t *testing.T) { | ||
}, | ||
}, | ||
}, | ||
+ { | ||
+ "Service with scriptcheck", | ||
+ &structs.ServiceDefinition{ | ||
+ Name: "web", | ||
+ Checks: structs.CheckTypes{ | ||
+ &structs.CheckType{ | ||
+ Name: "scriptcheck", | ||
+ ScriptArgs: []string{"sh", "-c", "/bin/true"}, | ||
+ }, | ||
+ }, | ||
+ }, | ||
+ &api.AgentServiceRegistration{ | ||
+ Name: "web", | ||
+ Checks: api.AgentServiceChecks{ | ||
+ &api.AgentServiceCheck{ | ||
+ Name: "scriptcheck", | ||
+ ScriptArgs: []string{"sh", "-c", "/bin/true"}, | ||
+ }, | ||
+ }, | ||
+ }, | ||
+ }, | ||
} | ||
|
||
for _, tt := range cases { |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ config, self, pkgs, nodeName, ... }: { | ||
services.glusterfs.enable = true; | ||
systemd.services.glusterd.path = with pkgs; [ nettools ]; | ||
|
||
fileSystems."/mnt/gv0" = { | ||
device = "glusterd.service.consul:/gv0"; | ||
fsType = "glusterfs"; | ||
}; | ||
} |
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
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
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