operator
operator copied to clipboard
Operator env values managments is complicated
The operator is configured using environment variables, defined via struct annotations (see example). These variables are parsed and populated using the caarlos0/env/v11 library.
However, this approach has several drawbacks:
-
Placeholders do not respect prefixes. To make it work, a hack is required.
-
To extract environment variable descriptions, the Go source file must be parsed manually, which in turn must be included in the Dockerfile.
-
Environment variable names are composed dynamically, making it difficult to search for them by full name. This also results in redundant prefixes like
VM_VLOGSDEFAULT_IMAGEorVM_VMALERTDEFAULT_VERSION. -
The library adds unnecessary complexity without providing sufficient flexibility for customization or introspection.
Simplifying env management would improve maintainability, ease configuration, and reduce friction for development and usage.