A simple solution might be to simply to query the cluster to determine the master before running commands that require the presence of the Swarm master.
I'm not sure what the best way to do this is, but one way is to iterate through the machines and run inspect on each until you find the master. Then you run env like we do now.
A simple solution might be to simply to query the cluster to determine the master before running commands that require the presence of the Swarm master.
I'm not sure what the best way to do this is, but one way is to iterate through the machines and run
inspect
on each until you find the master. Then you runenv
like we do now.