cockpit-podman
cockpit-podman copied to clipboard
Environment variable validation
Some issues with validating env variables:
- We allow all characters, even invalid ones. The regex should likely be
[a-zA-Z_]{1,}[a-zA-Z0-9_]* - Empty value is allowed, but that likely makes no sense?
- Removing an invalid entry shifts the invalidate state to the valid one, see below:
Then remove the top one:
The last issue is due to the validationState being wrong compared to this.state.env
(7 entries)
[
null,
null,
null,
null,
null,
{
"envKey": "Key must not be empty"
},
{}
]
While this.state.env is (9 entries):
[
null,
null,
null,
null,
null,
null,
{
"key": 6,
"envKey": null,
"envValue": null
},
{
"key": 7,
"envKey": null,
"envValue": null
},
{
"key": 8,
"envKey": "jijij",
"envValue": null
}
]
While the UI shows: