Description of problem: When create empty reclaim policy for a storage class it should be the default one of "Delete" but not "Retain" Version-Release number of selected component (if applicable): openshift v3.11.0-0.16.0 kubernetes v1.11.0+d4cacc0 How reproducible: Always Steps to Reproduce: 1.Create a sc with "" reclaim policy 2.Create a pvc to use this sc 3.Check the pv reclaim policy Actual results: The pv reclaim policy is Retain Expected results: Should be Delete PV Dump: # oc get pv pvc-b593cdcd-a1f8-11e8-864b-42010af00009 -o yaml apiVersion: v1 kind: PersistentVolume metadata: annotations: kubernetes.io/createdby: gce-pd-dynamic-provisioner pv.kubernetes.io/bound-by-controller: "yes" pv.kubernetes.io/provisioned-by: kubernetes.io/gce-pd creationTimestamp: 2018-08-17T08:37:03Z finalizers: - kubernetes.io/pv-protection labels: failure-domain.beta.kubernetes.io/region: us-central1 failure-domain.beta.kubernetes.io/zone: us-central1-a name: pvc-b593cdcd-a1f8-11e8-864b-42010af00009 resourceVersion: "44316" selfLink: /api/v1/persistentvolumes/pvc-b593cdcd-a1f8-11e8-864b-42010af00009 uid: b79bb9e8-a1f8-11e8-864b-42010af00009 spec: accessModes: - ReadWriteOnce capacity: storage: 1Gi claimRef: apiVersion: v1 kind: PersistentVolumeClaim name: azpvc namespace: default resourceVersion: "44307" uid: b593cdcd-a1f8-11e8-864b-42010af00009 gcePersistentDisk: fsType: ext4 pdName: kubernetes-dynamic-pvc-b593cdcd-a1f8-11e8-864b-42010af00009 persistentVolumeReclaimPolicy: Retain storageClassName: standard volumeMode: Filesystem status: phase: Bound PVC Dump: # oc get pvc -o yaml apiVersion: v1 items: - apiVersion: v1 kind: PersistentVolumeClaim metadata: annotations: pv.kubernetes.io/bind-completed: "yes" pv.kubernetes.io/bound-by-controller: "yes" volume.beta.kubernetes.io/storage-provisioner: kubernetes.io/gce-pd creationTimestamp: 2018-08-17T08:37:00Z finalizers: - kubernetes.io/pvc-protection name: azpvc namespace: default resourceVersion: "44318" selfLink: /api/v1/namespaces/default/persistentvolumeclaims/azpvc uid: b593cdcd-a1f8-11e8-864b-42010af00009 spec: accessModes: - ReadWriteOnce resources: requests: storage: 1Gi storageClassName: standard volumeMode: Filesystem volumeName: pvc-b593cdcd-a1f8-11e8-864b-42010af00009 status: accessModes: - ReadWriteOnce capacity: storage: 1Gi phase: Bound kind: List metadata: resourceVersion: "" selfLink: "" StorageClass Dump (if StorageClass used by PV/PVC): # oc get sc standard -o yaml apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: annotations: storageclass.beta.kubernetes.io/is-default-class: "true" creationTimestamp: 2018-08-17T03:26:11Z name: standard resourceVersion: "2035" selfLink: /apis/storage.k8s.io/v1/storageclasses/standard uid: 49a0b43f-a1cd-11e8-9f5e-42010af00009 parameters: type: pd-standard provisioner: kubernetes.io/gce-pd reclaimPolicy: "" volumeBindingMode: Immediate Additional info:
since it is an API change, we may not be able to fix this. Several workarounds were proposed in my upstream PR Technically there is no bug in the sense that we never documented that "" should default to Delete, we only documented that nil should default to Delete. They are not the same thing, "" is undocumented behaviour. Either way I want to fix this somehow. https://bugzilla.redhat.com/show_bug.cgi?id=1608537
closing as dupe of https://bugzilla.redhat.com/show_bug.cgi?id=1608537 as discussed there, we discovered this issue because of some unintended change in openshift-ansible. IMO that unintended change is itself a bug, I opened an issue at https://github.com/openshift/openshift-ansible/issues/9340 and we can choose to open a bug against openshift-ansible if we want. *** This bug has been marked as a duplicate of bug 1608537 ***