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

Kubernetes plugin declarative pipeline can't use readFile to read yaml file

XMLWordPrintable

      Using the following settings declarative pipeline:

      pipeline {
          agent {
              kubernetes {
                  cloud 'OpenShift'
                  label 'jenkins-agent-pod'
                  yaml readFile('k8s-podspec.yaml')
              }
          }
      ...

       

      Results in the following error from Jenkins:

      Running in Durability level: MAX_SURVIVABILITY
      [Pipeline] readFile
      Required context class hudson.FilePath is missing
      Perhaps you forgot to surround the code with a step that provides this, such as: node
      [Pipeline] End of Pipeline

       

       

            abayer Andrew Bayer
            el_psycho Kevin Carrasco
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: