Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-24485

The sc.reclaimPolicy: "" should be treated as invalid input and creation should be reject when creating storageclass

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Undefined
    • None
    • 4.15
    • Storage / Kubernetes
    • None
    • Low
    • No
    • False
    • Hide

      None

      Show
      None

    Description

      Description of problem:

      When creating storageclass with reclaimPolicy: "", the creation get succeed and there is null reclaimPolicy in srorageclass:
      
      $ cat<<EOF| oc create -f -
      > allowVolumeExpansion: true
      > apiVersion: storage.k8s.io/v1
      > kind: StorageClass
      > metadata:
      >   name: thin-csi-copy
      > parameters:
      >   StoragePolicyName: openshift-storage-policy-wduan-vsphere-x2v4c
      > provisioner: csi.vsphere.vmware.com
      > reclaimPolicy: ""
      > EOF
      storageclass.storage.k8s.io/thin-csi-copy created
      
      $ oc get sc thin-csi-copy
      NAME            PROVISIONER              RECLAIMPOLICY   VOLUMEBINDINGMODE   ALLOWVOLUMEEXPANSION   AGE
      thin-csi-copy   csi.vsphere.vmware.com                   Immediate           true                   19s
      
      $ oc get sc thin-csi-copy -o json | jq .reclaimPolicy
      ""

       

      Version-Release number of selected component (if applicable):

        4.15 nightly, it should be the same as previous releases 

      How reproducible:

      Always

      Steps to Reproduce:

      See description

      Actual results:

      The storageclass creation get succeed and there is null reclaimPolicy in srorageclass

      Expected results:

      The storageclass creation should be rejected.

      Additional info:

      1. Similar for sc.volumeBindingMode, it is rejected when set volumeBindingMode: ""
      
      $ cat<<EOF| oc create -f -
      > allowVolumeExpansion: true
      > apiVersion: storage.k8s.io/v1
      > kind: StorageClass
      > metadata:
      >   name: thin-csi-copy
      > parameters:
      >   StoragePolicyName: openshift-storage-policy-wduan-vsphere-x2v4c
      > provisioner: csi.vsphere.vmware.com
      > volumeBindingMode: ""
      > EOF
      The StorageClass "thin-csi-copy" is invalid: volumeBindingMode: Unsupported value: "": supported values: "Immediate", "WaitForFirstConsumer"

       

      Attachments

        Activity

          People

            fbertina@redhat.com Fabio Bertinatto
            wduan@redhat.com Wei Duan
            Wei Duan Wei Duan
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: