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

Can't use Octal mode number when using pod template's Raw YAML to config volumes

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • kubernetes-plugin
    • None
    • jenkins: Version 2.421
      k8s: 1.25.0
      plugin version: 4029.v5712230ccb_f8
    • kubernetes-plugin:4208.v4017b_a_27a_d67

      I'm using pod template, and use Raw YAML to config my volumes.

      I have use this for a long time(at least 3 months), it always works.

      However, when i upgrade Kubernetes plugin to latest version(4029.v5712230ccb_f8) today, my pod cannot create successfully, it shows :

       

      ...
       message-pod "xxx'
      is invalid: [spec.volumes5).configMap.defaultMode: Invalid value: 755: must be a number between 0 and 0777 (octal), both
      inclusive,
      ...
      

       

       

      my pod template's row yaml is:

       

       

      apiVersion: "v1"
      kind: "Pod"
      metadata:
          namespace: build
      spec:
        shareProcessNamespace: true
        automountServiceAccountToken: false
        tolerations:
          - key: "build_node"
            operator: "Exists"
            effect: "NoSchedule"
        nodeSelector:
          build-node: node
        containers:
        - name: "k8s"
          volumeMounts:
          - mountPath: "/usr/local/bin/help_deploy.sh"
            name: "helm-volume"
            readOnly: false
            subPath: "script.sh"
        volumes:
        - configMap:
            name: "helm"
            defaultMode: 0755
            optional: false
          name: "helm-volume"
       
      

       

      this sees be a bug of new version.

       

       

       

       

          [JENKINS-71956] Can't use Octal mode number when using pod template's Raw YAML to config volumes

          Jiang created issue -
          Jiang made changes -
          Description Original: I'm using pod template, and use Raw YAML to config my volumes.

          I have use this for a long time(at least 3 months), it always works.

          However, when i upgrade [Kubernetes plugin|https://plugins.jenkins.io/kubernetes] to latest version today, my pod cannot create successfully, it shows :

           

          ...

           message-pod "xxx'
          is invalid: [spec.volumes5).configMap.defaultMode: Invalid value: 755: must be a number between 0 and 0777 (octal), both
          inclusive,

          ...

           

          my pod template's row yaml is:

           

          apiVersion: "v1"
          kind: "Pod"
          metadata:
              namespace: build
          spec:
            shareProcessNamespace: true
            automountServiceAccountToken: false
            tolerations:
              - key: "build_node"
                operator: "Exists"
                effect: "NoSchedule"
            nodeSelector:
              build-node: node
            containers:
            - name: "k8s"
              volumeMounts:
              - mountPath: "/usr/local/bin/help_deploy.sh"
                name: "helm-volume"
                readOnly: false
                subPath: "script.sh"

            volumes:
            - configMap:
                name: "helm"
          {color:#FF0000}      defaultMode: 0755{color}
                optional: false
              name: "helm-volume"

           

          this sees be a bug of new version.

           

           

           

           
          New: I'm using pod template, and use Raw YAML to config my volumes.

          I have use this for a long time(at least 3 months), it always works.

          However, when i upgrade [Kubernetes plugin|https://plugins.jenkins.io/kubernetes] to latest version today, my pod cannot create successfully, it shows :

           
          {code:java}
          ...
           message-pod "xxx'
          is invalid: [spec.volumes5).configMap.defaultMode: Invalid value: 755: must be a number between 0 and 0777 (octal), both
          inclusive,
          ...
          {code}
           

           

          my pod template's row yaml is:

           

           
          {code:java}
          apiVersion: "v1"
          kind: "Pod"
          metadata:
              namespace: build
          spec:
            shareProcessNamespace: true
            automountServiceAccountToken: false
            tolerations:
              - key: "build_node"
                operator: "Exists"
                effect: "NoSchedule"
            nodeSelector:
              build-node: node
            containers:
            - name: "k8s"
              volumeMounts:
              - mountPath: "/usr/local/bin/help_deploy.sh"
                name: "helm-volume"
                readOnly: false
                subPath: "script.sh"
            volumes:
            - configMap:
                name: "helm"
                defaultMode: 0755
                optional: false
              name: "helm-volume"
           
          {code}
           

          this sees be a bug of new version.

           

           

           

           
          Jiang made changes -
          Description Original: I'm using pod template, and use Raw YAML to config my volumes.

          I have use this for a long time(at least 3 months), it always works.

          However, when i upgrade [Kubernetes plugin|https://plugins.jenkins.io/kubernetes] to latest version today, my pod cannot create successfully, it shows :

           
          {code:java}
          ...
           message-pod "xxx'
          is invalid: [spec.volumes5).configMap.defaultMode: Invalid value: 755: must be a number between 0 and 0777 (octal), both
          inclusive,
          ...
          {code}
           

           

          my pod template's row yaml is:

           

           
          {code:java}
          apiVersion: "v1"
          kind: "Pod"
          metadata:
              namespace: build
          spec:
            shareProcessNamespace: true
            automountServiceAccountToken: false
            tolerations:
              - key: "build_node"
                operator: "Exists"
                effect: "NoSchedule"
            nodeSelector:
              build-node: node
            containers:
            - name: "k8s"
              volumeMounts:
              - mountPath: "/usr/local/bin/help_deploy.sh"
                name: "helm-volume"
                readOnly: false
                subPath: "script.sh"
            volumes:
            - configMap:
                name: "helm"
                defaultMode: 0755
                optional: false
              name: "helm-volume"
           
          {code}
           

          this sees be a bug of new version.

           

           

           

           
          New: I'm using pod template, and use Raw YAML to config my volumes.

          I have use this for a long time(at least 3 months), it always works.

          However, when i upgrade [Kubernetes plugin|https://plugins.jenkins.io/kubernetes] to latest version(4029.v5712230ccb_f8) today, my pod cannot create successfully, it shows :

           
          {code:java}
          ...
           message-pod "xxx'
          is invalid: [spec.volumes5).configMap.defaultMode: Invalid value: 755: must be a number between 0 and 0777 (octal), both
          inclusive,
          ...
          {code}
           

           

          my pod template's row yaml is:

           

           
          {code:java}
          apiVersion: "v1"
          kind: "Pod"
          metadata:
              namespace: build
          spec:
            shareProcessNamespace: true
            automountServiceAccountToken: false
            tolerations:
              - key: "build_node"
                operator: "Exists"
                effect: "NoSchedule"
            nodeSelector:
              build-node: node
            containers:
            - name: "k8s"
              volumeMounts:
              - mountPath: "/usr/local/bin/help_deploy.sh"
                name: "helm-volume"
                readOnly: false
                subPath: "script.sh"
            volumes:
            - configMap:
                name: "helm"
                defaultMode: 0755
                optional: false
              name: "helm-volume"
           
          {code}
           

          this sees be a bug of new version.

           

           

           

           
          Allan BURDAJEWICZ made changes -
          Assignee New: Allan BURDAJEWICZ [ allan_burdajewicz ]
          Allan BURDAJEWICZ made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Allan BURDAJEWICZ made changes -
          Released As New: kubernetes-plugin:4208.v4017b_a_27a_d67
          Resolution New: Fixed [ 1 ]
          Status Original: In Progress [ 3 ] New: Resolved [ 5 ]
          Dion made changes -
          Link New: This issue causes JENKINS-73383 [ JENKINS-73383 ]

            allan_burdajewicz Allan BURDAJEWICZ
            xia_mu_jin_su Jiang
            Votes:
            3 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: