Hi Fabian,
I’ve reviewed the files you sent through and attempted to reproduce issue you’re seeing with your Octopus version (2022.2.6872), but unfortunately it seems to be working fine for me. I’m using the following to test this, but let me know if you spot something that doesn’t match your process.
First I created a single JSON file (MyJson.json) in a package (MyJson.1.0.0.zip) with the following contents:
{
"version": 3,
"$schema": "https://www.krakend.io/schema/v3.json",
"name": "COV API Gateway (DUMMY)",
"port": 8080,
"timeout": "5s",
"cache_ttl": "300s",
"output_encoding": "json",
"tls": {
"public_key": "/etc/krakend/apigw.crt",
"private_key": "/etc/krakend/apigw.key"
}
}
And then in the deploy a package step, I reference that file to have variables replaced within the MyJson package:
In the Octopus Project, I have the following variable defined with no scoping:
Deploying this package gives me the expected result, and I see the substitution happening in the log:
11:46:09 Verbose | Attempting structured variable replacement on file C:\Octopus\Applications\Tentacle 101.161_2021_3\Dev\MyJson\1.0.0\MyJson.json with format Json
11:46:09 Verbose | Structure found matching the variable 'name'. Replacing its content with the variable value.
11:46:09 Info | Structured variable replacement succeeded on file C:\Octopus\Applications\Tentacle 101.161_2021_3\Dev\MyJson\1.0.0\MyJson.json with format Json
{
"version": 3,
"$schema": "https://www.krakend.io/schema/v3.json",
"name": "my_replaced_variable",
"port": 8080,
"timeout": "5s",
"cache_ttl": "300s",
"output_encoding": "json",
"tls": {
"public_key": "/etc/krakend/apigw.crt",
"private_key": "/etc/krakend/apigw.key"
}
}
So that all seems to be working, but I’m curious if you spot anything else that might be different with your configuration. For example, is there any scoping on the name
variable that might be causing it to get scoped out of the deployment?
I noticed the raw deployment log you sent through showed the successful replacement occurring (with tls:public_key
, so I’m wondering what you see when the replacement doesn’t work? If you’d like you can use the secure link above to provide this to me as well. Just let me know if you do that as unfortunately I don’t get any notification when that’s been done.
Best,
Patrick