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

labels field is ignored when set through configuration-as-code

      Though everything looks fine, that field when set from the yaml is shown empty on the UI.
      I think something is wrong somewhere, not sure if on EC2 side, CasC, or both.

      Going to contribute a test case.

      The logs when starting up the instance:

      [INFO][2018-07-02 12:27:30] Setting hudson.model.Hudson@497e4c79.systemMessage = Welcome to Jenkins Essentials! (from org.jenkinsci.plugins.casc.BaseConfigurator configure)
      [INFO][2018-07-02 12:27:31] Setting class hudson.plugins.ec2.AmazonEC2Cloud.cloudName = ec2 (from org.jenkinsci.plugins.casc.DataBoundConfigurator configure)
      [INFO][2018-07-02 12:27:31] Setting class hudson.plugins.ec2.AmazonEC2Cloud.useInstanceProfileForCredentials = true (from org.jenkinsci.plugins.casc.DataBoundConfigurator configure)
      [INFO][2018-07-02 12:27:31] Setting class hudson.plugins.ec2.AmazonEC2Cloud.privateKey = **** (from org.jenkinsci.plugins.casc.DataBoundConfigurator configure)
      [INFO][2018-07-02 12:27:31] Setting class hudson.plugins.ec2.AmazonEC2Cloud.instanceCapStr = 20 (from org.jenkinsci.plugins.casc.DataBoundConfigurator configure)
      [INFO][2018-07-02 12:27:31] Setting class hudson.plugins.ec2.SlaveTemplate.ami = ami-0c6bb742864ffa3f3 (from org.jenkinsci.plugins.casc.DataBoundConfigurator configure)
      [INFO][2018-07-02 12:27:31] Setting class hudson.plugins.ec2.SlaveTemplate.securityGroups = **** (from org.jenkinsci.plugins.casc.DataBoundConfigurator configure)
      [INFO][2018-07-02 12:27:31] Setting class hudson.plugins.ec2.SlaveTemplate.remoteFS = /home/ec2-user (from org.jenkinsci.plugins.casc.DataBoundConfigurator configure)
      [INFO][2018-07-02 12:27:31] Setting class hudson.plugins.ec2.SlaveTemplate.type = T2Xlarge (from org.jenkinsci.plugins.casc.DataBoundConfigurator configure)
      [INFO][2018-07-02 12:27:31] Setting class hudson.plugins.ec2.SlaveTemplate.description = EC2 Agent (from org.jenkinsci.plugins.casc.DataBoundConfigurator configure)
      [INFO][2018-07-02 12:27:31] Setting class hudson.plugins.ec2.SlaveTemplate.userData =  (from org.jenkinsci.plugins.casc.DataBoundConfigurator configure)
      [INFO][2018-07-02 12:27:31] Setting class hudson.plugins.ec2.SlaveTemplate.remoteAdmin = ec2-user (from org.jenkinsci.plugins.casc.DataBoundConfigurator configure)
      [INFO][2018-07-02 12:27:31] Setting class hudson.plugins.ec2.AmazonEC2Cloud.templates = [{labels=agent}] (from org.jenkinsci.plugins.casc.DataBoundConfigurator configure)
      [INFO][2018-07-02 12:27:31] Setting hudson.model.Hudson@497e4c79.clouds = [hudson.plugins.ec2.AmazonEC2Cloud@26f61b7b] (from org.jenkinsci.plugins.casc.BaseConfigurator configure)
      

          [JENKINS-52275] labels field is ignored when set through configuration-as-code

          This is now the only reason left that creating a pipeline from scratch after provisioning does not work.
          Going to wrap up the rest, and likely going to look into here.

          Baptiste Mathus added a comment - This is now the only reason left that creating a pipeline from scratch after provisioning does not work. Going to wrap up the rest, and likely going to look into here.

          Using labelString actually makes everything work fine. Hence lowering the priority. Keeping it open as still this would be awesome if the CasC plugin could just fail fast in this situation. Not really sure it's even feasible though.

          Baptiste Mathus added a comment - Using labelString actually makes everything work fine. Hence lowering the priority. Keeping it open as still this would be awesome if the CasC plugin could just fail fast in this situation. Not really sure it's even feasible though.

            francisu Francis Upton
            batmat Baptiste Mathus
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: