Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve environment variable order in Pod specification #2341

Merged
merged 1 commit into from
Jan 6, 2020

Conversation

charith-elastic
Copy link
Contributor

Preserves the original order in which the environment variables were declared in the pod template. Previously they were being sorted to make pod spec comparisons stable but as the Env field is immutable and stored as an array, sorting is not necessary. Sorting also breaks expectations for users who want to reference previously declared variables when defining a new variable.

Also converts the PodDownwardEnvVars global variable to a function to prevent accidental modifications.

Fixes #2327

@charith-elastic charith-elastic added the >bug Something isn't working label Jan 3, 2020
Copy link
Contributor

@barkbay barkbay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@charith-elastic charith-elastic merged commit 32f2a0b into elastic:master Jan 6, 2020
@charith-elastic charith-elastic deleted the env-var-order branch January 6, 2020 13:49
@anyasabo anyasabo added the v1.0.0 label Jan 8, 2020
@thbkrkr thbkrkr changed the title Preserve environment variable order in pod spec Preserve environment variable order in Pod spec Jan 9, 2020
@anyasabo anyasabo changed the title Preserve environment variable order in Pod spec Preserve environment variable order in Pod specification Jan 9, 2020
mjmbischoff pushed a commit to mjmbischoff/cloud-on-k8s that referenced this pull request Jan 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug Something isn't working v1.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Operator changes the order of environment variables provided in the Elasticsearch CR
3 participants