Open chrisbecke opened 2 days ago
PS. I baked in the desired list of platforms (is there a way to extract these from a data.docker_image resource)?
resource "docker_service" "this" {
name = "${local.namespace}_fleet-manager"
task_spec {
container_spec {
image = docker_image.this.repo_digest
configs {
config_id = docker_config.gitlab_runner_config.id
config_name = docker_config.gitlab_runner_config.name
file_name = "/etc/gitlab-runner/config.toml"
}
}
restart_policy {
condition = "any"
delay = "5s"
window = "1m"
}
placement {
platforms {
os = "linux"
architecture = "amd64"
}
platforms {
os = "linux"
architecture = "arm64"
}
}
}
}
and docker service inspect
verifies the two desired entries are present, but EVER time I run plan
it detects a change:
# module.fleet-manager.docker_service.this will be updated in-place
~ resource "docker_service" "this" {
id = "hiqog3zgxyaolwapdowrwr7vx"
name = "glfleet_fleet-manager"
~ task_spec {
# (2 unchanged attributes hidden)
~ placement {
# (3 unchanged attributes hidden)
+ platforms {
+ architecture = "arm64"
+ os = "linux"
}
# (1 unchanged block hidden)
}
# (3 unchanged blocks hidden)
}
# (2 unchanged blocks hidden)
}
docker service inspect hiqo --format '{{json .Spec.TaskTemplate.Placement}}' | jq
{
"Platforms": [
{
"Architecture": "amd64",
"OS": "linux"
},
{
"Architecture": "arm64",
"OS": "linux"
}
]
}
Community Note
Affected Resource(s)
Terraform Configuration Files
Expected Behaviour
Deployed on an M1 Mac the service only deploys correctly the first time. Subsequently the task_spec.placement.platforms list is updated excluding arm64.
Actual Behaviour
The .Spec.TaskTemplate.Placement.Platforms and .PreviousSpec.TaskTemplate.Placement.Platforms lists are rather janky in practice and do not correlate with the list of platforms supported by the target image gitlab/gitlab-runner:latest which is linux/amd64, linux/arm64, linux/ppc64le, linux/s390x.
Steps to Reproduce
Important Factoids
Using a M1 Macbook and Docker Desktop.