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 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.

          Kai Dyrssen added a comment -

          Daniel, thanks for the immediate response and PR. I tested the PR in my jenkins test environment and it solves this issue.

          Kai Dyrssen added a comment - Daniel, thanks for the immediate response and PR. I tested the PR in my jenkins test environment and it solves this issue.

          Code changed in jenkins
          User: Daniel Beck
          Path:
          src/main/java/org/jenkinsci/plugins/matrixauth/AuthorizationMatrixNodeProperty.java
          http://jenkins-ci.org/commit/matrix-auth-plugin/2a37deead032071e31cb8089d5983ebfd7c33ddc
          Log:
          JENKINS-47885 Work around a JS problem by preventing use in Kubernetes plugin

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Daniel Beck Path: src/main/java/org/jenkinsci/plugins/matrixauth/AuthorizationMatrixNodeProperty.java http://jenkins-ci.org/commit/matrix-auth-plugin/2a37deead032071e31cb8089d5983ebfd7c33ddc Log: JENKINS-47885 Work around a JS problem by preventing use in Kubernetes plugin

          Code changed in jenkins
          User: Daniel Beck
          Path:
          src/main/java/org/jenkinsci/plugins/matrixauth/AuthorizationMatrixNodeProperty.java
          http://jenkins-ci.org/commit/matrix-auth-plugin/b07d344ce6e0b9ab115aff6b58d9b32a2606ab3d
          Log:
          Merge pull request #41 from daniel-beck/JENKINS-47885

          JENKINS-47885 Work around a JS problem by preventing use in Kuberneā€¦

          Compare: https://github.com/jenkinsci/matrix-auth-plugin/compare/e871c8176093...b07d344ce6e0

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Daniel Beck Path: src/main/java/org/jenkinsci/plugins/matrixauth/AuthorizationMatrixNodeProperty.java http://jenkins-ci.org/commit/matrix-auth-plugin/b07d344ce6e0b9ab115aff6b58d9b32a2606ab3d Log: Merge pull request #41 from daniel-beck/ JENKINS-47885 JENKINS-47885 Work around a JS problem by preventing use in Kuberneā€¦ Compare: https://github.com/jenkinsci/matrix-auth-plugin/compare/e871c8176093...b07d344ce6e0

          Daniel Beck added a comment -

          This issue should remain open, as the change is only a workaround exploiting a bug in the Kubernetes plugin.

          Daniel Beck added a comment - This issue should remain open, as the change is only a workaround exploiting a bug in the Kubernetes plugin.

          Daniel Beck added a comment -

          Daniel Beck added a comment - https://github.com/jenkinsci/matrix-auth-plugin/pull/60/commits/6a788cd3ad07bcdc5bfba252c19d80a8daf4d408 looks promising.

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

              Created:
              Updated:
              Resolved: