Skip to content

cli/command: DockerCli: CurrentContext(): resolve dynamically - #3884

Closed
thaJeztah wants to merge 1 commit into
docker:masterfrom
thaJeztah:context_lazy_evaluate_step1
Closed

cli/command: DockerCli: CurrentContext(): resolve dynamically#3884
thaJeztah wants to merge 1 commit into
docker:masterfrom
thaJeztah:context_lazy_evaluate_step1

Conversation

@thaJeztah

Copy link
Copy Markdown
Member

Store a reference to the options in the client, so that they can be used for later use. Now that resolveContextName() is a very lightweight function we can also dynamically get its value and use it for cli.CurrentContext().

- A picture of a cute animal (not mandatory but encouraged)

Store a reference to the options in the client, so that they can be
used for later use. Now that resolveContextName() is a very lightweight
function we can also dynamically get its value and use it for
cli.CurrentContext().
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztahthaJeztah added status/2-code-review area/context kind/refactor PR's that refactor, or clean-up code labels Nov 28, 2022
@thaJeztahthaJeztah added this to the 23.0.0 milestone Nov 28, 2022
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

Merging #3884 (70738f8) into master (cbf0522) will increase coverage by 0.00%.
The diff coverage is 75.00%.

Additional details and impacted files
@@ Coverage Diff @@## master #3884 +/- ##
=======================================
Coverage 59.22% 59.23% =======================================
Files 285 287 +2 Lines 24653 24656 +3 =======================================
+ Hits 14601 14605 +4 
Misses 9168 9168 + Partials 884 883 -1 

@thaJeztah
thaJeztah marked this pull request as draft November 28, 2022 09:57
@thaJeztah

Copy link
Copy Markdown
MemberAuthor

FWIW; moved this back to draft, as I'm still on the fence if we should resolve the context once at startup, or dynamically. Reason is that other properties (e.g. "DockerEndpoint" may not be resolved dynamically, so it would not make much sense to resolve this one dynamically.

So I may reduce this change back to only storing the options.

@thaJeztah

Copy link
Copy Markdown
MemberAuthor

closing in favour of #3847

@thaJeztah
thaJeztah deleted the context_lazy_evaluate_step1 branch November 28, 2022 17:30
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/contextkind/refactorPR's that refactor, or clean-up codestatus/2-code-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@thaJeztah@codecov-commenter