title: How can I create a shared library in Jenkins with both arguments and a body?
body: <p>Basically I want to create a shared library in Jenkins which turns:</p>
  
  <pre><code>kPod(label: label){
      body
  }
  </code></pre>
  
  <p>into:</p>
  
  <pre><code>podTemplate(label: label, //use argument as label
  containers: [containerTemplate(name: 'jnlp', image: 'someImage', args: '${computer.jnlpmac} ${computer.name}')],
  volumes: [hostPathVolume(hostPath: '/var/run/docker.sock', mountPath: '/var/run/docker.sock')]) {
      //put body here
  }
  </code></pre>
  
  <p>However all the examples I see either allow you to access the arguments OR the body, but not both. The doc has no mention of it either: <a href="https://jenkins.io/doc/book/pipeline/shared-libraries/" rel="nofollow noreferrer">https://jenkins.io/doc/book/pipeline/shared-libraries/</a></p>
  
  <p>But it clearly is possible since the podTemplate step itself is doing what I want.</p>