Skip to content

Commit

Permalink
auth_soft_fail needed for public images when agent is configured with…
Browse files Browse the repository at this point in the history
… auth (#11190)
  • Loading branch information
shantanugadgil authored Oct 6, 2021
1 parent 3eb852f commit 20b44d7
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
6 changes: 4 additions & 2 deletions command/assets/connect-short.nomad
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ job "countdash" {
driver = "docker"

config {
image = "hashicorpnomad/counter-api:v3"
image = "hashicorpnomad/counter-api:v3"
auth_soft_fail = true
}
}
}
Expand Down Expand Up @@ -58,7 +59,8 @@ job "countdash" {
}

config {
image = "hashicorpnomad/counter-dashboard:v3"
image = "hashicorpnomad/counter-dashboard:v3"
auth_soft_fail = true
}
}
}
Expand Down
10 changes: 8 additions & 2 deletions command/assets/connect.nomad
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ job "countdash" {
# The "dns" stanza allows operators to override the DNS configuration
# inherited by the host client.
# dns {
# servers = ["1.1.1.1"]
# servers = ["1.1.1.1"]
# }
}
# The "service" stanza enables Consul Connect.
Expand Down Expand Up @@ -314,6 +314,11 @@ job "countdash" {
# documentation for more information.
config {
image = "hashicorpnomad/counter-api:v3"

# The "auth_soft_fail" configuration instructs Nomad to try public
# repositories if the task fails to authenticate when pulling images
# and the Docker driver has an "auth" configuration block.
auth_soft_fail = true
}

# The "artifact" stanza instructs Nomad to download an artifact from a
Expand Down Expand Up @@ -457,7 +462,8 @@ job "countdash" {
}

config {
image = "hashicorpnomad/counter-dashboard:v3"
image = "hashicorpnomad/counter-dashboard:v3"
auth_soft_fail = true
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions command/assets/example-short.nomad
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ job "example" {
driver = "docker"

config {
image = "redis:3.2"

ports = ["db"]
image = "redis:3.2"
ports = ["db"]
auth_soft_fail = true
}

resources {
Expand Down
6 changes: 5 additions & 1 deletion command/assets/example.nomad
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,12 @@ job "example" {
# documentation for more information.
config {
image = "redis:3.2"

ports = ["db"]

# The "auth_soft_fail" configuration instructs Nomad to try public
# repositories if the task fails to authenticate when pulling images
# and the Docker driver has an "auth" configuration block.
auth_soft_fail = true
}

# The "artifact" stanza instructs Nomad to download an artifact from a
Expand Down

0 comments on commit 20b44d7

Please sign in to comment.