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

vsphere "Check Template" button uses wrong credentials

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Trivial
    • Resolution: Duplicate
    • Component/s: vsphere-cloud-plugin
    • Labels:
      None
    • Environment:
      vsphere-cloud-plugin version 2.15
      More than one "Template" defined within a cloud.
    • Similar Issues:

      Description

      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.

        Attachments

          Issue Links

            Activity

            Hide
            pjdarton pjdarton added a comment -

            This was first reported in JENKINS-40336 - closing this one as a duplicate.

            Show
            pjdarton pjdarton added a comment - This was first reported in JENKINS-40336 - closing this one as a duplicate.

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: