Skip to content

ENV key validation rules to strict #724

Open

Description

@Flusinerd

Which component(s) is affected?

Kubero UI

Describe the bug

Hi, the validation rules for environment variable keys are to strict.
They don't allow hypens: -

From the UI:

Only letters, numbers and underscores allowed. Must start with letter or underscore

But hyphens are often used in environment variables.
For example from the Docker Registry image:

REGISTRY_HTTP_HEADERS_Access-Control-Allow-Origin='[http://registry-ui.example.com]'

To set various headers.

It would be great to allow this.

Steps to reproduce

  1. Go to the UI and create a new app
  2. Set a environment variable, who's key contains a -
  3. Validation error and unable to create app
  4. Uploading a .env also does not work

Expected behavior

Allow environment variable keys to contain -

Screenshots

No response

Additional information

No response

Debug information

No response

Activity

  1. LucidDan commented on Jan 28, 2026

    @LucidDan

    Personally, I'd never use '-' in a env name, since it would behave unexpectedly in ${} syntax, eg ${FOO-bash} would look for FOO and if unset return the string 'bash', rather than looking for FOO-bash. So this sounded wrong to me, but on doing some research to satisfy my own curiosity, it's allowed;

    Kubernetes allows any character except '=': https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/

    POSIX is slightly stricter and has some recommendations, but still mostly allows anything except '=': https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap08.html

    I was just satisfying my own curiosity looking this up, but hopefully the links I found are useful context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions