Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1788916

Summary: Local persistent storage operator is unexpectedly removing storageclass annotations
Product: OpenShift Container Platform Reporter: Pedro Amoedo <pamoedom>
Component: StorageAssignee: Hemant Kumar <hekumar>
Status: CLOSED ERRATA QA Contact: Liang Xia <lxia>
Severity: low Docs Contact:
Priority: unspecified    
Version: 4.2.zCC: aos-bugs, hekumar, jsafrane, pamoedom
Target Milestone: ---   
Target Release: 4.4.0   
Hardware: x86_64   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1803215 1803216 (view as bug list) Environment:
Last Closed: 2020-05-04 11:23:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1798198    
Bug Blocks: 1803215    

Description Pedro Amoedo 2020-01-08 11:19:09 UTC
Description of problem:

Making use of Local-Storage-Operator, when having more than one storageclass and setting the local sc (kubernetes.io/no-provisioner) as default with the following command:

~~~
oc patch sc localblock-sc -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'
~~~

the annotation seems to be removed when a rolling update of the "local-disks-local-diskmaker" & "local-disks-local-provisioner" daemonsets happens:

~~~
$ oc get sc | grep local
local-sc   kubernetes.io/no-provisioner   12h

$ oc get daemonsets -n local-storage
NAME                                           DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR   AGE
daemonset.apps/local-disks-local-diskmaker     2         2         2       2            2           <none>          12h
daemonset.apps/local-disks-local-provisioner   2         2         2       2            2           <none>          12h
~~~

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

OCP 4.2.7
local-storage-operator.4.2.5-201911121709

How reproducible:

Always (time of occurrence varies)

Steps to Reproduce:
1. OCP4.2.x cluster without cloudprovider integration.
2. Local-storage-operator with proper localvolume (storageclass of type kubernetes.io/no-provisioner is automatically created)
3. Having more than one storageclass present and setting "storageclass.kubernetes.io/is-default-class: true" for the local sc.

Actual results:

The annotation gets removed and no default storageclass is present.

Expected results:

Annotation still present?
Maybe the local-volume template could contemplate an extra option for that value?

Master Log:
N/A

Node Log (of failed PODs):
PFA the local-storage-operator pod logs.

PV Dump:
N/A

PVC Dump:
N/A

StorageClass Dump (if StorageClass used by PV/PVC):

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  creationTimestamp: "2019-12-23T02:02:40Z"
  labels:
    local.storage.openshift.io/owner-name: local-disks
    local.storage.openshift.io/owner-namespace: local-storage
  name: local-sc
  ownerReferences:
  - apiVersion: local.storage.openshift.io/v1
    controller: true
    kind: LocalVolume
    name: local-disks
    uid: f210129e-0c6a-11ea-8ea6-005056b96445
  resourceVersion: "17762676"
  selfLink: /apis/storage.k8s.io/v1/storageclasses/local-sc
  uid: 4ca3f619-2528-11ea-9ce8-005056b96445
provisioner: kubernetes.io/no-provisioner
reclaimPolicy: Delete
volumeBindingMode: WaitForFirstConsumer

Additional info:

apiVersion: "local.storage.openshift.io/v1"
kind: "LocalVolume"
metadata:
  name: "local-disks"
  namespace: "local-storage"
spec:
  storageClassDevices:
    - storageClassName: "local-sc"
      volumeMode: Filesystem
      fsType: xfs
      devicePaths:
        - /dev/sdb1
        - /dev/sdb2
        - /dev/sdb3
        - /dev/sdb4
[...]

Comment 15 Liang Xia 2020-02-14 08:03:13 UTC
Verified the annotations (default storage class annotation) is not removed after updating localvolume CR.

local-storage-operator.4.4.0-202002131916
OpenShift Version 4.4.0-0.nightly-2020-02-13-212616

Comment 18 errata-xmlrpc 2020-05-04 11:23:07 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:0581