Skip to content

Key-value tokens from MINIO_CONFIG_ENV_FILE are not space-trimmed #21682

@EdoaLive

Description

@EdoaLive

The title is almost self-explanatory.

key := envTokens[0]

val := envTokens[1]

Why is this a problem?

I have a configuration “compositor” that formats the file referenced by MINIO_CONFIG_ENV_FILE, aligning all the = symbols in the same column. This adds spaces before and after the = symbol in the file.

This isn’t a problem when running MinIO as a systemd service — with the EnvironmentFile= directive, the file is parsed correctly and the environment variables are passed properly to MinIO.

However, I had a hard time figuring out why minio admin service restart wasn’t picking up the updated values. Now I found the cause.

Is this intentional, or just a slight oversight?

In my opinion, even beyond my specific setup, an extra space can easily slip into a configuration file. Since the parser doesn’t trim spaces, the environment key ends up containing the space, making it unrecognized — with no error or clue about what went wrong.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions