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

Add support for DOCKER_CONTEXT environment variable #351

Merged
merged 2 commits into from
Apr 19, 2022
Merged

Add support for DOCKER_CONTEXT environment variable #351

merged 2 commits into from
Apr 19, 2022

Conversation

scottslowe
Copy link
Contributor

This PR adds support for the DOCKER_CONTEXT environment variable, which will override the context specified by the docker context use command when setting the Docker context. Accordingly, segment-docker_context.go is changed by this PR to use DOCKER_CONTEXT if specified, and use the context specified in the Docker configuration file if the environment variable is not set (the same order Docker itself uses to determine context).

Fixes #350.

Update segment-docker_context.go to look for DOCKER_CONTEXT environment variable, and use that when setting the value of the segment.

Signed-off-by: Scott Lowe <scott.lowe@scottlowe.org>
@justjanne
Copy link
Owner

Is there a reason you removed the 🐳 emoji?

@scottslowe
Copy link
Contributor Author

@justjanne Sorry, that's an error on my part! I'll push another commit that restores the emoji. Apologies!

segment-docker_context.go Outdated Show resolved Hide resolved
Restore Docker emoji inadvertently removed in original commit

Co-authored-by: Janne Mareike Koschinski <janne@kuschku.de>
@scottslowe
Copy link
Contributor Author

@justjanne I've committed your suggestion. Apologies again for the error with the emoji. Thanks for creating powerline-go, it's a huge help to me in my day-to-day workflows.

@justjanne justjanne merged commit 400f147 into justjanne:main Apr 19, 2022
@scottslowe scottslowe deleted the issue-350 branch July 27, 2022 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docker context segment doesn't seem to recognize DOCKER_CONTEXT environment variable
2 participants