-
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
podman info - field to check whether it's a remote client #10289
Comments
The remoteSocket field is only added by the local client:
|
@Luap99, that's not a reliable source:
|
It looks like this behaviour changed after v3.1.2. |
It would be even more strange if podman-remote didn't have a socket ? So far we have mostly been using $ podman version
Version: 3.1.2
API Version: 3.1.2
Go Version: go1.15.2
Built: Thu Jan 1 01:00:00 1970
OS/Arch: linux/amd64
$ podman-remote version
Client:
Version: 3.1.2
API Version: 3.1.2
Go Version: go1.15.2
Built: Thu Jan 1 01:00:00 1970
OS/Arch: linux/amd64
Server:
Version: 3.1.2
API Version: 3.1.2
Go Version: go1.15.2
Built: Thu Jan 1 01:00:00 1970
OS/Arch: linux/amd64
But it could be good with an explicit field. Like the current "rootless", or something ? $ podman info | grep rootless
rootless: true
$ sudo podman info | grep rootless
rootless: false Actually we just hardcoded Made it hard to test podman-remote on Linux, though... But the lack of networking stopped using podman remote.
|
@Luap99 : So if you run podman-remote, it does not have a socket ?
But if you log in to the machine and run podman local, it does ?
@@ -42,6 +42,9 @@
spec: 1.0.0
+SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +YAJL
os: linux
+ remoteSocket:
+ exists: true
+ path: /run/user/1000/podman/podman.sock
security:
apparmorEnabled: false
capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT That is quite counter-intuitive. |
@Luap99 @afbjorklund I suggest adding the field |
/cc @vrothberg |
SGTM |
Yes, something new sounds good to me. I guess downstream will have to compare versions or something. And go back to heuristics, if the podman version is too low - or maybe just when the new field is missing ?
I don't think looking at $CONTAINER_HOST would work anymore, since it could be using a "connection" |
@afbjorklund FYI A HEAD on |
I think we have mostly given up on using the API for podman, and resort to using the CLI instead... And it seems to give consistent results, for the older versions (tested with podman1/podman2/podman3) $ podman-remote info --format "{{.Host.ServiceIsRemote}}"
Error: template: info:1:7: executing "info" at <.Host.ServiceIsRemote>: can't evaluate field ServiceIsRemote in type *define.HostInfo
$ echo $?
125 So one can use the new We normally call it anyway, not so much for the actual version - but more as a quick way to check it's alive... $ podman-remote info --format "{{.Host.ServiceIsRemote}}"
true$ echo $?
0 |
@jwhonce : assuming that Otherwise, we could just look at the binary. If it is So I think the proposed info field for remoteness is fine. If i understand correctly, they had some different original requirements anyway:
So maybe they were more interested in
|
in the meantime, can we use the env CONTAINER_HOST variable to discriminate? |
That was my point, that variable doesn't have to be in use. It could just be config files... When using the new
So it could be a remote connection, even without CONTAINER_HOST. Or local, with it. |
interesting
does this error guarantees me thath podman can only be used locally? |
I cannot really parse this sentence. The error means that the service is not running, either it is not available or configured wrong - or the user just forgot to start it ( But if you get the error message, it at least means that you were trying to run the remote client. Always something. |
yeah, sorry, I typed quickly, what I tried to mean is that if I have that error, that seems to mean that it can only run local, it can't use a remote client |
@afbjorklund I have RESTful API on the brain. Sorry for the noise. |
did you mean to close it @jwhonce ? 🤔 |
#10300 will auto-close. |
podman info
should have a field indicating whether it's a remote client or not (see kubernetes-sigs/kind#2235 (review)).The text was updated successfully, but these errors were encountered: