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

Add Pod Template Button (kubernetes-plugin) in system configuration not working after update matrix-auth plugin

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • matrix-auth plugin 2.1.1
      kubernetes plugin 1.0 and 1.1
      Jenkins Core 2.60.3 and 2.73.2
    • matrix-auth-2.5

      After updating matrix-auth plugin from 1.7 to 2.1.1 in jenkins system configuration ui the "Add Pod Template" button (provided by kubernetes plugin) does not display the pod template input fields as expected, instead button click has no effect. After reverting to 1.7. works as expected again.

      Tested with Jenkins 2.60.3 and 2.73.2 and kubernetes plugin 1.0 and 1.1

          [JENKINS-47885] Add Pod Template Button (kubernetes-plugin) in system configuration not working after update matrix-auth plugin

          Kai Dyrssen created issue -
          Daniel Beck made changes -
          Component/s New: kubernetes-plugin [ 20639 ]

          Daniel Beck added a comment -

          csanchez Any idea?

          Daniel Beck added a comment - csanchez Any idea?

          Daniel Beck added a comment -

          dyrssen

          does not work anymore

          Please be more specific about what you expect to happen, and what happens instead.

          Daniel Beck added a comment - dyrssen does not work anymore Please be more specific about what you expect to happen, and what happens instead.
          Kai Dyrssen made changes -
          Description Original: After updating matrix-auth plugin from 1.7 to 2.1.1 in jenkins system configuration ui the "Add Pod Template" button (provided by kubernetes plugin) does not work anymore. After reverting to 1.7. works as expected again.

          Tested with Jenkins 2.60.3 and 2.73.2 and kubernetes plugin 1.0 and 1.1
          New: After updating matrix-auth plugin from 1.7 to 2.1.1 in jenkins system configuration ui the "Add Pod Template" button (provided by kubernetes plugin) does not display the pod template input fields as expected, instead button click has no effect. After reverting to 1.7. works as expected again.

          Tested with Jenkins 2.60.3 and 2.73.2 and kubernetes plugin 1.0 and 1.1

          Kai Dyrssen added a comment -

          expected: Display UI fields to configure pod template
          actually: no effect

          I modified the description.

          Kai Dyrssen added a comment - expected: Display UI fields to configure pod template actually: no effect I modified the description.

          Daniel Beck added a comment -

          The "Add Pod Template" response includes node properties ("Advanced" section), and a feature added in Matrix Auth 2.0 is per-node permissions.

          There are JS errors in my browser console.

          It only happens in Project-based matrix permissions, not the other mode, because per-node permissions only exist in project-based.

           

          Daniel Beck added a comment - The "Add Pod Template" response includes node properties ("Advanced" section), and a feature added in Matrix Auth 2.0 is per-node permissions. There are JS errors in my browser console. It only happens in Project-based matrix permissions, not the other mode, because per-node permissions only exist in project-based.  

          Daniel Beck added a comment - https://github.com/jenkinsci/kubernetes-plugin/blob/4303ec3c913c80c020eb7a6880853dc1c4838325/src/main/resources/org/csanchez/jenkins/plugins/kubernetes/PodTemplate/config.jelly#L84 basically.

          Daniel Beck added a comment -

          The fact that kubernetes plugin passes a PodTemplate as Class<? extends Node> argument to getNodePropertyDescriptors is a clear bug.

          But at least it lets matrix-auth work around the problem.

          A long term solution (and one that would survive a "fix" of kubernetes plugin) would be to address the problem in the JavaScript involved here. matrix-auth's node property configuration is clearly not designed to be used like this. Unfortunately my JS-fu is lacking so I'm not sure where to begin here.

          Daniel Beck added a comment - The fact that kubernetes plugin passes a PodTemplate as  Class<? extends Node> argument to getNodePropertyDescriptors is a clear bug. But at least it lets matrix-auth work around the problem. A long term solution (and one that would survive a "fix" of kubernetes plugin) would be to address the problem in the JavaScript involved here. matrix-auth's node property configuration is clearly not designed to be used like this. Unfortunately my JS-fu is lacking so I'm not sure where to begin here.

          Daniel Beck added a comment -

          PR with workaround up at https://github.com/jenkinsci/matrix-auth-plugin/pull/41, please try the PR build on your staging environment.

          Daniel Beck added a comment - PR with workaround up at https://github.com/jenkinsci/matrix-auth-plugin/pull/41 , please try the PR build on your staging environment.

            danielbeck Daniel Beck
            dyrssen Kai Dyrssen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: