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 issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

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

            Assignee:
            Unassigned
            Reporter:
            han xinhang
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Archived: