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

Cloud agent is not requested when correct label is used

XMLWordPrintable

      Using docker workflow 572.v950f58993843

      If I specificy a whole pipeline to run on a cloud agent (configured with ec2-fleet plugin with a label of ec2-generic) then an agent is never requested. If the entire job is instead requested to be on an agent with just the label, and without using the {{docker {} }} agent type then everything works OK.

      Example that fails to scale up the cloud agents:

      pipeline {
          agent {
              docker {
                  label "ec2-generic"
                  image "139506524607.dkr.ecr.eu-west-2.amazonaws.com/container:latest"
              }
          }
          stages {
              stage('Checkout Code') {
                  steps {
                      git branch: 'main',
                          credentialsId: 'github',
                          url: 'https://github.com/org/repo.git'
                  }
              }
          }
      }
      

       Example that works:

      pipeline {
          agent {
              label "ec2-generic"
          }
          stages {
              stage('Checkout Code') {
                  steps {
                      git branch: 'main',
                          credentialsId: 'github',
                          url: 'https://github.com/org/repo.git'
                  }
              }
          }
      }
      

            Unassigned Unassigned
            brianopteran Brian
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: