The example given on https://github.com/jenkinsci/kubernetes-pipeline-plugin/blob/master/kubernetes-steps/readme.md (see below) is incorrect and results in an error.

      kubernetes.pod('buildpod')
          .withNewContainer().withName(<name1>).withImage(<image1>)
                             .withEnv(<key1>,<value1>) //incorrect
                             .withSecret(<mount path>, <secret name>)  //incorrect
                             .and()
          .withNewContainer().withName(<name2>).withImage(<image2>).inside {                       
              sh '<some shell commands that are going to be run inside name2>'
      }
      

      Error

      hudson.remoting.ProxyException: groovy.lang.MissingMethodException: No signature of method: static io.fabric8.kubernetes.pipeline.Kubernetes.withEnv() is applicable for argument types: (java.lang.String, java.lang.String) 
      

      More info is on https://github.com/fabric8io/fabric8-pipeline-library/issues/69

          [JENKINS-41702] Example on github is incorrect

          Anton Hughes created issue -
          Anton Hughes made changes -
          Description Original: The example given on https://github.com/jenkinsci/kubernetes-pipeline-plugin/blob/master/kubernetes-steps/readme.md (see below) is incorrect and results in an error.


          {code:java}
          kubernetes.pod('buildpod')
              .withNewContainer().withName(<name1>).withImage(<image1>)
                                 .withEnv(<key1>,<value1>) //incorrect
                                 .withSecret(<mount path>, <secret name>)
                                 .and()
              .withNewContainer().withName(<name2>).withImage(<image2>).inside {
                  sh '<some shell commands that are going to be run inside name2>'
          }
          {code}


          h3. Error


          {noformat}
          hudson.remoting.ProxyException: groovy.lang.MissingMethodException: No signature of method: static io.fabric8.kubernetes.pipeline.Kubernetes.withEnv() is applicable for argument types: (java.lang.String, java.lang.String)
          {noformat}
          New: The example given on https://github.com/jenkinsci/kubernetes-pipeline-plugin/blob/master/kubernetes-steps/readme.md (see below) is incorrect and results in an error.


          {code:java}
          kubernetes.pod('buildpod')
              .withNewContainer().withName(<name1>).withImage(<image1>)
                                 .withEnv(<key1>,<value1>) //incorrect
                                 .withSecret(<mount path>, <secret name>)
                                 .and()
              .withNewContainer().withName(<name2>).withImage(<image2>).inside {
                  sh '<some shell commands that are going to be run inside name2>'
          }
          {code}


          h3. Error




          {code:java}
          hudson.remoting.ProxyException: groovy.lang.MissingMethodException: No signature of method: static io.fabric8.kubernetes.pipeline.Kubernetes.withEnv() is applicable for argument types: (java.lang.String, java.lang.String)
          {code}


          More info is on https://github.com/fabric8io/fabric8-pipeline-library/issues/69

          Anton Hughes made changes -
          Description Original: The example given on https://github.com/jenkinsci/kubernetes-pipeline-plugin/blob/master/kubernetes-steps/readme.md (see below) is incorrect and results in an error.


          {code:java}
          kubernetes.pod('buildpod')
              .withNewContainer().withName(<name1>).withImage(<image1>)
                                 .withEnv(<key1>,<value1>) //incorrect
                                 .withSecret(<mount path>, <secret name>)
                                 .and()
              .withNewContainer().withName(<name2>).withImage(<image2>).inside {
                  sh '<some shell commands that are going to be run inside name2>'
          }
          {code}


          h3. Error




          {code:java}
          hudson.remoting.ProxyException: groovy.lang.MissingMethodException: No signature of method: static io.fabric8.kubernetes.pipeline.Kubernetes.withEnv() is applicable for argument types: (java.lang.String, java.lang.String)
          {code}


          More info is on https://github.com/fabric8io/fabric8-pipeline-library/issues/69

          New: The example given on https://github.com/jenkinsci/kubernetes-pipeline-plugin/blob/master/kubernetes-steps/readme.md (see below) is incorrect and results in an error.


          {code:java}
          kubernetes.pod('buildpod')
              .withNewContainer().withName(<name1>).withImage(<image1>)
                                 .withEnv(<key1>,<value1>) //incorrect
                                 .withSecret(<mount path>, <secret name>) //incorrect
                                 .and()
              .withNewContainer().withName(<name2>).withImage(<image2>).inside {
                  sh '<some shell commands that are going to be run inside name2>'
          }
          {code}


          h3. Error




          {code:java}
          hudson.remoting.ProxyException: groovy.lang.MissingMethodException: No signature of method: static io.fabric8.kubernetes.pipeline.Kubernetes.withEnv() is applicable for argument types: (java.lang.String, java.lang.String)
          {code}


          More info is on https://github.com/fabric8io/fabric8-pipeline-library/issues/69

            iocanel Ioannis Canellos
            anton93 Anton Hughes
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: