• Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Minor Minor
    • kubernetes-plugin
    • None

      Would it make sense to introduce an option to expand groovy variables in the supplied yamlFile? 

      pipeline {
          agent {
              kubernetes {
                  label 'mypod'
                  defaultContainer 'jnlp'
                  yamlFile 'KubernetesPod.yaml'
              }
          }
          stages {
              ...
          }
      }

       

      Variable expansion works fine with the inline parameter

       

       yaml: """
         ...
       """

       

       

          [JENKINS-53094] Option to expand variables in yamlFile

          Oleg Gumbar added a comment -

          Agreed. Plugin is quite useless for some advanced cases without this feature. My case is I use complex kilometer yaml templates with separate docker images for each commit for tests in parallel. I wouldn't like to include 5kb yaml in each parallel step, instead of this I would like to inject env vars I need in target yaml file for each parallel step.

          Oleg Gumbar added a comment - Agreed. Plugin is quite useless for some advanced cases without this feature. My case is I use complex kilometer yaml templates with separate docker images for each commit for tests in parallel. I wouldn't like to include 5kb yaml in each parallel step, instead of this I would like to inject env vars I need in target yaml file for each parallel step.

          Yes would love to see this feature! Including  yaml in the jenkinsfile is very inconvenient.

          Marc De Leenheer added a comment - Yes would love to see this feature! Including  yaml in the jenkinsfile is very inconvenient.

          Julian Wilkinson added a comment - - edited

          Yeah... this would make declarative jenkinsfiles a lot cleaner  +1
          + I don't think it's uncommon to need to use a value from previous stages in new pods

          Julian Wilkinson added a comment - - edited Yeah... this would make declarative jenkinsfiles a lot cleaner  +1 + I don't think it's uncommon to need to use a value from previous stages in new pods

          Yes please I am also interested in this feature but as part of the readYaml function.

          roric olivares added a comment - Yes please I am also interested in this feature but as part of the readYaml function.

          Rohan added a comment -

          +1 for this feature, any plans to include this ?

          Rohan added a comment - +1 for this feature, any plans to include this ?

          Oliver Grad added a comment -

          +1 for this feature

          Oliver Grad added a comment - +1 for this feature

          +1 for this feature

          Raghuveer Nanduri added a comment - +1 for this feature

            Unassigned Unassigned
            ginsul Gintautas Sulskus
            Votes:
            8 Vote for this issue
            Watchers:
            15 Start watching this issue

              Created:
              Updated: