Before version 0.11
      We were able to declare in the global jenkins configuration a PodTemplate with containers.

      Here an simple pipeline example that was working with a global PodTemplate with 0.10

      stage("Example"){
            node("mypod"){
                container("golang"){
                sh '''
                  echo "something"
                '''
              }
           }
      }
      

      With 0.11 we get an error:

      org.jenkinsci.plugins.workflow.steps.MissingContextVariableException: Required context class org.csanchez.jenkins.plugins.kubernetes.pipeline.PodTemplateStep is missing
      

      It is now (with 0.11) mandatory to have the PodTemplate and containers declare within the pipeline to be able to make the «container» step work again.

          [JENKINS-42315] PodTemplate is now mandatory within pipeline

          Pascal Laporte created issue -
          Carlos Sanchez made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Carlos Sanchez made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: In Progress [ 3 ] New: Closed [ 6 ]
          trace deng made changes -
          Comment [ I also encountered this problem, and follow this operation
          {code:java}
          // Using 0.11, global PodTemplate named "mypod":
          podTemplate(name: "mypod") {
            node("mypod") {
              stage("Build") {
                container("code-builder") {
                  // build steps elided
                }
              }
            }
          }{code}
          result like
          {code:java}
          // code placeholder
          [Pipeline] podTemplate
          [Pipeline] // podTemplate
          [Pipeline] End of Pipeline
          ERROR: Cloud does not exist: kubernetes
          Finished: FAILURE
          {code}
          I use kubernetes plugin 0.11,  when can you upgrade kubernets plugins?

            ]

            csanchez Carlos Sanchez
            pascallap Pascal Laporte
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: