Skip to content

Commit df39014

Browse files
authored
fix: rename pull_policies to pull_policy in config.toml (#1084)
## Description The `runner_worker_docker_options` mentioned a `pull_policies` attribute which was directly used in `config.toml` which is wrong. The correct name is `pull_policy`. `pull_policy` is ignored by the Runner and has no effect. Instead a pull policy of `always` is used automatically. This PR renames the `pull_policies` to `pull_policy` before inserting it into the configuration file. If `pull_policies` is used at the moment it has no effect. Closes #1065 ## Migrations required In case `var.runner_worker_docker_options.pull_policy` is used, rename `pull_policy` to `pull_policies` and make sure that it is a `list(string)`, e.g. `pull_policies = ["always"]` ## Verification Still to be done - [X] `pull_policies` not given --> `pull_policy = ["always"] is used. - [X] `pull_policies` given --> Specified value used
1 parent 0ef1a3d commit df39014

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

Diff for: locals.tf

+3-4
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,10 @@ locals {
5454

5555
runners_docker_options_toml = templatefile("${path.module}/template/runners_docker_options.tftpl", {
5656
options = merge({
57-
for key, value in var.runner_worker_docker_options : key => value if value != null && key != "volumes"
57+
for key, value in var.runner_worker_docker_options : key => value if value != null && key != "volumes" && key != "pull_policies"
5858
}, {
59-
volumes = local.runners_volumes
59+
pull_policy = var.runner_worker_docker_options.pull_policies
60+
volumes = local.runners_volumes
6061
})
6162
}
6263
)
@@ -80,8 +81,6 @@ locals {
8081
}
8182
)
8283

83-
runners_pull_policies = "[\"${join("\",\"", var.runner_worker_docker_options.pull_policies)}\"]"
84-
8584
/* determines if the docker machine executable adds the Name tag automatically (versions >= 0.16.2) */
8685
# make sure to skip pre-release stuff in the semver by ignoring everything after "-"
8786
docker_machine_version_used = split(".", split("-", var.runner_install.docker_machine_version)[0])

Diff for: main.tf

-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ locals {
113113
runners_executor = var.runner_worker.type
114114
runners_limit = var.runner_worker.max_jobs
115115
runners_concurrent = var.runner_manager.maximum_concurrent_jobs
116-
runners_pull_policies = local.runners_pull_policies
117116
runners_idle_count = var.runner_worker_docker_machine_instance.idle_count
118117
runners_idle_time = var.runner_worker_docker_machine_instance.idle_time
119118
runners_max_builds = local.runners_max_builds_string

Diff for: tests/variables.tftest.hcl

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ run "create" {
88
command = plan
99

1010
variables {
11-
vpc_id = run.setup_tests.vpc_id
12-
subnet_id = run.setup_tests.subnet_id
11+
vpc_id = run.setup_tests.vpc_id
12+
subnet_id = run.setup_tests.subnet_id
1313
environment = "test"
1414
runner_gitlab = {
1515
url = "https://my.fancy.url/not/used"
@@ -18,7 +18,7 @@ run "create" {
1818

1919
# this is a dummy test. remove it as soon as the first real test is added
2020
assert {
21-
condition = output.runner_role_name == "test-docker-machine"
21+
condition = output.runner_role_name == "test-docker-machine"
2222
error_message = "Plan failed"
2323
}
2424
}

Diff for: variables.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ variable "runner_worker_docker_options" {
557557
disable_cache = "false"
558558
image = "docker:18.03.1-ce"
559559
privileged = "true"
560-
pull_policy = "always"
560+
pull_policies = ["always"]
561561
shm_size = 0
562562
tls_verify = "false"
563563
volumes = ["/cache"]

0 commit comments

Comments
 (0)