Add image_pull_timeout to service template
This commit is contained in:
parent
5341cb1c8b
commit
9fe63d03d9
@ -2,6 +2,7 @@ resource "nomad_job" "service" {
|
||||
jobspec = templatefile("${path.module}/service_template.nomad", {
|
||||
name = var.name
|
||||
image = var.image
|
||||
image_pull_timeout = var.image_pull_timeout
|
||||
args = var.args
|
||||
env = var.env
|
||||
meta = var.meta
|
||||
|
@ -131,6 +131,9 @@ job "${name}" {
|
||||
%{ endif ~}
|
||||
config {
|
||||
image = "${image}"
|
||||
%{if image_pull_timeout != null ~}
|
||||
image_pull_timeout = "${image_pull_timeout}"
|
||||
%{ endif ~}
|
||||
%{ if service_port != null ~}
|
||||
ports = ["main"]
|
||||
%{ endif ~}
|
||||
|
@ -8,6 +8,12 @@ variable "image" {
|
||||
description = "Image that should be run"
|
||||
}
|
||||
|
||||
variable "image_pull_timeout" {
|
||||
type = string
|
||||
default = null
|
||||
description = "A time duration that controls how long Nomad will wait before cancelling an in-progress pull of the Docker image"
|
||||
}
|
||||
|
||||
variable "meta" {
|
||||
type = map(string)
|
||||
default = {}
|
||||
|
Loading…
Reference in New Issue
Block a user