chore: add set docker host by current context#9094
Merged
ericzzzzzzz merged 5 commits intoSep 15, 2023
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## main #9094 +/- ##
==========================================
- Coverage 70.48% 63.43% -7.06%
==========================================
Files 515 628 +113
Lines 23150 32293 +9143
==========================================
+ Hits 16317 20484 +4167
- Misses 5776 10248 +4472
- Partials 1057 1561 +504
... and 431 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
renzodavid9
approved these changes
Sep 15, 2023
Contributor
Author
|
I was looking into the alternative way to simplify the whole var opts = []client.Opt{client.WithHTTPHeaders(getUserAgentHeader())}
cli, err := command.NewDockerCli()
if err != nil {
return nil, nil, fmt.Errorf("fail to create dockerCli instance %w", err)
}
err = cli.Initialize(flags.NewClientOptions())
if err != nil {
return nil, nil, fmt.Errorf("fail to initialize dockerCli instance %w", err)
}
endpoint := cli.DockerEndpoint()
clientOpts, err := endpoint.ClientOpts()
if err != nil {
return nil, nil, fmt.Errorf("fail to get dockerCli endpoint options %w", err)
}
opts = append(opts, clientOpts...)
c, err := client.NewClientWithOpts(opts...) |
ialidzhikov
added a commit
to ialidzhikov/gardener-extension-registry-cache
that referenced
this pull request
Oct 5, 2023
`make extension-up` fails with: ``` Checking cache... - eu.gcr.io/gardener-project/gardener/extensions/registry-cache: Error checking cache. getting imageID for eu.gcr.io/gardener-project/gardener/extensions/registry-cache:v0.1.0-34-g935efc92-dirty: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? ``` For a long time I was performing the following workaround: ``` % sudo ln -s "$HOME/.docker/run/docker.sock" /var/run/docker.sock ``` It seems that the issue is fixed permanently in `skaffold@v2.8.0` with GoogleContainerTools/skaffold#9094. skaffold should now be able to correctly determine to location of the docker socket.
ialidzhikov
added a commit
to ialidzhikov/gardener-extension-registry-cache
that referenced
this pull request
Oct 5, 2023
`make extension-up` fails with: ``` Checking cache... - eu.gcr.io/gardener-project/gardener/extensions/registry-cache: Error checking cache. getting imageID for eu.gcr.io/gardener-project/gardener/extensions/registry-cache:v0.1.0-34-g935efc92-dirty: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? ``` For a long time I was performing the following workaround: ``` % sudo ln -s "$HOME/.docker/run/docker.sock" /var/run/docker.sock ``` It seems that the issue is fixed permanently in `skaffold@v2.8.0` with GoogleContainerTools/skaffold#9094. skaffold should now be able to correctly determine to location of the docker socket.
ialidzhikov
added a commit
to ialidzhikov/gardener-extension-registry-cache
that referenced
this pull request
Oct 5, 2023
`make extension-up` fails with: ``` Checking cache... - eu.gcr.io/gardener-project/gardener/extensions/registry-cache: Error checking cache. getting imageID for eu.gcr.io/gardener-project/gardener/extensions/registry-cache:v0.1.0-34-g935efc92-dirty: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? ``` For a long time I was performing the following workaround: ``` % sudo ln -s "$HOME/.docker/run/docker.sock" /var/run/docker.sock ``` It seems that the issue is fixed permanently in `skaffold@v2.8.0` with GoogleContainerTools/skaffold#9094. skaffold should now be able to correctly determine to location of the docker socket.
ialidzhikov
added a commit
to ialidzhikov/gardener-extension-registry-cache
that referenced
this pull request
Oct 5, 2023
`make extension-up` fails with: ``` Checking cache... - eu.gcr.io/gardener-project/gardener/extensions/registry-cache: Error checking cache. getting imageID for eu.gcr.io/gardener-project/gardener/extensions/registry-cache:v0.1.0-34-g935efc92-dirty: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? ``` For a long time I was performing the following workaround: ``` % sudo ln -s "$HOME/.docker/run/docker.sock" /var/run/docker.sock ``` It seems that the issue is fixed permanently in `skaffold@v2.8.0` with GoogleContainerTools/skaffold#9094. skaffold should now be able to correctly determine to location of the docker socket.
ialidzhikov
added a commit
to ialidzhikov/gardener-extension-registry-cache
that referenced
this pull request
Oct 5, 2023
`make extension-up` fails with: ``` Checking cache... - eu.gcr.io/gardener-project/gardener/extensions/registry-cache: Error checking cache. getting imageID for eu.gcr.io/gardener-project/gardener/extensions/registry-cache:v0.1.0-34-g935efc92-dirty: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? ``` For a long time I was performing the following workaround: ``` % sudo ln -s "$HOME/.docker/run/docker.sock" /var/run/docker.sock ``` It seems that the issue is fixed permanently in `skaffold@v2.8.0` with GoogleContainerTools/skaffold#9094. skaffold should now be able to correctly determine to location of the docker socket.
ialidzhikov
added a commit
to ialidzhikov/gardener-extension-registry-cache
that referenced
this pull request
Oct 6, 2023
`make extension-up` fails with: ``` Checking cache... - eu.gcr.io/gardener-project/gardener/extensions/registry-cache: Error checking cache. getting imageID for eu.gcr.io/gardener-project/gardener/extensions/registry-cache:v0.1.0-34-g935efc92-dirty: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? ``` For a long time I was performing the following workaround: ``` % sudo ln -s "$HOME/.docker/run/docker.sock" /var/run/docker.sock ``` It seems that the issue is fixed permanently in `skaffold@v2.8.0` with GoogleContainerTools/skaffold#9094. skaffold should now be able to correctly determine to location of the docker socket.
gardener-prow Bot
pushed a commit
to gardener/gardener-extension-registry-cache
that referenced
this pull request
Oct 6, 2023
`make extension-up` fails with: ``` Checking cache... - eu.gcr.io/gardener-project/gardener/extensions/registry-cache: Error checking cache. getting imageID for eu.gcr.io/gardener-project/gardener/extensions/registry-cache:v0.1.0-34-g935efc92-dirty: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? ``` For a long time I was performing the following workaround: ``` % sudo ln -s "$HOME/.docker/run/docker.sock" /var/run/docker.sock ``` It seems that the issue is fixed permanently in `skaffold@v2.8.0` with GoogleContainerTools/skaffold#9094. skaffold should now be able to correctly determine to location of the docker socket.
Closed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes: #9028
golang docker rest api clientuse a hard coded value as docker engine host for example,unix:///var/run/docker.sockon mac,but docker command line clientuse the socket fromdocker current contextas host.docker current contextwith docker client, if the DOCKER_HOST is not set, we should use the value fromdocker current context. If the value is set, both docker command line and golang rest client will honor the env variable.