ClusterLabs / fence-agents

Fence agents
104 stars 160 forks source link

fence_docker: Connect to Docker via a UNIX socket #583

Closed marjus45 closed 5 months ago

marjus45 commented 5 months ago

With this change we extend the Docker connection options to connect via a UNIX socket. To do so we add a new command line argument --unix-socket which expects the path to the Docker socket.

Also in order for this to make sense we disable the default setting of the SSL verification.

Closes #581 Closes #582

knet-jenkins[bot] commented 5 months ago

Can one of the admins check and authorise this run please: https://ci.kronosnet.org/job/fence-agents/job/fence-agents-pipeline/job/PR-583/1/input

oalbrigt commented 5 months ago

You can use --ssl-insecure, so you shouldnt change the default value of SSL.

You can add a note to the longdesc of --unix-socket that it is required.

oalbrigt commented 5 months ago

And you will have to run make xml-upload to update the test metadata, or our CI tests will fail.

marjus45 commented 5 months ago

You can use --ssl-insecure, so you shouldnt change the default value of SSL. You can add a note to the longdesc of --unix-socket that it is required.

Thanks for the reply @oalbrigt , as we discussed in https://github.com/ClusterLabs/fence-agents/issues/581, I can't use both --ssl-insecure and run over HTTP. I tried using the --ssl-insecure option when using a UNIX socket but it doesn't work:

2024-06-03 15:12:47,700 ERROR: Connection failed
2024-06-03 15:12:47,701 ERROR: Failed: Unable to obtain correct plug status or plug is not available

I could make running over UNIX socket a special case and configure the send_cmd accordinly, but I think it's better if we support both HTTP and HTTPS connections. So as you suggested I will add an extra parameter, the --disable-ssl.

marjus45 commented 5 months ago

And you will have to run make xml-upload to update the test metadata, or our CI tests will fail.

Thanks @oalbrigt , I have missed this section in the docs. When I am running ./configure from my forked repository I get the following error:

configure: using source epoch 2024-06-03 12:27:59 UTC
configure: error: 
  configure was unable to determine the source tree's current version. This
  generally happens when using git archive (or the github download button)
  generated tarball/zip file. In order to workaround this issue, either use
  git clone https://github.com/ClusterLabs/fence-agents.git or use an
  official release tarball. Alternatively you can add a compatible version
  in a .tarball-version file at the top of the source tree, wipe your
  autom4te.cache dir and generated configure, and rerun autogen.sh.

while on the direct clone it works as expected. Do you know why this happens?

oalbrigt commented 5 months ago

Try running make maintainer-clean first. It should clean up anything that's been cached. If that doesnt work post the output from git remote -v.

knet-jenkins[bot] commented 5 months ago

Can one of the admins check and authorise this run please: https://ci.kronosnet.org/job/fence-agents/job/fence-agents-pipeline/job/PR-583/2/input

marjus45 commented 5 months ago

Thanks @oalbrigt , I updated the XML file, and changed the approach to use the --disable-ssl flag to connect to Docker over HTTP, which will also allow running over a UNIX socket. Can you have a look again?

oalbrigt commented 5 months ago

Thanks.