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

JobDSL Folder Creation Destroys Credentials

    Details

    • Similar Issues:

      Description

      When using job-dsl-plugin to create a folder 

      folder(my_folder) { 

        displayname("my_folder_name")

      }

      If the folder exists with Credentials attached to it, they are lost on recreation  . Is there anyway to wrap this in a conditional? if!(folder(my_folder) {blah..blah....}.  I believe the desired behaviour here is to not blow away the credentials attached at the folder level.

       

       

        Attachments

          Issue Links

            Activity

            Hide
            mramaraju0461 Venkata Mudunuri added a comment -

            That worked for me. One suggestion, use getItemByFullName() instead of getItem() to capture the credentials at sub folder level

            Show
            mramaraju0461 Venkata Mudunuri added a comment - That worked for me. One suggestion, use getItemByFullName() instead of getItem() to capture the credentials at sub folder level
            Hide
            sype Sean Sype added a comment -

            This would be nice so we can have separated credentials and allow users access to their "own" without having to re-create every time. 

            Show
            sype Sean Sype added a comment - This would be nice so we can have separated credentials and allow users access to their "own" without having to re-create every time. 
            Hide
            tony_k tony kerz added a comment -

            i have a job that creates jobs in a tree, like:

             

            foo/bar/baz/job-1

            foo/bar/baz/job-2

            etc

             

            and i placed creds at the foo folder level, but every time i create another foo/bar/baz/job-x it blows away the creds at the foo folder!

            not expected behavior and kind of a hassle to work around, i agree with folks on this thread that think that creds at existing folders should not be effected in this way...

             

            Show
            tony_k tony kerz added a comment - i have a job that creates jobs in a tree, like:   foo/bar/baz/job-1 foo/bar/baz/job-2 etc   and i placed creds at the foo folder level, but every time i create another foo/bar/baz/job-x it blows away the creds at the foo folder! not expected behavior and kind of a hassle to work around, i agree with folks on this thread that think that creds at existing folders should not be effected in this way...  
            Hide
            slowikone Bartlomiej Slowik added a comment -

            Same issue here - its makes hard in our use case to manage auto-creation of folders and jobs. I would also favor an update/merge strategy instead of a hard override.

            Show
            slowikone Bartlomiej Slowik added a comment - Same issue here - its makes hard in our use case to manage auto-creation of folders and jobs. I would also favor an update/merge strategy instead of a hard override.
            Hide
            docwhat Christian Höltje added a comment -

            The deletion of credentials is so unexpected. I just lost 95 folders with 100s of credentials due to this. I cannot express how frustrating this is.

            I was able to recover most via the Job Config History plugin, but apparently "Secret File" credentials are magic and seem to be truly gone.

            Show
            docwhat Christian Höltje added a comment - The deletion of credentials is so unexpected. I just lost 95 folders with 100s of credentials due to this. I cannot express how frustrating this is. I was able to recover most via the Job Config History plugin, but apparently "Secret File" credentials are magic and seem to be truly gone.

              People

              • Assignee:
                daspilker Daniel Spilker
                Reporter:
                smithx10 Bruce Smith
              • Votes:
                8 Vote for this issue
                Watchers:
                17 Start watching this issue

                Dates

                • Created:
                  Updated: