Skip to content
This repository was archived by the owner on Mar 16, 2024. It is now read-only.
This repository was archived by the owner on Mar 16, 2024. It is now read-only.

Not able to deploy apps with containers having env variable names with "." #2442

@sangee2004

Description

@sangee2004

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

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 fails with following error:

NAME         IMAGE          COMMIT    CREATED   ENDPOINTS                                               MESSAGE
mytestcred   cef99faebfc4             12m ago                                                           (container: mytest): pending; failed to create mytestcred-acorn-430e6f08/mytest apps/v1, Kind=Deployment for subcontext [acorn-controller] namespace [acorn] name [mytestcred]: Deployment.apps "mytest" is invalid: [spec.template.spec.containers[0].env[0].name: Invalid value: "password\\.paa": a valid environment variable name must consist of alphabetic characters, digits, '_', '-', or '.', and must not start with a digit (e.g. 'my.env-name',  or 'MY_ENV.NAME',  or 'MyEnvName1', regex used for validation is '[-._a-zA-Z][-._a-zA-Z0-9]*'), spec.template.spec.containers[0].env[1].name: Invalid value: "username\\.test": a valid environment variable name must consist of alphabetic characters, digits, '_', '-', or '.', and must not start with a digit (e.g. 'my.env-name',  or 'MY_ENV.NAME',  or 'MyEnvName1', regex used for validation is '[-._a-zA-Z][-._a-zA-Z0-9]*')]

Scenario 2 :

  1. Deploy app with containers that have env names with "."
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"
		}
	}
}
  1. Once app is deployed , i see only tt environment variable being set.

Metadata

Metadata

Assignees

Labels

kind/bugSomething isn't working

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions