Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-68487

Using pod yaml option in CASC

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • kubernetes-plugin
    • None

      Hi,

      Looking for documentation on how to use the yaml pod spec option with CASC. Is there an example somewhere ? I tried specifying it as a string as documented on the plugin website using yaml ''' xxxx ''', but this generates the following error:

      java.lang.ClassCastException: class java.lang.String cannot be cast to class java.util.Map (java.lang.String and java.util.Map are in module java.base of loader 'bootstrap')
          at io.fabric8.kubernetes.client.utils.Serialization.unmarshalYaml(Serialization.java:370)
          at io.fabric8.kubernetes.client.utils.Serialization.unmarshal(Serialization.java:311)
          at io.fabric8.kubernetes.client.utils.Serialization.unmarshal(Serialization.java:267)
          at io.fabric8.kubernetes.client.utils.Serialization.unmarshal(Serialization.java:255)
          at io.fabric8.kubernetes.client.dsl.base.OperationSupport.unmarshal(OperationSupport.java:738)
          at io.fabric8.kubernetes.client.dsl.base.BaseOperation.load(BaseOperation.java:259)
          at io.fabric8.kubernetes.client.dsl.base.BaseOperation.load(BaseOperation.java:83)
          at org.csanchez.jenkins.plugins.kubernetes.PodTemplateUtils.parseFromYaml(PodTemplateUtils.java:605)

      Also, the configuration in Jenkins ended up having a "yaml" and a "yamls" property both with the same string value. I don't see "yamls" documented.

      We're using 1.31.3 plugin version.

            Unassigned Unassigned
            dg424 Donald Gobin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: