Pipeline DSL has security exception if pipeline map defined outside of the method scope

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      Even if security is disabled you'll get a SecurityException with the following code:

      class A {
        def context
        def p
        def A(ctx) {
          this.ctx = ctx
          this.p = [ "a": {this.a}]
        }
        def a() {
          ctx.echo "hi"
        }
        def b() {
          ctx.node("master") {
            ctx.parallel p
          }
        }
      }
      

      (new A(this)).b()

      However flattening the parallel as

       ctx.parallel ["a": {this.a}]
      

      is OK, as is making a local variable for the parallel mapping.  I believe this behavior changed with the recent update to Jenkins security.

            Assignee:
            Unassigned
            Reporter:
            Kevin Browder
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Archived: