From 20b44d77bd195340ced4b1d98a0771735d023e39 Mon Sep 17 00:00:00 2001 From: Shantanu Gadgil Date: Thu, 7 Oct 2021 01:00:23 +0530 Subject: [PATCH] auth_soft_fail needed for public images when agent is configured with auth (#11190) --- command/assets/connect-short.nomad | 6 ++++-- command/assets/connect.nomad | 10 ++++++++-- command/assets/example-short.nomad | 6 +++--- command/assets/example.nomad | 6 +++++- 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/command/assets/connect-short.nomad b/command/assets/connect-short.nomad index afb01648344..d121eb794e6 100644 --- a/command/assets/connect-short.nomad +++ b/command/assets/connect-short.nomad @@ -19,7 +19,8 @@ job "countdash" { driver = "docker" config { - image = "hashicorpnomad/counter-api:v3" + image = "hashicorpnomad/counter-api:v3" + auth_soft_fail = true } } } @@ -58,7 +59,8 @@ job "countdash" { } config { - image = "hashicorpnomad/counter-dashboard:v3" + image = "hashicorpnomad/counter-dashboard:v3" + auth_soft_fail = true } } } diff --git a/command/assets/connect.nomad b/command/assets/connect.nomad index 602c3691ffd..875979ef32e 100644 --- a/command/assets/connect.nomad +++ b/command/assets/connect.nomad @@ -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. @@ -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 @@ -457,7 +462,8 @@ job "countdash" { } config { - image = "hashicorpnomad/counter-dashboard:v3" + image = "hashicorpnomad/counter-dashboard:v3" + auth_soft_fail = true } } } diff --git a/command/assets/example-short.nomad b/command/assets/example-short.nomad index 4229f062edc..4c5e0f2bb5e 100644 --- a/command/assets/example-short.nomad +++ b/command/assets/example-short.nomad @@ -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 { diff --git a/command/assets/example.nomad b/command/assets/example.nomad index 513791fa51f..36249171389 100644 --- a/command/assets/example.nomad +++ b/command/assets/example.nomad @@ -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