rendered_docker_compose differs from original one
Hi there,
It seems I've caught an issue with some interpolation of docker-compose that is done by rancher provider. I'm getting docker-compose.yml row:
tag: "{{.ImageName}}/{{.Name}}/{{.ID}}"
replaced with:
tag: <no value>/<no value>/<no value>
To comment, this expression is not supposed to be interpolated, but preserved "as is", since this is a Splunk-driver expression.
Terraform Version
Terraform v0.11.14
Affected Resource(s)
docker-compose.yml
Terraform Configuration Files
resource "rancher_stack" "my-api" {
name = "my-api"
description = "API Stack"
environment_id = "${var.rancher_environment_id}"
start_on_create = "true"
finish_upgrade = "true"
docker_compose = "${file("${path.module}/docker-compose-api.yml")}"
rancher_compose = "${file("${path.module}/rancher-compose-api.yml")}"
scope = "user"
docker-compose.yml
version: '2'
services:
my-api:
#part of compose ommited for breavity
logging:
driver: splunk
options:
#some splunk env variables
splunk-token: ${TOKEN_SPLUNK}
splunk-url: 'https://input.mysplunk.com'
tag: "{{.ImageName}}/{{.Name}}/{{.ID}}"
Expected Behavior
Docker-compose.yml should've been applied "as specified" for Rancher stack
Actual Behavior
Actually applied docker compose (showing up in rendered_docker_compose: "" => "
version: '2'
services:
my-api:
#part of compose ommited for breavity
logging:
driver: splunk
options:
#some splunk env variables
splunk-token: ${TOKEN_SPLUNK}
splunk-url: 'https://input.mysplunk.com'
tag: <no value>/<no value>/<no value>
Steps to Reproduce
terraform apply
I don't see why that would happen, as we do not interpolate this string. Is it the Rancher export action that causes it to be interpreted maybe?
Try to use go template's raw string:
tag: "{{`{{.ImageName}}`}}/{{`{{.Name}}`}}/{{`{{.ID}}`}}"