Bug 1869590 - controller_maniladriver cannot create storage-class due to OSP manila invalid name
Summary: controller_maniladriver cannot create storage-class due to OSP manila invalid...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Storage
Version: 4.5
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: 4.5.z
Assignee: Mike Fedosin
QA Contact: Wei Duan
URL:
Whiteboard:
Depends On: 1869504
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-08-18 10:04 UTC by Mike Fedosin
Modified: 2020-09-30 12:48 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1869504
Environment:
Last Closed: 2020-09-30 12:48:40 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift csi-driver-manila-operator pull 52 0 None closed Bug 1869590: base storageclass names on lower case 2020-11-29 10:04:16 UTC
Red Hat Product Errata RHBA-2020:3768 0 None None None 2020-09-30 12:48:45 UTC

Description Mike Fedosin 2020-08-18 10:04:11 UTC
+++ This bug was initially created as a clone of Bug #1869504 +++

Description of problem:
When you create a ManilaDriver, if a visible (to the project) manila type exists that contains an upper case letter (valid name in OSP manila) then you cannot create PVCs for any manila type even when a storage class is created in OCP.

Version-Release number of selected component (if applicable):
OCP 4.5.5
OSP 16.1

How reproducible:
100%

Steps to Reproduce:
1. Create manila type on OSP with a name that contains a capital letter.
2. Create manila type on OSP with a name that contains only lower case letters.
3. Create a ManilaDriver on OCP

Actual results:
A storage class for the all lower case name is created but not for the manila type with the upper case letter in its name. No PVCs can be created on the valid storage-class.

Expected results:
Can crefate PVCs for valid manila type storage class.

Master Log:

Node Log (of failed PODs):
```
{"level":"info","ts":1597723637.172184,"logger":"controller_maniladriver","msg":"Reconciling Manila Credentials","Request.Namespace":"","Request.Name":"cluster"}
{"level":"info","ts":1597723637.213778,"logger":"controller_maniladriver","msg":"Creating a new Secret","Request.Namespace":"","Request.Name":"cluster","Secret.Namespace":"openshift-manila-csi-driver","Secret.Name":"csi-manila-secrets"}
{"level":"info","ts":1597723637.2215185,"logger":"controller_maniladriver","msg":"Fetching Manila Share Types","Request.Namespace":"","Request.Name":"cluster"}
{"level":"info","ts":1597723637.9286904,"logger":"controller_maniladriver","msg":"Reconciling Manila StorageClasses","Request.Namespace":"","Request.Name":"cluster"}
{"level":"info","ts":1597723637.9287562,"logger":"controller_maniladriver","msg":"Reconciling Manila StorageClass","Request.Namespace":"","Request.Name":"cluster","StorageClass.Name":"csi-manila-cluster"}
{"level":"info","ts":1597723637.9551845,"logger":"controller_maniladriver","msg":"Creating a new StorageClass","Request.Namespace":"","Request.Name":"cluster","StorageClass.Name":"csi-manila-cluster"}
{"level":"info","ts":1597723637.976047,"logger":"controller_maniladriver","msg":"Reconciling Manila StorageClass","Request.Namespace":"","Request.Name":"cluster","StorageClass.Name":"csi-manila-NFSTYPE"}
{"level":"info","ts":1597723637.9942188,"logger":"controller_maniladriver","msg":"Creating a new StorageClass","Request.Namespace":"","Request.Name":"cluster","StorageClass.Name":"csi-manila-NFSTYPE"}
{"level":"error","ts":1597723637.9961302,"logger":"controller-runtime.controller","msg":"Reconciler error","controller":"maniladriver-controller","request":"/cluster","error":"StorageClass.storage.k8s.io \"csi-manila-NFSTYPE\" is invalid: metadata.name: Invalid value: \"csi-manila-NFSTYPE\": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')","stacktrace":"github.com/go-logr/zapr.(*zapLogger).Error\n\t/go/src/github.com/openshift/csi-driver-manila-operator/vendor/github.com/go-logr/zapr/zapr.go:128\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\t/go/src/github.com/openshift/csi-driver-manila-operator/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:258\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\t/go/src/github.com/openshift/csi-driver-manila-operator/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:232\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).worker\n\t/go/src/github.com/openshift/csi-driver-manila-operator/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:211\nk8s.io/apimachinery/pkg/util/wait.JitterUntil.func1\n\t/go/src/github.com/openshift/csi-driver-manila-operator/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:152\nk8s.io/apimachinery/pkg/util/wait.JitterUntil\n\t/go/src/github.com/openshift/csi-driver-manila-operator/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:153\nk8s.io/apimachinery/pkg/util/wait.Until\n\t/go/src/github.com/openshift/csi-driver-manila-operator/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:88"}
{"level":"info","ts":1597723638.996293,"logger":"controller_maniladriver","msg":"Reconciling ManilaDriver","Request.Namespace":"","Request.Name":"cluster"}
{"level":"info","ts":1597723639.0029697,"logger":"controller_maniladriver","msg":"Reconciling Manila Driver Namespace","Request.Namespace":"","Request.Name":"cluster"}
{"level":"info","ts":1597723639.004993,"logger":"controller_maniladriver","msg":"Skip reconcile: Namespace already exists","Request.Namespace":"","Request.Name":"cluster","Namespace.Name":"openshift-manila-csi-driver"}
{"level":"info","ts":1597723639.0050025,"logger":"controller_maniladriver","msg":"Reconciling CA Cert ConfigMap","Request.Namespace":"","Request.Name":"cluster"}
{"level":"info","ts":1597723639.0069327,"logger":"controller_maniladriver","msg":"Reconciling Manila Credentials Request","Request.Namespace":"","Request.Name":"cluster"}
{"level":"info","ts":1597723639.0096223,"logger":"controller_maniladriver","msg":"Skip reconcile: CredentialsRequest already exists","Request.Namespace":"","Request.Name":"cluster","CredentialsRequest.Namespace":"openshift-cloud-credential-operator","CredentialsRequest.Name":"manila-csi-credentials-request"}
```
PV Dump:

PVC Dump:

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

Additional info:
```
vran, admin) [stack@vm-director-osp161 environments]$ manila type-list                                                                                                                                                                       
+--------------------------------------+---------+------------+------------+--------------------------------------+-----------------------------+-------------+                                                                               
| ID                                   | Name    | visibility | is_default | required_extra_specs                 | optional_extra_specs        | Description |                                                                               
+--------------------------------------+---------+------------+------------+--------------------------------------+-----------------------------+-------------+                                                                               
| f67997fb-0196-422d-8437-c105e003d0c3 | cluster | public     | -          | driver_handles_share_servers : False | share_backend_name : cephfs | OCP4        |                                                                               
| f9db3fea-5a64-441c-82ff-bd7de43b1cd3 | NFSTYPE | public     | -          | driver_handles_share_servers : False | share_backend_name : cephfs | None        |                                                                               
+--------------------------------------+---------+------------+------------+--------------------------------------+-----------------------------+-------------+                                                                               
(vran, admin) [stack@vm-director-osp161 environments]$
```

Comment 3 Wei Duan 2020-09-21 13:11:19 UTC
There are two share-type OSP16: "default" and "NFS"(with capital letters), manila csi driver are created successfully, and two storageclasses are created:
  
$ oc get sc
NAME                 PROVISIONER                RECLAIMPOLICY   VOLUMEBINDINGMODE      ALLOWVOLUMEEXPANSION   AGE
csi-manila-default   manila.csi.openstack.org   Delete          Immediate              false                  7m2s
csi-manila-nfs       manila.csi.openstack.org   Delete          Immediate              false                  7m2s
standard (default)   kubernetes.io/cinder       Delete          WaitForFirstConsumer   true                   9h

$ oc get sc csi-manila-nfs -ojson | jq .parameters.type
"NFS"

Created pvc with csi-manila-nfs and created pod consume pvc successfully, so mark this BZ as VERIFIED.

Comment 4 Wei Duan 2020-09-21 13:14:41 UTC
Test env:

$ oc get clusterversion
NAME      VERSION   AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.5.9     True        False         10h     Error while reconciling 4.5.9: an unknown error has occurred: MultipleErrors


$ oc get csv -n openshift-manila-csi-driver-operator
NAME                                 DISPLAY                      VERSION   REPLACES   PHASE
manila-csi-driver-operator.v4.5.10   Manila CSI Driver Operator   4.5.10               Succeeded

metadata:
csi-driver-manila-operator-metadata-container-v4.5.10-2	

Related images:
    image: registry.redhat.io/openshift4/ose-csi-driver-manila-rhel7@sha256:5cc8abd0b5f1371e1fb0fa454816bd99e566df3fc6c45412e3c953638c2e4f4b
    image: registry.redhat.io/openshift4/ose-csi-driver-manila-rhel7-operator@sha256:ab196bfda63d0cc72a9bad8bdde2009953ac6c0b8f37b998a0d4336fc9f62f27
    image: registry.redhat.io/openshift4/ose-csi-driver-nfs-rhel7@sha256:ca5e163ea6809a39613bf019194084cd271b88cd0ba1c079aa1d92501bc1477f
    image: registry.redhat.io/openshift4/ose-csi-external-provisioner-rhel7@sha256:0f35049599d8cc80f3a611fd3d02965317284a0151e98e0177e182fe733ee47c
    image: registry.redhat.io/openshift4/ose-csi-external-snapshotter-rhel7@sha256:bd81f802e9abc7869f6967828a304e84fa6a34f62ccbe96be3fdd8bf8eb143cb
    image: registry.redhat.io/openshift4/ose-csi-node-driver-registrar@sha256:6a62fefddc91157c443b3b8744ff7bc48e45b279b654c462f88455c5b3414a3e

Comment 6 errata-xmlrpc 2020-09-30 12:48:40 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 (OpenShift Container Platform 4.5.11 optional CSI driver Operators bug fix update), 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:3768


Note You need to log in before you can comment on or make changes to this bug.