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

kubernetes plugin Allow variables to be passed from Jenkinsfile to the pod template

      Hello,

      I would like to be able to pass variables declared in a Jenkinsfile to the pod template.

      Example: create an environment variable and use it in order to use the image tag that I want without creating multiple pod templates one for each version. It's not quite a template if I can't have some variables in it (other than the containers envVars)

       

      From the kubectl logs:

       Warning  InspectFailed          4s (x3 over 6s)  kubelet            Failed to apply default image tag "${DOCKER_REGISTRY}/jenkins/inbound-agent:${VARIABLE}": couldn't parse image reference "${DOCKER_REGISTRY}/jenkins/inbound-agent:${VARIABLE}": invalid reference format
       Warning  FailedCreate           4s (x3 over 6s)  kubelet            Error: InvalidImageName

          [JENKINS-72569] kubernetes plugin Allow variables to be passed from Jenkinsfile to the pod template

          Adrian Paraschiv created issue -
          Adrian Paraschiv made changes -
          Description Original: Hello,

          I would like to be able to pass variables declared in a Jenkinsfile to the pod template.

          Example: create an ENV variable and use it in order to use the image tag that I want without creating multiple pod templates one for each version. It's not quite a template if I can't have some variables in it (other than the containers envVars)

          !image-2024-01-16-21-14-23-262.png!
          New: Hello,

          I would like to be able to pass variables declared in a Jenkinsfile to the pod template.

          Example: create an environment variable and use it in order to use the image tag that I want without creating multiple pod templates one for each version. It's not quite a template if I can't have some variables in it (other than the containers envVars)

          !image-2024-01-16-21-14-23-262.png!
          Adrian Paraschiv made changes -
          Description Original: Hello,

          I would like to be able to pass variables declared in a Jenkinsfile to the pod template.

          Example: create an environment variable and use it in order to use the image tag that I want without creating multiple pod templates one for each version. It's not quite a template if I can't have some variables in it (other than the containers envVars)

          !image-2024-01-16-21-14-23-262.png!
          New: Hello,

          I would like to be able to pass variables declared in a Jenkinsfile to the pod template.

          Example: create an environment variable and use it in order to use the image tag that I want without creating multiple pod templates one for each version. It's not quite a template if I can't have some variables in it (other than the containers envVars)

          !image-2024-01-16-21-14-23-262.png!

           

          From the kubectl logs:

           

           
          {code:java}
           Warning  InspectFailed          4s (x3 over 6s)  kubelet            Failed to apply default image tag "${DOCKER_REGISTRY}/jenkins/inbound-agent:${VARIABLE}": couldn't parse image reference "${DOCKER_REGISTRY}/jenkins/inbound-agent:${VARIABLE}": invalid reference format
            Warning  FailedCreate           4s (x3 over 6s)  kubelet            Error: InvalidImageName{code}
          Adrian Paraschiv made changes -
          Description Original: Hello,

          I would like to be able to pass variables declared in a Jenkinsfile to the pod template.

          Example: create an environment variable and use it in order to use the image tag that I want without creating multiple pod templates one for each version. It's not quite a template if I can't have some variables in it (other than the containers envVars)

          !image-2024-01-16-21-14-23-262.png!

           

          From the kubectl logs:

           

           
          {code:java}
           Warning  InspectFailed          4s (x3 over 6s)  kubelet            Failed to apply default image tag "${DOCKER_REGISTRY}/jenkins/inbound-agent:${VARIABLE}": couldn't parse image reference "${DOCKER_REGISTRY}/jenkins/inbound-agent:${VARIABLE}": invalid reference format
            Warning  FailedCreate           4s (x3 over 6s)  kubelet            Error: InvalidImageName{code}
          New: Hello,

          I would like to be able to pass variables declared in a Jenkinsfile to the pod template.

          Example: create an environment variable and use it in order to use the image tag that I want without creating multiple pod templates one for each version. It's not quite a template if I can't have some variables in it (other than the containers envVars)

          !image-2024-01-16-21-14-23-262.png!

           

          From the kubectl logs:
          {code:java}
           Warning  InspectFailed          4s (x3 over 6s)  kubelet            Failed to apply default image tag "${DOCKER_REGISTRY}/jenkins/inbound-agent:${VARIABLE}": couldn't parse image reference "${DOCKER_REGISTRY}/jenkins/inbound-agent:${VARIABLE}": invalid reference format
           Warning  FailedCreate           4s (x3 over 6s)  kubelet            Error: InvalidImageName{code}

            Unassigned Unassigned
            screwyy Adrian Paraschiv
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: