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

When I use the persistent volume claim of kubernetes plugin and set read-only, readonly is now set under volumes, which should be under volumemounts

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • kubernetes-plugin
    • None

      When I use the persistent volume claim of kubernetes plugin and set read-only, readonly is now set under volumes, which should be under volumemounts. This will cause the actually mounted directory to still be written to or even deleted, which is dangerous

      -----------------------------------
      expect:
      -----------------------------------
      ...
          volumeMounts:
          - mountPath: "/tools"
            name: "volume-1"
            readOnly: true
      ...
        volumes:
        - name: "volume-1"
          persistentVolumeClaim:
            claimName: "jenkins-tools-pvc"
      ...

      -----------------------------------
      actual (This is wrong):
      -----------------------------------
      ...
          volumeMounts:
          - mountPath: "/tools"
            name: "volume-1"
            readOnly: false
      ...
        volumes:
        - name: "volume-1"
          persistentVolumeClaim:
            claimName: "jenkins-tools-pvc"
            readOnly: true
      ...

          [JENKINS-68978] When I use the persistent volume claim of kubernetes plugin and set read-only, readonly is now set under volumes, which should be under volumemounts

          han xinhang created issue -
          han xinhang made changes -
          Description Original: When I use the persistent volume claim of kubernetes plugin and set read-only, readonly is now set under volumes, which should be under volumemounts. This will cause the actually mounted directory to still be written to or even deleted, which is dangerous New: When I use the persistent volume claim of kubernetes plugin and set read-only, readonly is now set under volumes, which should be under volumemounts. This will cause the actually mounted directory to still be written to or even deleted, which is dangerous

           

           
          han xinhang made changes -
          Description Original: When I use the persistent volume claim of kubernetes plugin and set read-only, readonly is now set under volumes, which should be under volumemounts. This will cause the actually mounted directory to still be written to or even deleted, which is dangerous

           

           
          New: When I use the persistent volume claim of kubernetes plugin and set read-only, readonly is now set under volumes, which should be under volumemounts. This will cause the actually mounted directory to still be written to or even deleted, which is dangerous

          -----------------------------------
          expect:
          -----------------------------------
          ...
              volumeMounts:
              - mountPath: "/tools"
                name: "volume-1"
                readOnly: true
          ...
            volumes:
            - name: "volume-1"
              persistentVolumeClaim:
                claimName: "jenkins-tools-pvc"
          ...

          -----------------------------------
          actual (This is wrong):
          -----------------------------------
          ...
              volumeMounts:
              - mountPath: "/tools"
                name: "volume-1"
                readOnly: false
          ...
            volumes:
            - name: "volume-1"
              persistentVolumeClaim:
                claimName: "jenkins-tools-pvc"
                readOnly: true
          ...

          Damien Coraboeuf added a comment - - edited

          I can only confirm the issue Using version 3893.v73d36f3b_9103 of the plugin.

          Is there currently a workaround?

          Damien Coraboeuf added a comment - - edited I can only confirm the issue Using version 3893.v73d36f3b_9103 of the plugin. Is there currently a workaround?

            Unassigned Unassigned
            hanxinhang han xinhang
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: