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

Labels view not refreshed when labels are added to a node (causing some time installer failure for ephemeral agents)

    • 2616.v07df00c08d42

      Hi,

      Took me a while to understand why tools were not installed on running agent even if the labels were set on the node.

      I happen that the https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/tools/ToolInstaller.java#L87 doesn't consider assigned labels (Typically the ones created by LabelFinder extensions). Like https://github.com/jenkinsci/platformlabeler-plugin/blob/master/src/main/java/org/jvnet/hudson/plugins/platformlabeler/PlatformLabeler.java#L40

      It's specially true of ephemeral agent and tool directive installation. Dynamic labels are assigned "too late" on the build.

      I propose to change it to (not tested)

      public boolean appliesTo(Node node) {
         Label l = Jenkins.get().getLabel(label);
         return l == null || node.getAssignedLabels().contains(l);
      }
      

       

      Any thought ?

        1. label2.PNG
          label2.PNG
          25 kB
        2. label.PNG
          label.PNG
          6 kB

          [JENKINS-72224] Labels view not refreshed when labels are added to a node (causing some time installer failure for ephemeral agents)

          Valentin Delaye created issue -
          Valentin Delaye made changes -
          Component/s New: platformlabeler-plugin [ 15650 ]
          Valentin Delaye made changes -
          Remote Link New: This issue links to "PR (Web Link)" [ 28995 ]
          Valentin Delaye made changes -
          Component/s Original: core [ 15593 ]
          Valentin Delaye made changes -
          Assignee New: Valentin Delaye [ jonesbusy ]
          Valentin Delaye made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Valentin Delaye made changes -
          Status Original: In Progress [ 3 ] New: In Review [ 10005 ]
          Mark Waite made changes -
          Released As New: https://github.com/jenkinsci/platformlabeler-plugin/releases/tag/2287.va_d728a_42d7f1
          Resolution New: Fixed [ 1 ]
          Status Original: In Review [ 10005 ] New: Closed [ 6 ]
          Valentin Delaye made changes -
          Status Original: Closed [ 6 ] New: Fixed but Unreleased [ 10203 ]
          Valentin Delaye made changes -
          Status Original: Fixed but Unreleased [ 10203 ] New: Resolved [ 5 ]
          Valentin Delaye made changes -

            jonesbusy Valentin Delaye
            jonesbusy Valentin Delaye
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: