In my Helm chart, I need to set the following Java Spring parameter name:
company.sms.security.password@id(name):
secret:
name: mypasswd
key: mysecretkey
But when applying the template, I encounter a syntax issue.
oc apply -f template.yml
The Deployment "template" is invalid: spec.template.spec.containers[0].env[79].name: Invalid value: "company.sms.security.password@id(name)": 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]*')
What I would usually do is defining this variable at runtime like this:
JAVA_TOOL_OPTIONS:
-Dcompany.sms.security.password@id(name)=mypass
But since it's storing sensitive data, obviously I cannot log in clear the password. So far I could only think about defining an Initcontainer as a workaround, changing the parameter name is not an option. Edit: So the goal is to not log the password neither in the manifest nor in the application logs.