Trying to configure pod retention value  for Jenkins Kubernetes plugin using
groovy script.
kubernetes.setPodRetention(org.csanchez.jenkins.plugins.kube
rnetes.pod.retention.Podretention.Never())
method is failing to configure with below error :

Invalid value provided in main configuration No signature of method: static
org.csanchez.jenkins.plugins.kubernetes.pod.retention.PodRetention.Never()
is applicable for argument types: () values: []

tried configuring by using different values for the method:
kubernetes.setPodRetention(org.csanchez.jenkins.plugins.kube
rnetes.pod.retention.Never)

Error using the above value as well.

Please some one help me on this as i was struck with this from quite a long.

Below is the code:

import java.util.logging.Logger
import hudson.*
import hudson.model.*
import java.io.PrintWriter
import java.io.StringWriter
import jenkins.*
import jenkins.install.InstallState
import jenkins.model.*
import jenkins.util.xml.*
import javax.xml.xpath.*
import com.cloudbees.plugins.credentials.*
import com.cloudbees.plugins.credentials.impl.*
import com.cloudbees.plugins.credentials.common.*
import com.cloudbees.plugins.credentials.domains.*
import com.cloudbees.jenkins.plugins.sshcredentials.impl.*
import org.jenkinsci.plugins.plaincredentials.impl.*
import org.jenkinsci.plugins.docker.commons.credentials.*
import org.csanchez.jenkins.plugins.kubernetes.*
import org.csanchez.jenkins.plugins.kubernetes.pod.retention.PodRetention

KubernetesCloud kubernetes = new KubernetesCloud('test')
kubernetes.setServerUrl('http://test_url')
kubernetes.setMaxRequestsPerHostStr(20)
kubernetes.setPodRetention(org.csanchez.jenkins.plugins.kube
rnetes.pod.retention.PodRetention.Never())
kubernetes.setWaitForPodSec(90)

// documentation reference

 https://javadoc.jenkins.io/plugin/kubernetes/

// Method used
        setPodRetention(PodRetention podRetention)
Set the global pod retention policy for the plugin.

Can some let me know how to set the pod retention value using groovy with 
setPodRetention

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/63d27137-2d47-4d88-af53-c04ec482aa7a%40googlegroups.com.

Reply via email to