-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Use url with scheme and path for the unix address #19917
Conversation
Shortcuts like unix:path and unix:/path do not work everywhere, so make sure to use unix://path when quoting the url (or address) Signed-off-by: Anders F Björklund <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that using unix://
is better and correct for the code and docs but I think at least for backwards compatibility sake we should make sure we still have a test which makes sure unix:
works as well for the service and remote client.
I didn't add any "deprecation warnings" or anything, because then it would there for years (like in kubernetes). I think that |
db00ba2
to
25f8419
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: afbjorklund, Luap99 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
im willing to merge once tests are passing, thanks @afbjorklund |
LGTM once the tests are hip. |
One strange thing about the default address is that the error message talks about the "connections": Cannot connect to Podman. Please verify your connection to the Linux system using But yet there is no mention about the default connection, in the
It does mention the file-not-found error, but that only comes on the second line and is mixed with an imaginary
The user has to know that there is a colon involved in urls, or check the
This is different from the docker client output, when running
|
Test failure looks legitimate:
|
So yet another regression, will have to see where this one comes from podman3 had: podman4 says: But none of them is showing the mix between the two, like in the test fail. uri := url.URL{
Scheme: "unix",
Path: filepath.Join(xdg, "podman", "podman.sock"),
}
ic.Libpod.SetRemoteURI(uri.String())
info.Host.RemoteSocket.Path = uri.Path EDIT: info.Host.RemoteSocket = &define.RemoteSocket{Path: ic.Libpod.RemoteURI()} |
This got broken in Which changed the test, rather than report a path... So now Sometimes. Depending on which program you run. $ ./bin/podman info --format '{{.Host.RemoteSocket.Path}}'
/run/user/1000/podman/podman.sock
$ ./bin/podman-remote info --format '{{.Host.RemoteSocket.Path}}'
unix:///run/user/1000/podman/podman.sock If you start it with a string, it will just echo that back. EDIT: That is the scheme is https://en.wikipedia.org/wiki/URL#syntax
|
25f8419
to
6e797ca
Compare
It is perfectly valid to have only scheme and path (no "authority"), but unfortunately it doesn't work with external clients like Docker. Signed-off-by: Anders F Björklund <[email protected]>
6e797ca
to
6f4f941
Compare
Side note: This was already happening in setDockerHost := `export DOCKER_HOST="unix://$(podman info -f "{{.Host.RemoteSocket.Path}}")"
` fmtString = `You can %sconnect Docker API clients by setting DOCKER_HOST using the
following command in your terminal session:
export DOCKER_HOST='unix://%s'
`
fmt.Printf(fmtString, stillString, forwardSock) Or in the other documentation, that was constructing the remote docker socket address from scratch. $ export DOCKER_HOST=unix://$XDG_RUNTIME_DIR/podman/podman.sock
$ docker-compose up $ export DOCKER_HOST=unix://$XDG_RUNTIME_DIR/podman/podman.sock
$ docker-compose up |
Unfortunately the broken URL "unix://run" appears both in documentation and in upstream library... docs/source/markdown/podman-remote.1.md It needs to be fixed as well, it is supposed to be "unix:///run" (or unix:/run, but) and not relative path. i.e. it only works if you do
EDIT: |
/lgtm |
Thanks @afbjorklund |
I don't know your plans for the 4.8 / 5.0 release, but would it be possible to apply this fix to the 4.7 branch? I have run into this issue when I switched from docker-compose 1.29 to docker-compose v2, which apparently requires the |
4.8 should be released before the holidays. |
Shortcuts like
unix:path
andunix:/path
do not work everywhere,so make sure to use
unix://path
when quoting the url (or address)This avoids errors such as: (when trying to use it as the
DOCKER_HOST
)error during connect: Get "http://unix:2375/run/user/1000/podman/podman.sock/v1.24/version": dial tcp: lookup unix: no such host
Does this PR introduce a user-facing change?
Help before:
Help after: