ClusterLabs / resource-agents

Combined repository of OCF agents from the RHCS and Linux-HA projects
GNU General Public License v2.0
493 stars 580 forks source link

ocf:heartbeat:docker-compose fails with docker compose #1974

Open minal3 opened 5 days ago

minal3 commented 5 days ago

Hello,

I am using Ubuntu Server 24.04 as OS for my corosync/pacemaker cluster. docker-compose-v2 is the new APT package for docker compose, and syntax has slightly changed:

ocf:heartbeat:docker-compose still uses the old syntax. I had to edit RA code as follows:

OCF_RESKEY_binpath_default=/usr/bin/docker

if [ -r "$OCF_RESKEY_binpath" -a -x "$OCF_RESKEY_binpath" ]; then
    COMMAND="$OCF_RESKEY_binpath compose"
else
    COMMAND="$OCF_RESKEY_binpath_default compose"
fi

My docker-compose resource is running fine. I guess the above stands as a bug for users of Docker Compose V2.

Thanks,

oalbrigt commented 4 days ago

Does this work for "docker ps" and other calls as well?

If so we probably need to know the output from docker --version or similar to be able to detect version and add compose to all calls.

oalbrigt commented 4 days ago

Nevermind. I realized it's binpath isnt used for those calls.

oalbrigt commented 4 days ago

I've made a patch: https://github.com/ClusterLabs/resource-agents/pull/1975

Tell me if that solves the issue.

minal3 commented 4 days ago

Just suggested a change for patch #1975.