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

          Baptiste Mathus created issue -
          Baptiste Mathus made changes -
          Epic Link New: JENKINS-49853 [ 188837 ]
          Baptiste Mathus made changes -
          Link New: This issue blocks JENKINS-49853 [ JENKINS-49853 ]
          Oleg Nenashev made changes -
          Labels Original: essentials essentials-triggered New: essentials essentials-triggered jcasc-compatibility

          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.
          Baptiste Mathus made changes -
          Description Original: 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.
          New: 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:

          {noformat}
          [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)
          {noformat}
          Baptiste Mathus made changes -
          Remote Link New: This issue links to "PR with a failing test showing the issue (316d75d72bbba9083a194d645b43e7dafa201321) (Web Link)" [ 21133 ]
          Baptiste Mathus made changes -
          Priority Original: Major [ 3 ] New: Minor [ 4 ]

          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.
          Nicolas De Loof made changes -
          Assignee Original: Ewelina Wilkosz [ ewel ] New: Nicolas De Loof [ ndeloof ]

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

              Created:
              Updated: