This PR contains some fixes in the podman driver behaviour when there are multiple sockets in use. Additionally, I've written regression tests that test the behaviour of having multiple sockets.
Fixes:
If there was one socket with a name different from "default", the attributes would not get prefixed with driver.podman.attrName but with driver.podman.<name of socket>.attrName. Since this would break existing nomad scheduling, now if a socket is the default socket (isDefaultClient() returns true), attributes are written with the driver.podman.attrName syntax. Also added `driver.podman.[.]socketName attribute so it's still possible to find the name when it's the default (+ makes it easier if you're using attribute filtering to verify podman has the low-priv socket you want)
I implemented a clean string function cleanUpSocketName() for the purpose of having nice attribute names but by cleaning it before using it as a key in podmanClient map, it made it so that it was no longer "found" by other operations using the map and not cleaning the socket name. Since the internal representation of the socket name as a key in a map is safe, I removed the cleanup function and only apply it where I wanted it: in the attributes.
driver_test.go contains the Tests that validate this behaviour.
This PR contains some fixes in the podman driver behaviour when there are multiple sockets in use. Additionally, I've written regression tests that test the behaviour of having multiple sockets.
Fixes:
driver.podman.attrName
but withdriver.podman.<name of socket>.attrName
. Since this would break existing nomad scheduling, now if a socket is the default socket (isDefaultClient()
returns true), attributes are written with thedriver.podman.attrName
syntax. Also added `driver.podman.[cleanUpSocketName()
for the purpose of having nice attribute names but by cleaning it before using it as a key in podmanClient map, it made it so that it was no longer "found" by other operations using the map and not cleaning the socket name. Since the internal representation of the socket name as a key in a map is safe, I removed the cleanup function and only apply it where I wanted it: in the attributes.driver_test.go
contains the Tests that validate this behaviour.