Closed sangee2004 closed 5 months ago
Tested the fix with both your examples and added related Unit tests - should be all good now :+1:
@iwilltry42 I still dont see the env variables with "." getting set in the containers. But i dont see the deployment error I used to see earlier for scenario1
Tested with acorn version v0.10.1-rc1-8-gce008aeb+ce008aeb
Scenario 1:
1.Deploy app with containers that have env names with "." in them
secrets: config: { type: "credential.acorn.io/mytestcred" params: { promptOrder: ["username", "password"] } data: { username: "xyz" password: "" } } containers: { mytest: { image: "nginx" env:{ "username.test": "secret://config/username" "password.paa": "secret://config/password" } } }
App deployment succeeds but I dont see the environment variables username.test
and password.paa
being set for the container.
Scenario 2:
args: {
newtext: "hello2"
number: 1
decimal: 1.1
}
containers: {
mywebnew: {
name: "testweb1"
image: "nginx"
scale: 1
ports: publish: "80/http"
files: {
"/usr/share/nginx/html/index.html": args.newtext
"/usr/share/nginx/html/test.html": "modified"
"/usr/share/nginx/html/test1.html": "\(args.decimal)"
"/usr/share/nginx/html/test2.html": "new1"
}
env:
{
"test1.val": "hello"
"test2.kk": "hellokk"
tt: "ss"
}
}
}
Once app is deployed , i see only tt
environment variable being set.
Pod definition in this case includes the env variables as expected. It is not getting listed when querying for it from within the container using env
command in this case.
Pod spec for scenario 1 and scenario2 from https://github.com/acorn-io/runtime/issues/2442#issuecomment-1906979405 showing the env varaibles set as expected.
scenario 1:
"containers": [
{
"env": [
{
"name": "password.paa",
"valueFrom": {
"secretKeyRef": {
"key": "password",
"name": "config"
}
}
},
{
"name": "username.test",
"valueFrom": {
"secretKeyRef": {
"key": "username",
"name": "config"
}
}
}
],
scenario 2:
"spec": {
"containers": [
{
"env": [
{
"name": "test1.val",
"value": "hello"
},
{
"name": "test2.kk",
"value": "hellokk"
},
{
"name": "tt",
"value": "ss"
}
],
acorn version -
v0.10.0-rc5+e2b69a6d
Steps to reproduce the problem:
Scenario 1:
1.Deploy app with containers that have env names with "." in them
App deployment fails with following error:
Scenario 2 :
tt
environment variable being set.