cli: update default redis and use nomad service discovery

Closes #12927
Closes #12958

This PR updates the version of redis used in our examples from 3.2 to 7.
The old version is very not supported anymore, and we should be setting
a good example by using a supported version.

The long-form example job is now fixed so that the service stanza uses
nomad as the service discovery provider, and so now the job runs without
a requirement of having Consul running and configured.
This commit is contained in:
Seth Hoenig
2022-05-17 10:24:19 -05:00
parent 88e8c22b95
commit d91e4160da
27 changed files with 82 additions and 81 deletions

View File

@@ -21,10 +21,10 @@ func TestConfig_ParseHCL(t *testing.T) {
{
"basic image",
`config {
image = "redis:3.2"
image = "redis:7"
}`,
&TaskConfig{
Image: "redis:3.2",
Image: "redis:7",
Devices: []DockerDevice{},
Mounts: []DockerMount{},
MountsList: []DockerMount{},
@@ -196,7 +196,7 @@ func TestConfig_ParseAllHCL(t *testing.T) {
cfgStr := `
config {
image = "redis:3.2"
image = "redis:7"
image_pull_timeout = "15m"
advertise_ipv6_address = true
args = ["command_arg1", "command_arg2"]
@@ -342,7 +342,7 @@ config {
}`
expected := &TaskConfig{
Image: "redis:3.2",
Image: "redis:7",
ImagePullTimeout: "15m",
AdvertiseIPv6Addr: true,
Args: []string{"command_arg1", "command_arg2"},

View File

@@ -2292,7 +2292,7 @@ func TestDockerDriver_AuthConfiguration(t *testing.T) {
AuthConfig: nil,
},
{
Repo: "redis:3.2",
Repo: "redis:7",
AuthConfig: &docker.AuthConfiguration{
Username: "test",
Password: "1234",
@@ -2301,7 +2301,7 @@ func TestDockerDriver_AuthConfiguration(t *testing.T) {
},
},
{
Repo: "quay.io/redis:3.2",
Repo: "quay.io/redis:7",
AuthConfig: &docker.AuthConfiguration{
Username: "test",
Password: "5678",
@@ -2310,7 +2310,7 @@ func TestDockerDriver_AuthConfiguration(t *testing.T) {
},
},
{
Repo: "other.io/redis:3.2",
Repo: "other.io/redis:7",
AuthConfig: &docker.AuthConfiguration{
Username: "test",
Password: "abcd",

View File

@@ -4,7 +4,7 @@
"Names": [
"/redis-72bfa388-024e-a903-45b8-2bc28b74ed69"
],
"Image": "redis:3.2",
"Image": "redis:7",
"ImageID": "sha256:87856cc39862cec77541d68382e4867d7ccb29a85a17221446c857ddaebca916",
"Command": "docker-entrypoint.sh redis-server",
"Created": 1568383081,