jenkins-swarm-slave-docker icon indicating copy to clipboard operation
jenkins-swarm-slave-docker copied to clipboard

Multiple labels cause failure in launching the agent

Open ctran opened this issue 6 years ago • 5 comments

It seems that the label flag is not working when it has space separated values like

-labels "dedicated fast faster"

ctran avatar Sep 13 '18 18:09 ctran

This is working for me on latest, same command and labels, with the multiple labels being reflected on the jenkins side. Is the plugin up-to-date in jenkins?

Or perhaps it is updated, but your local container image is outdated?

krumware avatar Sep 27 '18 23:09 krumware

Experiencing the same issue with the image, using Swarm plugin 3.15 on the master.

Feb 22, 2019 2:56:08 AM hudson.plugins.swarm.Client main
SEVERE: CmdLineException occurred during parseArgument
org.kohsuke.args4j.CmdLineException: No argument is allowed: staging
	at org.kohsuke.args4j.CmdLineParser.parseArgument(CmdLineParser.java:509)
	at hudson.plugins.swarm.Client.main(Client.java:46)

rafaelmagu avatar Feb 22 '19 02:02 rafaelmagu

If I take the command that the entry point scripts tells me it is going to run and run it myself on the shell, it works. Something funky is happening when you set LABELS="foo bar" as an environment variable for the container.

rafaelmagu avatar Feb 22 '19 03:02 rafaelmagu

Same issue here: Apparently the next if statements are not working:

      if [ ! -z "$CANDIDATE_TAG"]; then
        PARAMS="$PARAMS -candidateTag $CANDIDATE_TAG"
      fi
      if [ "${DELETE_EXISTING_CLIENTS}x" = "truex"]; then
        PARAMS="$PARAMS -deleteExistingClients"
      fi
      if [ "${DISABLE_CLIENTS_UNIQUE_ID}x" = "truex"]; then
        PARAMS="$PARAMS -disableClientsUniqueId"
      fi
      if [ "${DISABLE_SSL_VERIFICATION}x" = "truex"]; then
        PARAMS="$PARAMS -disableSslVerification"
fi

Anyway, it is a trivial fix

arbulu89 avatar Apr 11 '19 09:04 arbulu89

Perhaps you forgot to quote the labels before using them?

LABELS="foo bar"

swarm-client.jar -labels "${LABELS}"

mbtronics avatar Oct 21 '21 13:10 mbtronics