package env
import "k8s.io/kubernetes/pkg/kubelet/util/env"
Index ¶
Functions ¶
func ParseEnv ¶
ParseEnv implements a strict parser for .env environment files, adhering to the format defined in the RFC documentation at https://smartmob-rfc.readthedocs.io/en/latest/2-dotenv.html.
This function implements a strict parser for environment files similar to the requirements in the OCI and Docker env file RFCs:
- Leading whitespace is ignored for all lines.
- Blank lines (including those with only whitespace) are ignored.
- Lines starting with '#' are treated as comments and ignored.
- Each variable must be declared as VAR=VAL. Whitespace around '=' and at the end of the line is ignored.
- A backslash ('\') at the end of a variable declaration line indicates the value continues on the next line. The lines are joined with a single space, and the backslash is not included.
- If a continuation line is interrupted by a blank line or comment, it is considered invalid and an error is returned.
Source Files ¶
env_util.go
- Version
- v1.34.0-rc.0
- Published
- Aug 6, 2025
- Platform
- windows/amd64
- Imports
- 4 packages
- Last checked
- 17 minutes ago –
Tools for package owners.