-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix skaffold test to use minikube docker-env docker context (#5815)
What is the problem being solved? Fixes #5696, fixing skaffold test code to use minikube docker env in test environement command context when a minikube cluster is being used. Why is this the best approach? This approach re-uses the minikube detection and docker context setup used by skaffold builders which is in pkg/skaffold/docker/client.go. This way the build environment env vars will be identicla for both the build and test without having to duplicate code. The downside here is that the method used creates a docker client as well that is not used for test but this is likely ok because the docker client is a singleton (sync.Once) and as such should not require additional overhead. What other approaches did you consider? I considered copying over some of the minikube specific docker-env logic from pkg/skaffold/docker/client.go and removing the client creation pieces but essentially the minikube logic would be in two places and build and test would use different image env related code when the issue is mainly around them not using the same code here. It might make sense to refactor the docker client code to smaller pieces but I didn't want to change the public API and I think what is here should work fine. What side effects will this approach have? There should be no side affects to this approach. This should make it so the env vars used for build and test are aligned, most importantly for the minikube case. What future work remains to be done? N/A
- Loading branch information
1 parent
9002315
commit b889708
Showing
2 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters