JCasC plugin does not apply all of the 'Nomad plugin' related entries from jenkins.yaml although these entries are listed in the JSON schema (<jenkins_url>/configuration-as-code/schema). In the result the Nomad plugin is not well configured and java.lang.NullPointerException are caused in the plugin's code when a slave is set up (e.g. at org.jenkinsci.plugins.nomad.NomadApi.buildDriverConfig(NomadApi.java:142)). The missing entries in my case are
- org.jenkinsci.plugins.nomad.NomadCloud.jenkinsTunnel
- org.jenkinsci.plugins.nomad.NomadSlaveTemplate.remoteFs
- org.jenkinsci.plugins.nomad.NomadSlaveTemplate.prefixCmd
If I add them manually to the Jenkins' config.xml the setup of a Nomad slave succeeds. Beside that the export of the configuration causes an StackOverflowError: FAILED TO EXPORT org.jenkinsci.plugins.nomad.NomadSlaveTemplate#cloud: java.lang.StackOverflowError at java.util.Collections$UnmodifiableCollection$1.<init>(Collections.java:1039) at java.util.Collections$UnmodifiableCollection.iterator(Collections.java:1038) ... Caused: java.lang.reflect.InvocationTargetException at sun.reflect.GeneratedConstructorAccessor133.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.describe(DataBoundConfigurator.java:265) at io.jenkins.plugins.casc.Attribute.describe(Attribute.java:202) at io.jenkins.plugins.casc.BaseConfigurator.compare(BaseConfigurator.java:391) at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.describe(DataBoundConfigurator.java:268) at io.jenkins.plugins.casc.Attribute.describe(Attribute.java:198) This seems to be caused by recursive loop: The cloud definition contains an arry of node templates. Each template definition contains a cloud object which references the cloud object which this template list belongs to. |