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

POD inheritance in declarative Pipeline documentation unclear

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • kubernetes-plugin
    • None

      Consulting the kubernetes plugin readme you'll find the following statements
      ...

      Note that it was previously possible to define containerTemplate but that has been deprecated in favor of the yaml format.

      ...
      and
      ...

      Unlike scripted k8s template, declarative templates do not inherit from parent template. Since the agents declared at stage level can override a global agent, implicit inheritance was leading to confusion.

      You need to explicitly declare the inheritance if necessary using the field inheritFrom.

      In the following example, nested-pod will only contain the maven container.

      ...
      In the following there's an example about where there's no inheritance happening. But there's no single example about how to use inheritFrom with declarative Pipeline.
      Tried to define a name for the outer POD to inherit from using several different things, but seems like I did not find the right place to do so.

      Please improve the documentation making it more clear about how to use this feature (if it is supposed to work).

          [JENKINS-67709] POD inheritance in declarative Pipeline documentation unclear

          Joerg Schwaerzler created issue -

            Unassigned Unassigned
            macdrega Joerg Schwaerzler
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: