Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-46712

vsphere "Check Template" button uses wrong credentials

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Trivial Trivial
    • vsphere-cloud-plugin
    • None
    • vsphere-cloud-plugin version 2.15
      More than one "Template" defined within a cloud.

      On the second, and subsequent, vSphere templates (within a cloud), the "Check Template" button uses the SSH credentials specified in the previous template to log in to vSphere when checking instead of using the credentials specified in the vSphere cloud.

      This means that the "Check Template" button only works on the first template in any given cloud.

       

      To reproduce:

      1. Define a vSphere cloud, setting host and credentials etc.
      2. Define a vSphere template, setting SSH credentials to either "none" or ones that are not valid for your vSphere cloud.
      3. Define a second vSphere template, set the Master Image name etc and press the "Check Template" button.
      4. Now change the SSH credentials for the first template to be the same as those used to log in to vSphere and press the "Check Template" button again.

      What happens:

      • The first check fails because it is unable to log in to vSphere in order to carry out the check.
      • The second passes.

      What should happen instead:

      • Both checks should use the credentials specified for the cloud login (and pass!) instead of using the SSHLauncher's credentials for the template above.

      This seems to be because the code uses the same name "credentialsId" for both the SSHLauncher configuration and the cloud credentials, meaning that jelly/stapler can't tell them apart and blindly uses "the closest credentialsId above us".

       

      My guess is that renaming the credentialsId field for the cloud (in a backwards-compatible way!) would probably solve this.

            Unassigned Unassigned
            pjdarton pjdarton
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: