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

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

      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

       

       

            Assignee:
            Andrew Bayer
            Reporter:
            Kevin Carrasco
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: