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

sshagent step doesn't error if the credentials named do not exist

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • ssh-agent-plugin
    • None

      In my Pipeline script, I name credentials for the sshagent step, but when those credentials do not exist, no error happens.

      node {
        sshagent(credentials: ['some-nonexistent-id']) {
          sh 'script-which-needs-ssh-credentials.sh'
        }
      }
      

      I would have expected a typed exception (e.g. CredentialsUnavailableException) to be thrown, instead the closure happily continues and invokes the script which required the credentials

            Unassigned Unassigned
            rtyler R. Tyler Croy
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: