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

AD Plugin creates partial configuration if error connecting

    Details

    • Similar Issues:

      Description

      The AD plugin checks for connectivity during its initialization:
      https://github.com/jenkinsci/active-directory-plugin/blob/fd842788a91d34cac5061045a2a937353c9b908c/src/main/java/hudson/plugins/active_directory/ActiveDirectoryDomain.java#L302

      Configuring at startup via init.d groovy:

      def instance = Jenkins.getInstance()
      
      println "--> configure LDAP"
      String domain = "server.domain.com"
      String site = "site"
      String server = "server:3268"
      String bindName = "username"
      String bindPassword = 'password'
      
      adrealm = new ActiveDirectorySecurityRealm(domain, site, bindName, bindPassword, server)
      instance.setSecurityRealm(adrealm)
      

      If this fails, it will throw an error at startup but will also create partial configuration, causing havoc:

          <domains>
            <hudson.plugins.active__directory.ActiveDirectoryDomain>
              <name></name>
              <servers>server:3268</servers>
              <bindPassword>{redact}</bindPassword>
            </hudson.plugins.active__directory.ActiveDirectoryDomain>
          </domains>
      

      It creates the block but leaves out bindName whic is not indicitive of a failure. It should either create NO configuration block on failure or add the bindName instead of only leaving out a piece.

        Attachments

          Issue Links

            Activity

            myoung34 marc young created issue -
            myoung34 marc young made changes -
            Field Original Value New Value
            Link This issue is related to JENKINS-44822 [ JENKINS-44822 ]
            kpsimoulis Konstantinos Psimoulis made changes -
            Link This issue is related to JENKINS-32710 [ JENKINS-32710 ]

              People

              • Assignee:
                fbelzunc FĂ©lix Belzunce Arcos
                Reporter:
                myoung34 marc young
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated: