mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 18:35:44 +03:00
* e2e: add tests for using private registry with podman driver This PR adds e2e tests that stands up a private docker registry and has a podman tasks run a container from an image in that private registry. Tests - user:password set in task config - auth_soft_fail works for public images when auth is set in driver - credentials helper is set in driver auth config - config auth.json file is set in driver auth config * packer: use nomad-driver-podman v0.5.0 * e2e: eliminate unnecessary chmod Co-authored-by: Daniel Bennett <dbennett@hashicorp.com> * cr: no need to install nomad twice * cl: no need to install docker twice --------- Co-authored-by: Daniel Bennett <dbennett@hashicorp.com>
59 lines
1.3 KiB
HCL
59 lines
1.3 KiB
HCL
# Copyright (c) HashiCorp, Inc.
|
|
# SPDX-License-Identifier: MPL-2.0
|
|
|
|
# This job runs a podman task using a container stored in a private registry
|
|
# configured with credentials helper authentication. The registry.hcl job should
|
|
# be running and healthy before running this job.
|
|
|
|
variable "registry_address" {
|
|
type = string
|
|
description = "The HTTP address of the local registry"
|
|
default = "localhost"
|
|
}
|
|
|
|
variable "registry_port" {
|
|
type = number
|
|
description = "The HTTP port of the local registry"
|
|
default = "7511"
|
|
}
|
|
|
|
job "auth_static" {
|
|
type = "batch"
|
|
|
|
constraint {
|
|
attribute = "${attr.kernel.name}"
|
|
value = "linux"
|
|
}
|
|
|
|
group "helper" {
|
|
reschedule {
|
|
attempts = 0
|
|
unlimited = false
|
|
}
|
|
|
|
network {
|
|
mode = "host"
|
|
}
|
|
|
|
task "echo" {
|
|
driver = "podman"
|
|
|
|
config {
|
|
image = "${var.registry_address}:${var.registry_port}/docker.io/library/bash_auth_helper:private"
|
|
args = ["echo", "The credentials helper auth test is OK!"]
|
|
|
|
auth {
|
|
# usename and password come from [docker-credential-]test.sh found on
|
|
# $PATH as specified by "helper=test.sh" in plugin config
|
|
tls_verify = false
|
|
}
|
|
}
|
|
|
|
resources {
|
|
cpu = 100
|
|
memory = 64
|
|
}
|
|
}
|
|
}
|
|
}
|